[Libreoffice-commits] .: 3 commits - package/inc package/source sd/source solenv/bin sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Sat Jun 2 07:17:36 PDT 2012


 package/inc/PackageConstants.hxx           |   24 +++----
 package/source/manifest/ManifestImport.cxx |   97 +++++++++++++++--------------
 package/source/manifest/ManifestImport.hxx |    4 -
 sd/source/ui/app/menuids_tmpl.src          |    6 +
 solenv/bin/callcatcher.Makefile            |    2 
 sw/source/ui/app/mn.src                    |    9 ++
 6 files changed, 83 insertions(+), 59 deletions(-)

New commits:
commit 516c63442b2ae58f611c7d8932cd0bf1f0aead81
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jun 2 13:46:39 2012 +0100

    unset MAKEFLAGS for findunusedcode too
    
    Change-Id: Id42e7b14d98f072ea17b203af7ffdc8fe7a7a74f

diff --git a/solenv/bin/callcatcher.Makefile b/solenv/bin/callcatcher.Makefile
index 7a7c2b9..b0164ef 100644
--- a/solenv/bin/callcatcher.Makefile
+++ b/solenv/bin/callcatcher.Makefile
@@ -23,7 +23,7 @@ export dbglevel:=2
 include $(SOLARENV)/gbuild/gbuild.mk
 
 findunusedcode:
-	cd instsetoo_native && \
+	cd instsetoo_native && unset MAKEFLAGS && \
         $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
 	ooinstall -l $(DEVINSTALLDIR)/opt
 	$(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post subsequentcheck
commit 862a50fef87379da03758aeab8b74137f7c83297
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jun 2 13:25:54 2012 +0100

    These should be set as checkable menu entries
    
    So use Checkable = TRUE
    
    Change-Id: I13ca3cec05ed6fddb00b142bc70c892a75cd45ec

diff --git a/sd/source/ui/app/menuids_tmpl.src b/sd/source/ui/app/menuids_tmpl.src
index 932eb2d..e46209c 100644
--- a/sd/source/ui/app/menuids_tmpl.src
+++ b/sd/source/ui/app/menuids_tmpl.src
@@ -978,6 +978,7 @@
     {\
         Identifier = SID_GRID_VISIBLE ; \
         HelpId = CMD_SID_GRID_VISIBLE ; \
+        Checkable = TRUE ; \
         Text [ en-US ] = "~Display Grid" ; \
     };
 
@@ -986,6 +987,7 @@
     {\
         Identifier = SID_GRID_USE ; \
         HelpId = CMD_SID_GRID_USE; \
+        Checkable = TRUE ; \
         Text [ en-US ] = "Snap to Grid"; \
     };
 
@@ -994,6 +996,7 @@
     {\
         Identifier = SID_GRID_FRONT ; \
         HelpId = CMD_SID_GRID_FRONT ; \
+        Checkable = TRUE ; \
         Text [ en-US ] = "Grid to ~Front" ; \
     };
 
@@ -1019,6 +1022,7 @@
     {\
         Identifier = SID_HELPLINES_VISIBLE ; \
         HelpId = CMD_SID_HELPLINES_VISIBLE ; \
+        Checkable = TRUE ; \
         Text [ en-US ] = "~Display Snap Lines" ; \
     };
 
@@ -1027,6 +1031,7 @@
     {\
         Identifier = SID_HELPLINES_USE ; \
         HelpId = CMD_SID_HELPLINES_USE ; \
+        Checkable = TRUE ; \
         Text [ en-US ] = "~Snap to Snap Lines"; \
     };
 
@@ -1035,6 +1040,7 @@
     {\
         Identifier = SID_HELPLINES_FRONT ; \
         HelpId = CMD_SID_HELPLINES_FRONT ; \
+        Checkable = TRUE ; \
         Text [ en-US ] = "Snap Lines to ~Front" ; \
     };
 
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index e1f2aa1..db394cb 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -77,30 +77,37 @@
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_WEIGHT\
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_POSTURE\
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_OVERLINE\
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_UNDERLINE\
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_STRIKEOUT\
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_SHADOWED\
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     ITEM_FORMAT_ATTR_CHAR_CONTOUR\
+                    Checkable = TRUE ; \
                 };\
                 SEPARATOR ; \
                 MenuItem\
@@ -108,12 +115,14 @@
                     Identifier = FN_SET_SUPER_SCRIPT ; \
                     HelpId = CMD_FN_SET_SUPER_SCRIPT ; \
                     Text [ en-US ] = "Superscript" ; \
+                    Checkable = TRUE ; \
                 };\
                 MenuItem\
                 {\
                     Identifier = FN_SET_SUB_SCRIPT ; \
                     HelpId = CMD_FN_SET_SUB_SCRIPT ; \
                     Text [ en-US ] = "Subscript" ; \
+                    Checkable = TRUE ; \
                 };\
             };\
         };\
