VirtualBox

Changeset 18588 in vbox


Ignore:
Timestamp:
Apr 1, 2009 9:06:55 AM (15 years ago)
Author:
vboxsync
Message:

OVF: write tags only if they aren't empty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r18583 r18588  
    26262626            std::list<VirtualSystemDescriptionEntry*> llVendorUrl = vsdescThis->findByType(VirtualSystemDescriptionType_VendorUrl);
    26272627            std::list<VirtualSystemDescriptionEntry*> llVersion = vsdescThis->findByType(VirtualSystemDescriptionType_Version);
    2628             if (llProduct.size() ||
    2629                 llProductUrl.size() ||
    2630                 llVendor.size() ||
    2631                 llVendorUrl.size() ||
    2632                 llVersion.size())
     2628            bool fProduct = llProduct.size() && !llProduct.front()->strVbox.isEmpty();
     2629            bool fProductUrl = llProductUrl.size() && !llProductUrl.front()->strVbox.isEmpty();
     2630            bool fVendor = llVendor.size() && !llVendor.front()->strVbox.isEmpty();
     2631            bool fVendorUrl = llVendorUrl.size() && !llVendorUrl.front()->strVbox.isEmpty();
     2632            bool fVersion = llVersion.size() && !llVersion.front()->strVbox.isEmpty();
     2633            if (fProduct ||
     2634                fProductUrl ||
     2635                fVersion ||
     2636                fVendorUrl ||
     2637                fVersion)
    26332638            {
    26342639                /* <Section ovf:required="false" xsi:type="ovf:ProductSection_Type">
     
    26422647                xml::ElementNode *pelmAnnotationSection = pelmVirtualSystem->createChild("ProductSection");
    26432648                pelmAnnotationSection->createChild("Info")->addContent("Meta-information about the installed software");
    2644                 if (llProduct.size() && !llProduct.front()->strVbox.isEmpty())
     2649                if (fProduct)
    26452650                    pelmAnnotationSection->createChild("Product")->addContent(llProduct.front()->strVbox);
    2646                 if (llVendor.size() && !llVendor.front()->strVbox.isEmpty())
     2651                if (fVendor)
    26472652                    pelmAnnotationSection->createChild("Vendor")->addContent(llVendor.front()->strVbox);
    2648                 if (llVersion.size() && !llVersion.front()->strVbox.isEmpty())
     2653                if (fVersion)
    26492654                    pelmAnnotationSection->createChild("Version")->addContent(llVersion.front()->strVbox);
    2650                 if (llProductUrl.size() && !llProductUrl.front()->strVbox.isEmpty())
     2655                if (fProductUrl)
    26512656                    pelmAnnotationSection->createChild("ProductUrl")->addContent(llProductUrl.front()->strVbox);
    2652                 if (llVendorUrl.size() && !llVendorUrl.front()->strVbox.isEmpty())
     2657                if (fVendorUrl)
    26532658                    pelmAnnotationSection->createChild("VendorUrl")->addContent(llVendorUrl.front()->strVbox);
    26542659            }
     
    26562661            // description
    26572662            std::list<VirtualSystemDescriptionEntry*> llDescription = vsdescThis->findByType(VirtualSystemDescriptionType_Description);
    2658             if (llDescription.size())
     2663            if (llDescription.size() &&
     2664                !llDescription.front()->strVbox.isEmpty())
    26592665            {
    26602666                /*  <Section ovf:required="false" xsi:type="ovf:AnnotationSection_Type">
     
    26692675            // license
    26702676            std::list<VirtualSystemDescriptionEntry*> llLicense = vsdescThis->findByType(VirtualSystemDescriptionType_License);
    2671             if (llLicense.size())
     2677            if (llLicense.size() &&
     2678                !llLicense.front()->strVbox.isEmpty())
    26722679            {
    26732680                /* <EulaSection>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette