[Libreoffice-commits] core.git: 7 commits - desktop/scripts desktop/source sw/source writerfilter/source xmloff/source

Michael Stahl mstahl at redhat.com
Wed May 20 12:24:19 PDT 2015


 desktop/scripts/soffice.sh                         |   22 +++++++++++--
 desktop/source/app/cmdlineargs.cxx                 |    1 
 sw/source/filter/ww8/fields.hxx                    |    2 +
 writerfilter/source/dmapper/FieldTypes.hxx         |    4 +-
 xmloff/source/core/DocumentSettingsContext.cxx     |   21 ++++++------
 xmloff/source/core/nmspmap.cxx                     |   14 +++-----
 xmloff/source/style/PageMasterExportPropMapper.cxx |   34 +++++++++------------
 xmloff/source/style/XMLFootnoteSeparatorExport.cxx |   14 ++------
 8 files changed, 59 insertions(+), 53 deletions(-)

New commits:
commit 484759aadd964b011e8e649ba021d09f40a79440
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 17:40:08 2015 +0200

    sw: add a comment about WW8 non-existent fields, related: tdf#88697
    
    Change-Id: Ie4da62a864233a7ab4587dd4e1b2f819a39e1441

diff --git a/sw/source/filter/ww8/fields.hxx b/sw/source/filter/ww8/fields.hxx
index 8bb8565..d6fa403 100644
--- a/sw/source/filter/ww8/fields.hxx
+++ b/sw/source/filter/ww8/fields.hxx
@@ -121,6 +121,8 @@ namespace ww
         eADDRESSBLOCK = 93,
         eGREETINGLINE = 94,
         eSHAPE = 95,
+        // NOTE: values > 95 / 0x5F do not correspond to documented WW8 fields
+        // and thus need special handling in WW8Export::OutputField()!
         eBIBLIOGRPAHY=96,
         eCITATION = 97
     };
commit 4a61fba7f1d1c457b8b5049644d793bd209d4f75
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 17:12:28 2015 +0200

    writerfilter: remove mojibake from comments
    
    Change-Id: I8662c3d34c0025379d4e7757b233befa7cae8235

diff --git a/writerfilter/source/dmapper/FieldTypes.hxx b/writerfilter/source/dmapper/FieldTypes.hxx
index 0ce6e1f..7fb9515 100644
--- a/writerfilter/source/dmapper/FieldTypes.hxx
+++ b/writerfilter/source/dmapper/FieldTypes.hxx
@@ -259,7 +259,7 @@ enum FieldId
     \f Builds a table of contents using TC entries instead of outline levels
     \h Hyperlinks the entries and page numbers within the table of contents
     \l Defines the TC entries field level used to build a table of contents
-    \n Builds a table of contents or a range of entries, sucah as �1-9�, in a table of contents without page numbers
+    \n Builds a table of contents or a range of entries, such as 1-9, in a table of contents without page numbers
     \o  Builds a table of contents by using outline levels instead of TC entries
     \p Defines the separator between the table entry and its page number
     \s  Builds a table of contents by using a sequence type