commit 4a7164429b727bd8fd6f183950e85e6225869364
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 28 11:43:09 2012 +0100

    count and order of receipt of properties doesn't matter
    
    so stick imported properties into assigned slots and throw out empty ones when
    finished. Reuse existing ids for this between import and export. Shuffle
    FULLPATH to 0 as per import comment
    
    Change-Id: I516116c5327498ad043f6e2fb9bd257599ade2a2

diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx
index be82010..7590acd 100644
--- a/package/inc/PackageConstants.hxx
+++ b/package/inc/PackageConstants.hxx
@@ -40,19 +40,19 @@ const sal_Int32 n_ConstDigestLength = 1024;
 const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32
 
 // the constants related to the manifest.xml entries
-#define PKG_MNFST_MEDIATYPE   0
-#define PKG_MNFST_VERSION     1
-#define PKG_MNFST_FULLPATH    2
+#define PKG_MNFST_FULLPATH    0 //FullPath (Put full-path property first for MBA)
+#define PKG_MNFST_VERSION     1 //Version
+#define PKG_MNFST_MEDIATYPE   2 //MediaType
 
-#define PKG_MNFST_INIVECTOR   3
-#define PKG_MNFST_SALT        4
-#define PKG_MNFST_ITERATION   5
-#define PKG_MNFST_UCOMPSIZE   6
-#define PKG_MNFST_DIGEST      7
-#define PKG_MNFST_ENCALG      8
-#define PKG_MNFST_STARTALG    9
-#define PKG_MNFST_DIGESTALG  10
-#define PKG_MNFST_DERKEYSIZE 11
+#define PKG_MNFST_INIVECTOR   3 //InitialisationVector
+#define PKG_MNFST_SALT        4 //Salt
+#define PKG_MNFST_ITERATION   5 //IterationCount
+#define PKG_MNFST_UCOMPSIZE   6 //Size
+#define PKG_MNFST_DIGEST      7 //Digest
+#define PKG_MNFST_ENCALG      8 //EncryptionAlgorithm
+#define PKG_MNFST_STARTALG    9 //StartKeyAlgorithm
+#define PKG_MNFST_DIGESTALG  10 //DigestAlgorithm
+#define PKG_MNFST_DERKEYSIZE 11 //DerivedKeySize
 
 #define PKG_SIZE_NOENCR_MNFST 3
 #define PKG_SIZE_ENCR_MNFST   12
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index f8590fe..ac6c3ef 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -44,8 +44,7 @@ using ::rtl::OUString;
 
 // ---------------------------------------------------
 ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManVector )
-: nNumProperty ( 0 )
-, bIgnoreEncryptData    ( sal_False )
+: bIgnoreEncryptData    ( sal_False )
 , nDerivedKeySize( 0 )
 , rManVector ( rNewManVector )
 
@@ -126,28 +125,26 @@ void SAL_CALL ManifestImport::endDocument(  )
 void ManifestImport::doFileEntry(StringHashMap &rConvertedAttribs)
         throw( uno::RuntimeException )
 {
-    aSequence.realloc ( PKG_SIZE_ENCR_MNFST );
+    aSequence.resize(PKG_SIZE_ENCR_MNFST);
 
-    // Put full-path property first for MBA
-    aSequence[nNumProperty].Name = sFullPathProperty;
-    aSequence[nNumProperty++].Value <<= rConvertedAttribs[sFullPathAttribute];
-    aSequence[nNumProperty].Name = sMediaTypeProperty;
-    aSequence[nNumProperty++].Value <<= rConvertedAttribs[sMediaTypeAttribute];
+    aSequence[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
+    aSequence[PKG_MNFST_FULLPATH].Value <<= rConvertedAttribs[sFullPathAttribute];
+    aSequence[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
+    aSequence[PKG_MNFST_MEDIATYPE].Value <<= rConvertedAttribs[sMediaTypeAttribute];
 
     OUString sVersion = rConvertedAttribs[sVersionAttribute];
     if ( sVersion.getLength() )
     {
-        aSequence[nNumProperty].Name = sVersionProperty;
-        aSequence[nNumProperty++].Value <<= sVersion;
+        aSequence[PKG_MNFST_VERSION].Name = sVersionProperty;
+        aSequence[PKG_MNFST_VERSION].Value <<= sVersion;
     }
 
     OUString sSize = rConvertedAttribs[sSizeAttribute];
     if ( sSize.getLength() )
     {
-        sal_Int32 nSize;
-        nSize = sSize.toInt32();
-        aSequence[nNumProperty].Name = sSizeProperty;
-        aSequence[nNumProperty++].Value <<= nSize;
+        sal_Int32 nSize = sSize.toInt32();
+        aSequence[PKG_MNFST_UCOMPSIZE].Name = sSizeProperty;
+        aSequence[PKG_MNFST_UCOMPSIZE].Value <<= nSize;
     }
 }
 
@@ -162,13 +159,13 @@ void ManifestImport::doEncryptionData(StringHashMap &rConvertedAttribs)
     {
         if ( aString.equals( sSHA1_1k_Name ) || aString.equals( sSHA1_1k_URL ) )
         {
-            aSequence[nNumProperty].Name = sDigestAlgProperty;
-            aSequence[nNumProperty++].Value <<= xml::crypto::DigestID::SHA1_1K;
+            aSequence[PKG_MNFST_DIGESTALG].Name = sDigestAlgProperty;
+            aSequence[PKG_MNFST_DIGESTALG].Value <<= xml::crypto::DigestID::SHA1_1K;
         }
         else if ( aString.equals( sSHA256_1k_URL ) )
         {
-            aSequence[nNumProperty].Name = sDigestAlgProperty;
-            aSequence[nNumProperty++].Value <<= xml::crypto::DigestID::SHA256_1K;
+            aSequence[PKG_MNFST_DIGESTALG].Name = sDigestAlgProperty;
+            aSequence[PKG_MNFST_DIGESTALG].Value <<= xml::crypto::DigestID::SHA256_1K;
         }
         else
             bIgnoreEncryptData = sal_True;
@@ -178,8 +175,8 @@ void ManifestImport::doEncryptionData(StringHashMap &rConvertedAttribs)
             aString = rConvertedAttribs[sChecksumAttribute];
             uno::Sequence < sal_Int8 > aDecodeBuffer;
             ::sax::Converter::decodeBase64(aDecodeBuffer, aString);
-            aSequence[nNumProperty].Name = sDigestProperty;
-            aSequence[nNumProperty++].Value <<= aDecodeBuffer;
+            aSequence[PKG_MNFST_DIGEST].Name = sDigestProperty;
+            aSequence[PKG_MNFST_DIGEST].Value <<= aDecodeBuffer;
         }
     }
 }
@@ -192,27 +189,27 @@ void ManifestImport::doAlgorithm(StringHashMap &rConvertedAttribs)
         OUString aString = rConvertedAttribs[sAlgorithmNameAttribute];
         if ( aString.equals( sBlowfish_Name ) || aString.equals( sBlowfish_URL ) )
         {
-            aSequence[nNumProperty].Name = sEncryptionAlgProperty;
-            aSequence[nNumProperty++].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8;
+            aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty;
+            aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8;
         }
         else if ( aString.equals( sAES256_URL ) )
         {
-            aSequence[nNumProperty].Name = sEncryptionAlgProperty;
-            aSequence[nNumProperty++].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
+            aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty;
+            aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
             OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 32, "Unexpected derived key length!" );
             nDerivedKeySize = 32;
         }
         else if ( aString.equals( sAES192_URL ) )
         {
-            aSequence[nNumProperty].Name = sEncryptionAlgProperty;
-            aSequence[nNumProperty++].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
+            aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty;
+            aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
             OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 24, "Unexpected derived key length!" );
             nDerivedKeySize = 24;
         }
         else if ( aString.equals( sAES128_URL ) )
         {
-            aSequence[nNumProperty].Name = sEncryptionAlgProperty;
-            aSequence[nNumProperty++].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
+            aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty;
+            aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
             OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 16, "Unexpected derived key length!" );
             nDerivedKeySize = 16;
         }
@@ -224,8 +221,8 @@ void ManifestImport::doAlgorithm(StringHashMap &rConvertedAttribs)
             aString = rConvertedAttribs[sInitialisationVectorAttribute];
             uno::Sequence < sal_Int8 > aDecodeBuffer;
             ::sax::Converter::decodeBase64(aDecodeBuffer, aString);
-            aSequence[nNumProperty].Name = sInitialisationVectorProperty;
-            aSequence[nNumProperty++].Value <<= aDecodeBuffer;
+            aSequence[PKG_MNFST_INIVECTOR].Name = sInitialisationVectorProperty;
+            aSequence[PKG_MNFST_INIVECTOR].Value <<= aDecodeBuffer;
         }
     }
 }
@@ -241,12 +238,12 @@ void ManifestImport::doKeyDerivation(StringHashMap &rConvertedAttribs)
             aString = rConvertedAttribs[sSaltAttribute];
             uno::Sequence < sal_Int8 > aDecodeBuffer;
             ::sax::Converter::decodeBase64(aDecodeBuffer, aString);