@@ -271,7 +271,7 @@ enum FieldId
      */
     ,FIELD_TOC
     /*
-     TOC entry: �text�
+     TOC entry: text
         \f TC entry in doc with multiple tables
         \l Outline Level
         \n Suppress page numbers
commit b1fac3dde682d321da01e2fb09e1f015f8c56775
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 12:35:31 2015 +0200

    desktop: add soffice --record parameter for easy use of rr
    
    Allow recording all JunitTests with "RR=1 make check".
    
    Change-Id: Ie540cb42990d3032d3fa38abedd4e5134f3ded2c

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 8729368..06a7ff7 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -64,14 +64,28 @@ fi
 GDBTRACECHECK=
 STRACECHECK=
 VALGRINDCHECK=
+RRCHECK=
 
 # count number of selected checks; only one is allowed
 checks=
+EXTRAOPT=
 # force the --valgrind option if the VALGRIND variable is set
-test -n "$VALGRIND" && VALGRINDOPT="--valgrind" || VALGRINDOPT=
+test -n "$VALGRIND" && EXTRAOPT="--valgrind"
 
-for arg in $@ $VALGRINDOPT ; do
+# force the --record option if the RR variable is set
+test -n "$RR" && EXTRAOPT="--record"
+
+for arg in $@ $EXTRAOPT ; do
     case "$arg" in
+        --record)
+            if which rr >/dev/null 2>&1 ; then
+                RRCHECK="rr record"
+                checks="c$checks"
+            else
+                echo "Error: Can't find the tool \"rr\", --record option will be ignored."
+                exit 1
+            fi
+            ;;
         --backtrace)
             if which gdb >/dev/null 2>&1 ; then
                 GDBTRACECHECK="gdb -nx --command=$sd_prog/gdbtrace --args"
@@ -122,7 +136,7 @@ for arg in $@ $VALGRINDOPT ; do
 done
 
 if echo "$checks" | grep -q "cc" ; then
-    echo "Error: The debug options --backtrace, --strace, and --valgrind cannot be used together."
+    echo "Error: The debug options --record, --backtrace, --strace, and --valgrind cannot be used together."
     echo "       Please, use them one by one."
     exit 1;
 fi
@@ -158,4 +172,4 @@ if [ -n "$VALGRINDCHECK" -a -z "$VALGRIND" ] ; then
 fi
 
 # oosplash does the rest: forcing pages in, javaldx etc. are
-exec $VALGRINDCHECK $STRACECHECK "$sd_prog/oosplash" "$@"
+exec $RRCHECK $VALGRINDCHECK $STRACECHECK "$sd_prog/oosplash" "$@"
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 9bbc36f..7fed61a 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -486,6 +486,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
                 // primitive tools that /bin/sh offers, ignore them here
                 if (
 #if defined UNX
+                    oArg != "record" &&
                     oArg != "backtrace" &&
                     oArg != "strace" &&
                     oArg != "valgrind" &&
commit e29a17ede22aee2fcc5e17f945c3e69d1927e7c1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 14:10:55 2015 +0200

    xmloff: convert legacy assertions in SvXMLNamespaceMap
    
    Change-Id: I9771bf3b727168bad6aeb07a2eb55eb08b1b6408

diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index e41fb92..78cf027 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -19,7 +19,6 @@
 
 #include <sal/config.h>
 
-#include <tools/debug.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
 
@@ -103,8 +102,7 @@ sal_uInt16 SvXMLNamespaceMap::Add( const OUString& rPrefix, const OUString& rNam
     if( XML_NAMESPACE_UNKNOWN == nKey )
         nKey = GetKeyByName( rName );
 
-    DBG_ASSERT( XML_NAMESPACE_NONE != nKey,
-                "SvXMLNamespaceMap::Add: invalid namespace key" );
+    assert(XML_NAMESPACE_NONE != nKey);
 
     if( XML_NAMESPACE_NONE == nKey )
         return USHRT_MAX;
@@ -119,8 +117,7 @@ sal_uInt16 SvXMLNamespaceMap::AddIfKnown( const OUString& rPrefix, const OUStrin
 {
     sal_uInt16 nKey = GetKeyByName( rName );
 
-    DBG_ASSERT( XML_NAMESPACE_NONE != nKey,
-                "SvXMLNamespaceMap::AddIfKnown: invalid namespace key" );
+    assert(XML_NAMESPACE_NONE);
 
     if( XML_NAMESPACE_NONE == nKey )
         return XML_NAMESPACE_UNKNOWN;
@@ -197,7 +194,7 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
     {
         case XML_NAMESPACE_UNKNOWN:
             // ...if it's a completely unknown namespace, assert and return the local name
-            DBG_ASSERT( false, "SvXMLNamespaceMap::GetQNameByKey: invalid namespace key" );
+            assert(false);
         case XML_NAMESPACE_NONE:
             // ...if there isn't one, return the local name
             return rLocalName;
@@ -260,7 +257,7 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
                 else
                 {
                     // ... if it isn't, this is a Bad Thing, assert and return the local name
-                    DBG_ASSERT( false, "SvXMLNamespaceMap::GetQNameByKey: invalid namespace key" );
+                    assert(false);
                     return rLocalName;
                 }
             }
@@ -387,8 +384,7 @@ bool SvXMLNamespaceMap::AddAtIndex( sal_uInt16 /*nIdx*/, const OUString& rPrefix
     if( XML_NAMESPACE_UNKNOWN == nKey )
         nKey = GetKeyByName( rName );
 
-    DBG_ASSERT( XML_NAMESPACE_NONE != nKey,
-                "SvXMLNamespaceMap::AddAtIndex: invalid namespace key" );
+    assert(XML_NAMESPACE_NONE != nKey);
     if( XML_NAMESPACE_NONE != nKey && ! ( aNameHash.count ( rPrefix ) ) )
     {
         _Add( rPrefix, rName, nKey );
commit a80da8e6558048239de977b665a58e62423c1f65
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 14:01:52 2015 +0200

    xmloff: convert legacy assertions in DocumentSettingsContext
    
    Change-Id: I2d13b43b6689e75185426854d749760f820884f9

diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 15e94ec..f5e7bf7 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -30,7 +30,6 @@
 #include <xmloff/xmlnmspe.hxx>
 #include <xmloff/nmspmap.hxx>
 #include <xmloff/xmluconv.hxx>
-#include <tools/debug.hxx>
 #include <comphelper/processfactory.hxx>
 
 #include <list>
@@ -70,7 +69,7 @@ XMLMyList::XMLMyList(const uno::Reference<uno::XComponentContext>& rxContext)
 :   nCount(0),
     m_xContext(rxContext)
 {
-    DBG_ASSERT( rxContext.is(), "got no service manager" );
+    assert(m_xContext.is());
 }
 
 uno::Sequence<beans::PropertyValue> XMLMyList::GetSequence()
@@ -78,7 +77,7 @@ uno::Sequence<beans::PropertyValue> XMLMyList::GetSequence()
     uno::Sequence<beans::PropertyValue> aSeq;
     if(nCount)
     {
-        DBG_ASSERT(nCount == aProps.size(), "wrong count of PropertyValue");
+        assert(nCount == aProps.size());
         aSeq.realloc(nCount);
         beans::PropertyValue* pProps = aSeq.getArray();
         std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
@@ -612,7 +611,8 @@ void XMLConfigItemContext::EndElement()
             mrAny <<= maDecoded;
         }
         else {
-            OSL_FAIL("wrong type");
+            SAL_INFO("xmloff.core",
+                    "XMLConfigItemContext: unknown type: " << msType);
         }
 
         ManipulateConfigItem();
@@ -620,7 +620,7 @@ void XMLConfigItemContext::EndElement()
         mpBaseContext->AddPropertyValue();
     }
     else {
-        OSL_FAIL("no BaseContext");
+        assert(false && "no BaseContext");
     }
 }
 
@@ -696,7 +696,7 @@ void XMLConfigItemMapNamedContext::EndElement()
         mpBaseContext->AddPropertyValue();
     }
     else {
-        OSL_FAIL("no BaseContext");
+        assert(false && "no BaseContext");
     }
 }
 
@@ -801,9 +801,10 @@ void XMLConfigItemMapIndexedContext::EndElement()
                             {
                                 xForbChars->setForbiddenCharacters( aLocale, aForbid );
                             }
-                            catch( uno::Exception& )
+                            catch (uno::Exception const& e)
                             {
-                                OSL_FAIL( "Exception while importing forbidden characters" );
+                                SAL_WARN("xmloff.core",
+                                    "Exception while importing forbidden characters: " << e.Message);
                             }
                         }
                     }
@@ -811,7 +812,7 @@ void XMLConfigItemMapIndexedContext::EndElement()
             }
             else
             {
-                OSL_FAIL( "could not get the XForbiddenCharacters from document!" );
+                SAL_WARN("xmloff.core", "could not get the XForbiddenCharacters from document!");
                 mrAny <<= maProps.GetIndexContainer();
             }
         }
@@ -906,7 +907,7 @@ void XMLConfigItemMapIndexedContext::EndElement()
         mpBaseContext->AddPropertyValue();
     }
     else {
-        OSL_FAIL("no BaseContext");
+        assert(false && "no BaseContext");
     }
 }
 
commit 18a712d2b3fe03629e00868ce17226994b7b7252
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 12:13:07 2015 +0200

    xmloff: convert legacy assertions in PageMasterExportPropMapper
    
    Make the properties optional, like XMLTextExportPropertySetMapper
    already does.
    
    Change-Id: Iee5d8ac113360937d8f3a3b867a6e6c7a18bbfa4

diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx
index 689fd5e..fa93757 100644
--- a/xmloff/source/style/PageMasterExportPropMapper.cxx
+++ b/xmloff/source/style/PageMasterExportPropMapper.cxx
@@ -22,7 +22,6 @@
 #include <comphelper/types.hxx>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <xmloff/PageMasterStyleMap.hxx>
-#include <tools/debug.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <comphelper/extract.hxx>
 
@@ -243,9 +242,10 @@ void XMLPageMasterExportPropMapper::handleElementItem(
         case CTF_PM_HEADERGRAPHICURL:
         case CTF_PM_FOOTERGRAPHICURL:
             {
-                DBG_ASSERT( pProperties && (nIdx >= 2), "property vector missing" );
-                sal_Int32 nPos;
-                sal_Int32 nFilter;
+                assert(pProperties);
+                assert(nIdx >= 2 && "horrible array ordering borked again");
+                sal_Int32 nPos(-1);
+                sal_Int32 nFilter(-1);
                 switch( nContextId  )
                 {
                 case CTF_PM_GRAPHICURL:
@@ -261,24 +261,22 @@ void XMLPageMasterExportPropMapper::handleElementItem(
                     nFilter = CTF_PM_FOOTERGRAPHICFILTER;
                     break;
                 default:
-                    nPos = 0;  // TODO What values should this be?
-                    nFilter = 0;
+                    assert(false);
                 }
                 const Any*  pPos    = NULL;
                 const Any*  pFilter = NULL;
-                if( pProperties && (nIdx >= 2) )
+                sal_uInt32 nIndex(nIdx - 1);
+                const XMLPropertyState& rFilter = (*pProperties)[nIndex];
+                if (getPropertySetMapper()->GetEntryContextId(rFilter.mnIndex) == nFilter)
                 {
-                    const XMLPropertyState& rPos = (*pProperties)[nIdx - 2];
-                    DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos,
-                                "invalid property map: pos expected" );
-                    if( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos )
-                        pPos = &rPos.maValue;
-
-                    const XMLPropertyState& rFilter = (*pProperties)[nIdx - 1];
-                    DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter,
-                                "invalid property map: filter expected" );
-                    if( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter )
-                        pFilter = &rFilter.maValue;
+                    pFilter = &rFilter.maValue;
+                    --nIndex;
+                }
+                const XMLPropertyState& rPos = (*pProperties)[nIndex];
+                if (getPropertySetMapper()->GetEntryContextId(rPos.mnIndex) == nPos)
+                {
+                    pPos = &rPos.maValue;
+                    --nIndex;
                 }
                 sal_uInt32 nPropIndex = rProperty.mnIndex;
                 pThis->aBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, NULL,
commit ca95df9d6005e1f8b14ffe1b58b18dfae5951983
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 20 11:22:32 2015 +0200

    xmloff: convert legacy assertions in XMLFootnoteSeparatorExport
    
    Change-Id: I4f9d429e055df0d7bc01e710334259d737d2d4f3

diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
index b551194..067cdb8 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
@@ -20,8 +20,6 @@
 
 #include "XMLFootnoteSeparatorExport.hxx"
 
-#include <tools/debug.hxx>
-
 #include <sax/tools/converter.hxx>
 
 #include <xmloff/xmlexp.hxx>
@@ -51,14 +49,10 @@ XMLFootnoteSeparatorExport::~XMLFootnoteSeparatorExport()
 
 void XMLFootnoteSeparatorExport::exportXML(
     const vector<XMLPropertyState> * pProperties,
-    sal_uInt32
-    #ifdef DBG_UTIL
-    nIdx
-    #endif
-    ,
+    sal_uInt32 const nIdx,
     const rtl::Reference<XMLPropertySetMapper> & rMapper)
 {
-    DBG_ASSERT(NULL != pProperties, "Need property states");
+    assert(pProperties);
 
     // intialize values
     sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT;
@@ -96,8 +90,8 @@ void XMLFootnoteSeparatorExport::exportXML(
             rState.maValue >>= nLineTextDistance;
             break;
         case CTF_PM_FTN_LINE_WEIGHT:
-            DBG_ASSERT( i == nIdx,
-                        "received wrong property state index" );
+            (void) nIdx;
+            assert(i == nIdx && "received wrong property state index");
             rState.maValue >>= nLineWeight;
             break;
         case CTF_PM_FTN_LINE_STYLE:


More information about the Libreoffice-commits mailing list