-            aSequence[nNumProperty].Name = sSaltProperty;
-            aSequence[nNumProperty++].Value <<= aDecodeBuffer;
+            aSequence[PKG_MNFST_SALT].Name = sSaltProperty;
+            aSequence[PKG_MNFST_SALT].Value <<= aDecodeBuffer;
 
             aString = rConvertedAttribs[sIterationCountAttribute];
-            aSequence[nNumProperty].Name = sIterationCountProperty;
-            aSequence[nNumProperty++].Value <<= aString.toInt32();
+            aSequence[PKG_MNFST_ITERATION].Name = sIterationCountProperty;
+            aSequence[PKG_MNFST_ITERATION].Value <<= aString.toInt32();
 
             aString = rConvertedAttribs[sKeySizeAttribute];
             if ( aString.getLength() )
@@ -260,8 +257,8 @@ void ManifestImport::doKeyDerivation(StringHashMap &rConvertedAttribs)
             else if ( nDerivedKeySize != 16 )
                 OSL_ENSURE( sal_False, "Default derived key length differs from the expected one!" );
 
-            aSequence[nNumProperty].Name = sDerivedKeySizeProperty;
-            aSequence[nNumProperty++].Value <<= nDerivedKeySize;
+            aSequence[PKG_MNFST_DERKEYSIZE].Name = sDerivedKeySizeProperty;
+            aSequence[PKG_MNFST_DERKEYSIZE].Value <<= nDerivedKeySize;
         }
         else
             bIgnoreEncryptData = sal_True;
@@ -274,13 +271,13 @@ void ManifestImport::doStartKeyAlg(StringHashMap &rConvertedAttribs)
     OUString aString = rConvertedAttribs[sStartKeyAlgNameAttribute];
     if ( aString.equals( sSHA256_URL ) )
     {
-        aSequence[nNumProperty].Name = sStartKeyAlgProperty;
-        aSequence[nNumProperty++].Value <<= xml::crypto::DigestID::SHA256;
+        aSequence[PKG_MNFST_STARTALG].Name = sStartKeyAlgProperty;
+        aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA256;
     }
     else if ( aString.equals( sSHA1_Name ) || aString.equals( sSHA1_URL ) )
     {
-        aSequence[nNumProperty].Name = sStartKeyAlgProperty;
-        aSequence[nNumProperty++].Value <<= xml::crypto::DigestID::SHA1;
+        aSequence[PKG_MNFST_STARTALG].Name = sStartKeyAlgProperty;
+        aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA1;
     }
     else
         bIgnoreEncryptData = sal_True;
@@ -349,6 +346,14 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re
     }
 }
 
+namespace
+{
+    bool isEmpty(const com::sun::star::beans::PropertyValue &rProp)
+    {
+        return rProp.Name.isEmpty();
+    }
+}
+
 // ---------------------------------------------------
 void SAL_CALL ManifestImport::endElement( const OUString& aName )
     throw( xml::sax::SAXException, uno::RuntimeException )
@@ -356,12 +361,16 @@ void SAL_CALL ManifestImport::endElement( const OUString& aName )
     ::rtl::OUString aConvertedName = ConvertName( aName );
     if ( !aStack.empty() && aStack.rbegin()->m_aConvertedName.equals( aConvertedName ) )
     {
-        if ( aConvertedName.equals( sFileEntryElement ) )
+        if ( aConvertedName.equals( sFileEntryElement ) && aStack.back().m_bValid )
         {
-            aSequence.realloc ( nNumProperty );
+            com::sun::star::beans::PropertyValue aEmpty;
+            aSequence.erase(std::remove_if(aSequence.begin(), aSequence.end(),
+                isEmpty), aSequence.end());
+
             bIgnoreEncryptData = sal_False;
-            rManVector.push_back ( aSequence );
-            nNumProperty = 0;
+            rManVector.push_back ( aSequence.getAsConstList() );
+
+            aSequence.clear();
         }
 
         aStack.pop_back();
diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx
index 5681f45..68afefd 100644
--- a/package/source/manifest/ManifestImport.hxx
+++ b/package/source/manifest/ManifestImport.hxx
@@ -31,6 +31,7 @@
 
 #include <cppuhelper/implbase1.hxx> // helper for implementations
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <comphelper/sequenceasvector.hxx>
 #include <vector>
 
 #include <HashMaps.hxx>
@@ -63,8 +64,7 @@ typedef ::std::vector< ManifestScopeEntry > ManifestStack;
 class ManifestImport : public cppu::WeakImplHelper1 < com::sun::star::xml::sax::XDocumentHandler >
 {
 protected:
-    com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aSequence;
-    sal_Int16       nNumProperty;
+    comphelper::SequenceAsVector< com::sun::star::beans::PropertyValue > aSequence;
     ManifestStack aStack;
     sal_Bool bIgnoreEncryptData;
     sal_Int32 nDerivedKeySize;


More information about the Libreoffice-commits mailing list