[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 14 commits - cui/source dbaccess/source include/svx include/vcl officecfg/registry oox/source package/source postprocess/CustomTarget_registry.mk sc/source sd/source sfx2/source svx/source sw/source vcl/source

Caolán McNamara caolanm at redhat.com
Thu May 22 07:15:04 PDT 2014


 cui/source/tabpages/paragrph.cxx                                  |    6 
 dbaccess/source/core/api/FilteredContainer.cxx                    |   18 -
 include/svx/relfld.hxx                                            |    3 
 include/vcl/builder.hxx                                           |    2 
 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |    2 
 oox/source/drawingml/textcharacterpropertiescontext.cxx           |    2 
 package/source/xstor/xstorage.cxx                                 |   14 -
 postprocess/CustomTarget_registry.mk                              |    3 
 sc/source/ui/app/inputhdl.cxx                                     |    5 
 sd/source/ui/func/fuparagr.cxx                                    |    4 
 sfx2/source/dialog/templdlg.cxx                                   |   13 -
 sfx2/source/doc/sfxbasemodel.cxx                                  |    5 
 sfx2/source/inc/templdgi.hxx                                      |    2 
 svx/source/dialog/relfld.cxx                                      |   13 -
 sw/source/filter/ww8/writerwordglue.cxx                           |  104 ++++++++--
 vcl/source/window/builder.cxx                                     |    6 
 16 files changed, 150 insertions(+), 52 deletions(-)

New commits:
commit 01bffda54c7206cb8502b4acde0de377fc53cc75
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 16 16:36:13 2014 +0100

    valgrind: SfxBaseModel's pImpl of fallback TargetDocument for paste leaks
    
    e.g. repeatedly pasting a metafile into writer and deleting it.
    
    ==13369== 342 (232 direct, 110 indirect) bytes in 1 blocks are definitely lost in loss record 19,396 of 22,170
    ==13369==    at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13369==    by 0x686D72E: SfxBaseModel::SfxBaseModel(SfxObjectShell*) (sfxbasemodel.cxx:518)
    ==13369==    by 0x288CA9C1: SvxUnoDrawingModel::SvxUnoDrawingModel(SdrModel*) (unomod.cxx:255)
    ==13369==    by 0x28961055: SvxDrawingLayerImport(SdrModel*, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, char const*) (xmlexport.cxx:164)
    ==13369==    by 0x28960FA2: SvxDrawingLayerImport(SdrModel*, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&) (xmlexport.cxx:148)
    ==13369==    by 0x2896175E: SvxDrawingLayerImport(SdrModel*, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&) (xmlexport.cxx:254)
    ==13369==    by 0x240B1002: SwFEShell::Paste(SvStream&, unsigned short, Point const*) (fecopy.cxx:1333)
    ==13369==    by 0x247B981A: SwTransferable::_PasteSdrFormat(TransferableDataHelper&, SwWrtShell&, unsigned short, Point const*, unsigned char, bool) (swdtflvr.cxx:2207)
    ==13369==    by 0x247B678E: SwTransferable::PasteData(TransferableDataHelper&, SwWrtShell&, unsigned short, unsigned long, unsigned short, bool, bool, Point const*, signed char, bool) (swdtflvr.cxx:1481)
    ==13369==    by 0x247B5AE4: SwTransferable::Paste(SwWrtShell&, TransferableDataHelper&) (swdtflvr.cxx:1150)
    ==13369==    by 0x2488FCCE: SwBaseShell::ExecClpbrd(SfxRequest&) (basesh.cxx:277)
    
         Reference< lang::XComponent > xTargetDocument( xComponent );
         if( !xTargetDocument.is() )
         {
    >        xTargetDocument = new SvxUnoDrawingModel( pModel );
             pModel->setUnoModel( Reference< XInterface >::query( xTargetDocument ) );
         }
    
    (cherry picked from commit fdca15fb864aca975533257d5ee83440992d8a7e)
    
    Conflicts:
    	sfx2/source/doc/sfxbasemodel.cxx
    
    Change-Id: I3bd0fc983d9b6bdcdc91071a4ec3d2c584397ebf
    Reviewed-on: https://gerrit.libreoffice.org/9384
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1de92d6..67096db 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -537,6 +537,11 @@ SfxBaseModel::SfxBaseModel( SfxObjectShell *pObjectShell )
 SfxBaseModel::~SfxBaseModel()
 {
     DBG_DTOR(sfx2_SfxBaseModel,NULL);
+    //In SvxDrawingLayerImport when !xTargetDocument the fallback SvxUnoDrawingModel created there
+    //never gets disposed called on it, so m_pData leaks.
+    IMPL_SfxBaseModel_DataContainer* pData = m_pData;
+    m_pData = 0;
+    delete pData;
 }
 
 //________________________________________________________________________________________________________
commit a987c3ad1844d2f6babde18b73baf9cc6f2f75db
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 20 16:20:42 2014 +0200

    SvxRelativeField: set the unit from the passed stringmap
    
    In the Paragraph "Indents & Spacing" tab there are fields with unit:
    <object class="svxlo-SvxRelativeField" id="spinED_LEFTINDENT:0cm">
    
    But the unit is effectively ignored, and the resulting SvxRelativeField
    with FUNIT_NONE and 9999 max somehow results in 0.18cm max when the
    dialog sets cm as unit.
    
    (cherry picked from commit 68bc8af6b6c4d0399bd10ed450d81aa2f17931a1)
    
    Conflicts:
    	svx/source/dialog/relfld.cxx
    
    Change-Id: I6001c93079fd7d899f1e119913b29ea4898b1c34
    Reviewed-on: https://gerrit.libreoffice.org/9416
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/relfld.hxx b/include/svx/relfld.hxx
index 80fa2c4..c9fbe41 100644
--- a/include/svx/relfld.hxx
+++ b/include/svx/relfld.hxx
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_SVX_RELFLD_HXX
 #define INCLUDED_SVX_RELFLD_HXX
 
+#include <tools/fldunit.hxx>
 #include <vcl/field.hxx>
 #include <svx/svxdllapi.h>
 
@@ -39,7 +40,7 @@ protected:
     void            Modify();
 
 public:
-    SvxRelativeField( Window* pParent, WinBits nBits);
+    SvxRelativeField(Window* pParent, WinBits nBits, FieldUnit eUnit);
 
     void            EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
                                         sal_uInt16 nStep = 5 );
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 8cd25a0..e975534 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -13,6 +13,7 @@
 #include <typeinfo>
 #include <osl/module.hxx>
 #include <tools/resmgr.hxx>
+#include <tools/fldunit.hxx>
 #include <vcl/dllapi.h>
 #include <vcl/window.hxx>
 #include <xmlreader/xmlreader.hxx>
@@ -293,6 +294,7 @@ public:
     static OString convertMnemonicMarkup(const OString &rIn);
 
     static OString extractCustomProperty(stringmap &rMap);
+    static FieldUnit detectUnit(OString const&);
 
     static bool extractDropdown(stringmap &rMap);
 
diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx
index 67a4a59..52479b5 100644
--- a/svx/source/dialog/relfld.cxx
+++ b/svx/source/dialog/relfld.cxx
@@ -22,21 +22,28 @@
 
 // -----------------------------------------------------------------------
 
-SvxRelativeField::SvxRelativeField( Window* pParent, WinBits nBits) :
+SvxRelativeField::SvxRelativeField(Window* pParent, WinBits nBits, FieldUnit const eUnit)
+    :
     MetricField( pParent, nBits)
 {
     bNegativeEnabled = sal_False;
     bRelativeMode = sal_False;
     bRelative     = sal_False;
 
+    SetUnit(eUnit);
     SetDecimalDigits( 2 );
     SetMin( 0 );
     SetMax( 9999 );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxRelativeField(Window *pParent, VclBuilder::stringmap &)
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL
+makeSvxRelativeField(Window *const pParent, VclBuilder::stringmap & rMap)
 {
-    return new SvxRelativeField(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP);
+    OString const custom(VclBuilder::extractCustomProperty(rMap));
+    FieldUnit const eUnit(VclBuilder::detectUnit(custom));
+    SvxRelativeField *const pRet = new SvxRelativeField(pParent,
+            WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP, eUnit);
+    return pRet;
 }
 // -----------------------------------------------------------------------
 
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 577eb86..d97d1d6 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -884,6 +884,12 @@ namespace
     }
 }
 
+FieldUnit VclBuilder::detectUnit(OString const& rString)
+{
+    OString const unit(extractUnit(rString));
+    return detectMetricUnit(unit);
+}
+
 void VclBuilder::ensureDefaultWidthChars(VclBuilder::stringmap &rMap)
 {
     OString sWidthChars("width-chars");
commit 1688168de06c1efd09ddc62b01745403aa093289
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon May 19 08:53:16 2014 +0300

    fdo#78815 Fix report builder toolbox controller
    
    Change-Id: Iecbf84b29500729e228d22c8e50b119d1fb471c5
    (cherry picked from commit 214de0e5124b44df0f37fdf89271a527667590dc)
    Reviewed-on: https://gerrit.libreoffice.org/9422
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index 6d755759..2299f49 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -396,7 +396,8 @@ postprocess_FILES_reportbuilder := \
 	$(postprocess_MOD)/org/openoffice/Setup-reportbuilder.xcu \
 	$(postprocess_MOD)/org/openoffice/Office/Accelerators-reportbuilder.xcu \
 	$(postprocess_MOD)/org/openoffice/Office/DataAccess-reportbuilder.xcu \
-	$(postprocess_MOD)/org/openoffice/Office/Embedding-reportbuilder.xcu
+	$(postprocess_MOD)/org/openoffice/Office/Embedding-reportbuilder.xcu \
+	$(postprocess_MOD)/org/openoffice/Office/UI/Controller-reportbuilder.xcu
 endif
 
 postprocess_DEPS_writer := main
commit e40f80116ab1a0b9f752abfa113f9340ec53df9f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 20 11:18:55 2014 +0200

    (related: fdo#62176) Revert "reset min/max values in paragraph ...
    
    ... dialog before setting the actual value"
    
    This prevents handling negative first-line indent in Impress, for which
    it is necessary that the values are set before the limits.
    
    This reverts commit 3d7ff1e907713d8ed53a1e193641a2f16de3c38b.
    
    Change-Id: I47807d7d49716acab3657de1da64c6e9a99fc44d
    (cherry picked from commit 35199df7b7af9d9dd3e98eb5f1b24ac1d407345c)
    Reviewed-on: https://gerrit.libreoffice.org/9415
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 5854608..f8e7db1 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -429,8 +429,6 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
         SetFieldUnit( *m_pLineDistAtMetricBox, eFUnit );
     }
 
-    ELRLoseFocusHdl( NULL ); // reset min/max values
-
     sal_uInt16 _nWhich = GetWhich( SID_ATTR_LRSPACE );
     SfxItemState eItemState = rSet.GetItemState( _nWhich );
 
@@ -588,6 +586,10 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
         }
     }
 
+    // this sets the min/max limits; do this _after_ setting the values,
+    // because for Impress the min of first-line indent depends on value of
+    // left-indent!
+    ELRLoseFocusHdl( NULL );
     m_pAutoCB->SaveValue();
     m_pContextualCB->SaveValue();
     m_pLineDist->SaveValue();
commit 9372d5e622efd3b42390f3f5e61af821104f67ed
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 20 09:35:13 2014 +0100

    Related: fdo#78151 fix 'pIds unsorted' warning
    
    Change-Id: I00c533a25a851d8bf57f1b0758e98915d2291ee9
    (cherry picked from commit 52871279e9811d437ebe881e30b6c76208c84e65)
    Reviewed-on: https://gerrit.libreoffice.org/9413
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx
index e3ee565..eacfa4e 100644
--- a/sd/source/ui/func/fuparagr.cxx
+++ b/sd/source/ui/func/fuparagr.cxx
@@ -137,15 +137,15 @@ void FuParagraph::DoExecute( SfxRequest& rReq )
     // invalidate slots
     static sal_uInt16 SidArray[] = {
         SID_ATTR_TABSTOP,
-    SID_ATTR_PARA_LINESPACE,
-    SID_ATTR_PARA_ULSPACE,
         SID_ATTR_PARA_ADJUST_LEFT,
         SID_ATTR_PARA_ADJUST_RIGHT,
         SID_ATTR_PARA_ADJUST_CENTER,
         SID_ATTR_PARA_ADJUST_BLOCK,
+        SID_ATTR_PARA_LINESPACE,
         SID_ATTR_PARA_LINESPACE_10,
         SID_ATTR_PARA_LINESPACE_15,
         SID_ATTR_PARA_LINESPACE_20,
+        SID_ATTR_PARA_ULSPACE,
         SID_ATTR_PARA_LRSPACE,
         SID_ATTR_PARA_LEFT_TO_RIGHT,
         SID_ATTR_PARA_RIGHT_TO_LEFT,
commit 032d08fe14070fc23bef94e237cf4cee04945b3b
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Fri Mar 14 15:31:53 2014 +0530

    n#862510: Ignore baseline attributes with zero.
    
    Change-Id: I1adc46e62c82c23645ccad0e11d5a7cb07114539
    (cherry picked from commit 19abfaffe74b925e4428943d14187a7008797982)
    Signed-off-by: Andras Timar <andras.timar at collabora.com>

diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 6887cda..8217cac 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -52,7 +52,7 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
         mrTextCharacterProperties.moUnderline = rAttribs.getToken( XML_u );
     if ( rAttribs.hasAttribute( XML_strike ) )
         mrTextCharacterProperties.moStrikeout = rAttribs.getToken( XML_strike );
-    if ( rAttribs.hasAttribute( XML_baseline ) )
+    if ( rAttribs.hasAttribute( XML_baseline ) && rAttribs.getInteger( XML_baseline ).get() != 0 )
         mrTextCharacterProperties.moBaseline = rAttribs.getInteger( XML_baseline );
 
     if ( rAttribs.hasAttribute( XML_b ) )
commit 350be5c39b76328ba81f90ede49f23666f8edf93
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 20 17:01:38 2014 +0200

    fdo#78971 There's even a git hook to prevent commits containing SAL_DEBUG
    
    Change-Id: I5a46e1eed129edf3648c68c36951d6fdf9bd370d
    (cherry picked from commit dc24203e5f20dcbf2818651a8802e67338293b3c)

diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx
index 7e5de81..edcf256 100644
--- a/dbaccess/source/core/api/FilteredContainer.cxx
+++ b/dbaccess/source/core/api/FilteredContainer.cxx
@@ -303,15 +303,9 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto
 
         try
         {
-            SAL_DEBUG("OFilteredContainer::construct(). "
-                      "Getting metadata ...");
-
             Reference< XConnection > xCon( m_xConnection, UNO_SET_THROW );
             m_xMetaData.set( xCon->getMetaData(), UNO_SET_THROW );
 
-            SAL_DEBUG("OFilteredContainer::construct(). "
-                      "Metadata got.");
-
             // create a table table filter suitable for the XDatabaseMetaData::getTables call,
             // taking into account both the externally-provided table type filter, and any
             // table type restriction which is inherent to the container
@@ -319,9 +313,6 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto
             OUString sInherentTableTypeRestriction( getTableTypeRestriction() );
             if ( !sInherentTableTypeRestriction.isEmpty() )
             {
-                SAL_DEBUG("OFilteredContainer::construct(). "
-                          "NOT InherentTableTypeRestriction.");
-
                 if ( _rTableTypeFilter.getLength() != 0 )
                 {
                     const OUString* tableType    = _rTableTypeFilter.getConstArray();
@@ -343,9 +334,6 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto
             }
             else
             {
-                SAL_DEBUG("OFilteredContainer::construct(). "
-                          "InherentTableTypeRestriction.");
-
                 // no container-inherent restriction for the table types
                 if ( _rTableTypeFilter.getLength() == 0 )
                 {   // no externally-provided table type filter => use the default filter
@@ -357,16 +345,10 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto
                 }
             }
 
-            SAL_DEBUG("OFilteredContainer::construct(). "
-                      "Getting tables ...");
-
             static const OUString sAll("%");
             Reference< XResultSet > xTables = m_xMetaData->getTables( Any(), sAll, sAll, aTableTypeFilter );
             Reference< XRow > xCurrentRow( xTables, UNO_QUERY_THROW );
 
-            SAL_DEBUG("OFilteredContainer::construct(). "
-                      "Tables got.");
-
             TableInfos aUnfilteredTables;
 
             OUString sCatalog, sSchema, sName, sType;
commit 4bf8396ecfc246e03eb92cc725ab0b745cbd47c5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 19 23:26:22 2014 +0200

    -Werror,-Wunused-result
    
    Change-Id: Iaa06237d3e554d3a3d9c87f6c5dba715343afa25
    (cherry picked from commit 9cf5e4c2500fc5d579896ea08802aba5ca671c96)

diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 056268e..bafa0f0 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -812,7 +812,7 @@ namespace sw
                     {
                         const sal_Int32 nFindLen = rFind.getLength();
                         const sal_Int32 nDiff = rReplace.getLength() - nFindLen;
-                        rParams.replaceAt( nI, nFindLen, rReplace);
+                        rParams = rParams.replaceAt( nI, nFindLen, rReplace);
                         nI += nFindLen + nDiff - 1;
                         nLen += nDiff;
                         bReplaced = true;
commit b49c224ae65f7cf67e32743bd3bfb9c4c78e80dd
Author: Eike Rathke <erack at redhat.com>
Date:   Mon May 19 21:43:06 2014 +0200

    resolved fdo#66620 keywords occur in unquoted context only
    
    Change-Id: I4de41e5b66f1a856a786c521ca4ef2eec14c7499
    (cherry picked from commit 0d361388060741fe8e2f1ba059fba95707bdc233)
    Reviewed-on: https://gerrit.libreoffice.org/9405
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 7fc6061..056268e 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -745,6 +745,83 @@ namespace sw
             return nDT;
         }
 
+
+        /** Find cFind in rParams if not embedded in " double quotes.
+            Will NOT find '\\' or '"'.
+         */
+        sal_Int32 findUnquoted( const OUString& rParams, sal_Unicode cFind, sal_Int32 nFromPos )
+        {
+            const sal_Int32 nLen = rParams.getLength();
+            if (nFromPos < 0 || nLen <= nFromPos)
+                return -1;
+            for (sal_Int32 nI = nFromPos; nI < nLen; ++nI)
+            {
+                const sal_Unicode c = rParams[nI];
+                if (c == '\\')
+                    ++nI;
+                else if (c == '\"')
+                {
+                    ++nI;
+                    // While not at the end and not at an unescaped end quote
+                    while (nI < nLen)
+                    {
+                        if (rParams[nI] == '\"' && rParams[nI-1] != '\\')
+                            break;
+                        ++nI;
+                    }
+                }
+                else //normal unquoted section
+                {
+                    if (c == cFind)
+                        return nI;
+                }
+            }
+            return -1;
+        }
+
+        /** Find all rFind in rParams if not embedded in " double quotes and
+            replace with rReplace. Will NOT find '\\' or '"'.
+         */
+        bool replaceUnquoted( OUString& rParams, const OUString& rFind, const OUString& rReplace )
+        {
+            bool bReplaced = false;
+            if (rFind.isEmpty())
+                return bReplaced;
+            const sal_Unicode cFirst = rFind[0];
+
+            sal_Int32 nLen = rParams.getLength();
+            for (sal_Int32 nI = 0; nI < nLen; ++nI)
+            {
+                const sal_Unicode c = rParams[nI];
+                if (rParams[nI] == '\\')
+                    ++nI;
+                else if (rParams[nI] == '\"')
+                {
+                    ++nI;
+                    // While not at the end and not at an unescaped end quote
+                    while (nI < nLen)
+                    {
+                        if (rParams[nI] == '\"' && rParams[nI-1] != '\\')
+                            break;
+                        ++nI;
+                    }
+                }
+                else //normal unquoted section
+                {
+                    if (c == cFirst && rParams.match( rFind, nI))
+                    {
+                        const sal_Int32 nFindLen = rFind.getLength();
+                        const sal_Int32 nDiff = rReplace.getLength() - nFindLen;
+                        rParams.replaceAt( nI, nFindLen, rReplace);
+                        nI += nFindLen + nDiff - 1;
+                        nLen += nDiff;
+                        bReplaced = true;
+                    }
+                }
+            }
+            return bReplaced;
+        }
+
         sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams,
             SvNumberFormatter *pFormatter, sal_uInt16 &rLang, bool bHijri,
             sal_uInt16 nDocLang)
@@ -756,36 +833,39 @@ namespace sw
 
             SwapQuotesInField(rParams);
 
-            // Force to Japanese when finding one of 'geaE'
-            bool bForceJapanese = (-1 != rParams.indexOf('g')
-                || -1 != rParams.indexOf('e') || -1 != rParams.indexOf('E') );
-            if ( bForceJapanese )
-            {
-                rParams = rParams.replaceAll( "ee", "yyyy" ).replaceAll( "EE", "YYYY" );
-            }
+            // Force to Japanese when finding one of 'geE'.
+            // XXX This actually may not be correct, all era keywords could be
+            // used in other locales as well. I just don't know about Word. But
+            // this is how it was for 10 years..
+            bool bForceJapanese = (-1 != findUnquoted( rParams, 'g', 0));
+            // XXX Why replace? The number formatter does handle them and this
+            // effectively changes from Gengou to Gregorian calendar. Legacy
+            // because it wasn't supported a decade ago and now moot? Or is
+            // that a Word specialty?
+            bForceJapanese |= replaceUnquoted( rParams, "ee", "yyyy");
+            bForceJapanese |= replaceUnquoted( rParams, "EE", "YYYY");
             if (LANGUAGE_FRENCH != nDocLang)
             {
                 // Handle the 'a' case here
                 sal_Int32 nLastPos = 0;
                 do
                 {
-                    sal_Int32 nPos = rParams.indexOf( 'a', nLastPos + 1 );
+                    sal_Int32 nPos = findUnquoted( rParams, 'a', nLastPos + 1 );
                     bForceJapanese |= ( nPos != -1 && IsNotAM( rParams, nPos ) );
                     nLastPos = nPos;
                 } while ( -1 != nLastPos );
             }
 
             // Force to NatNum when finding one of 'oOA'
-            OUString sOldParams( rParams );
-            rParams = rParams.replaceAll( "o", "m" ).replaceAll( "O", "M" );
-            bool bForceNatNum = !sOldParams.equals( rParams );
+            bool bForceNatNum  = replaceUnquoted( rParams, "o", "m");
+                 bForceNatNum |= replaceUnquoted( rParams, "O", "M");
             if (LANGUAGE_FRENCH != nDocLang)
             {
                 // Handle the 'A' case here
                 sal_Int32 nLastPos = 0;
                 do
                 {
-                    sal_Int32 nPos = rParams.indexOf( 'A', nLastPos + 1 );
+                    sal_Int32 nPos = findUnquoted( rParams, 'A', nLastPos + 1 );
                     bool bIsCharA = ( nPos != -1 && IsNotAM( rParams, nPos ) );
                     bForceNatNum |= bIsCharA;
                     if ( bIsCharA )
commit 2b8888ca2afbdcdb91036f35a498de43b4012f34
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon May 19 22:03:18 2014 +0200

    fdo#78536: sfx2: template dialog: make the am-i-dead-yet check reentrant
    
    In the fine tradition of our enterprise-grade code base, this lets the
    check in SfxCommonTemplateDialog_Impl::Execute_Impl() do an early
    return if the "this" instance has signalled its untimely demise even if
    there are multiple calls of Execute_Impl() on the stack; extending
    the scheme with further epicycles to make it work if the Execute_Impl()
    calls happen on 2 different threads is left as an exercise for the
    interested reader.
    
    (regression from bcc52fb2ebdf77a1cc089857775fd742085b45b6)
    
    (cherry picked from commit 838c580fdba8b1c72bc854d101d302be0e3861d5)
    
    Conflicts:
    	sfx2/source/dialog/templdlg.cxx
    
    Change-Id: I1d9f0d82bf6d9f5da8f9bd2be57d01937d71fd26
    Reviewed-on: https://gerrit.libreoffice.org/9406
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index cbd856f..11b430c 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -100,20 +100,22 @@ class SfxCommonTemplateDialog_Impl::DeletionWatcher : private boost::noncopyable
 public:
     explicit DeletionWatcher(SfxCommonTemplateDialog_Impl& rDialog)
         : m_pDialog(&rDialog)
+        , m_pPrevious(m_pDialog->impl_setDeletionWatcher(this))
     {
-        m_pDialog->impl_setDeletionWatcher(this);
     }
 
     ~DeletionWatcher()
     {
         if (m_pDialog)
-            m_pDialog->impl_setDeletionWatcher(0);
+            m_pDialog->impl_setDeletionWatcher(m_pPrevious);
     }
 
     // Signal that the dialog was deleted
     void signal()
     {
         m_pDialog = 0;
+        if (m_pPrevious)
+            m_pPrevious->signal();
     }
 
     // Return true if the dialog was deleted
@@ -124,6 +126,7 @@ public:
 
 private:
     SfxCommonTemplateDialog_Impl* m_pDialog;
+    DeletionWatcher *const m_pPrevious; /// let's add more epicycles!
 };
 
 // Re-direct functions
@@ -1015,9 +1018,13 @@ void SfxCommonTemplateDialog_Impl::impl_clear()
     DELETEZ( m_pStyleFamiliesId );
 }
 
-void SfxCommonTemplateDialog_Impl::impl_setDeletionWatcher(DeletionWatcher* pNewWatcher)
+SfxCommonTemplateDialog_Impl::DeletionWatcher *
+SfxCommonTemplateDialog_Impl::impl_setDeletionWatcher(
+        DeletionWatcher *const pNewWatcher)
 {
+    DeletionWatcher *const pRet(m_pDeletionWatcher);
     m_pDeletionWatcher = pNewWatcher;
+    return pRet;
 }
 
 //-------------------------------------------------------------------------
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 0011aed..844acdb 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -111,7 +111,7 @@ private:
     void    ReadResource();
     void    ClearResource();
     void impl_clear();
-    void impl_setDeletionWatcher(DeletionWatcher* pNewWatcher);
+    DeletionWatcher * impl_setDeletionWatcher(DeletionWatcher* pNewWatcher);
 
 protected:
 #define MAX_FAMILIES            5
commit cbfa5c117ff652161efe115f723bfe42e5644973
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 20 11:12:40 2014 +0200

    fdo#78949 Handle (SAXParse-)Exception that can't pass getAllRelationships
    
    ...like it was already done in the similar else branch of
    ReadRelInfoIfNecessary.  The call site at GetAllRelationshipsIfAny will
    translate an m_nRelInfoStatus that remained RELINFO_NOT_INIT into an
    IOException.
    
    Change-Id: I79c601acd23b3b0020c7b4de4c20b0282524bce1
    (cherry picked from commit 423921b085de43f53e42f957889dd96378d2c3c4)
    Reviewed-on: https://gerrit.libreoffice.org/9411
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 9e2ffb7..8775561 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -572,13 +572,19 @@ void OStorage_Impl::ReadRelInfoIfNecessary()
     {
         // Init from original stream
         uno::Reference< io::XInputStream > xRelInfoStream = GetRelInfoStreamForName( OUString() );
-        if ( xRelInfoStream.is() )
-            m_aRelInfo = ::comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(
+        try
+        {
+            if ( xRelInfoStream.is() )
+                m_aRelInfo = ::comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(
                                     xRelInfoStream,
                                     "_rels/.rels",
                                     m_xContext );
-
-        m_nRelInfoStatus = RELINFO_READ;
+            m_nRelInfoStatus = RELINFO_READ;
+        }
+        catch (css::uno::Exception & e)
+        {
+            SAL_INFO("package.xstor", "caught Exception " << e.Message);
+        }
     }
     else if ( m_nRelInfoStatus == RELINFO_CHANGED_STREAM )
     {
commit d395065aaa39f7d8f767da864c97034a4c542fb5
Author: Eike Rathke <erack at redhat.com>
Date:   Tue May 20 11:38:46 2014 +0200

    simplify and ensure valid miAutoPosColumn in all cases, fdo#78838 related
    
    Unconditionally set miAutoPosColumn at the end of all operations so it
    is also valid in case of pColumnData->clear() and no entries inserted
    after pDoc->GetDataEntries().
    
    Change-Id: I689632f696091fd9ce8e93c06d7918e5eaf05ab4
    (cherry picked from commit 23e9f36a21f7daa6175f53fd244677b9c2e2a660)
    Reviewed-on: https://gerrit.libreoffice.org/9412
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index cec85a2..261df33 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1527,19 +1527,15 @@ void ScInputHandler::GetColData()
         if ( pColumnData )
             pColumnData->clear();
         else
-        {
             pColumnData = new ScTypedCaseStrSet;
-            miAutoPosColumn = pColumnData->end();
-        }
 
         std::vector<ScTypedStrData> aEntries;
         pDoc->GetDataEntries(
             aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, aEntries, true);
         if (!aEntries.empty())
-        {
             pColumnData->insert(aEntries.begin(), aEntries.end());
-            miAutoPosColumn = pColumnData->end();
-        }
+
+        miAutoPosColumn = pColumnData->end();
     }
 }
 
commit 260409bc2f326031fdab2e5b9455895a53689264
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue May 20 07:33:00 2014 +0200

    Resolves: fdo#78838 past-the-end iterator
    
    Inserting data in pColumnData invalidated miAutoPosColumn
    See https://bugs.freedesktop.org/show_bug.cgi?id=78838#c6
    
    Cherry-picked from 1df54514d7a1ebb1b4fa16cca386a34e7c41c490
    
    Change-Id: Iece423cd8d14f5ae7bf382583c0369895a00f168
    Reviewed-on: https://gerrit.libreoffice.org/9409
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index ce79db0..cec85a2 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1536,7 +1536,10 @@ void ScInputHandler::GetColData()
         pDoc->GetDataEntries(
             aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, aEntries, true);
         if (!aEntries.empty())
+        {
             pColumnData->insert(aEntries.begin(), aEntries.end());
+            miAutoPosColumn = pColumnData->end();
+        }
     }
 }
 
commit 2592e9b06e30ed66b3793d7f8cf4db37d96581af
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sun May 18 14:16:28 2014 -0400

    fdo#78824: Avoid having two menu entries having the same accelarator.
    
    Sort should have an 'S' as accelerator.  The other one can be auto-assigned.
    
    Change-Id: I61e630c9b6d89658c65cca77333f1ad0a591e3ab
    (cherry picked from commit 1d7c97a607615c3f176c9f553d1d011e4ee55c1d)
    Reviewed-on: https://gerrit.libreoffice.org/9399
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 1b3b5a6..74dca7e 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -648,7 +648,7 @@
       </node>
       <node oor:name=".uno:StatisticsMenu" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">~Statistics</value>
+          <value xml:lang="en-US">Statistics</value>
         </prop>
       </node>
       <node oor:name=".uno:SamplingDialog" oor:op="replace">


More information about the Libreoffice-commits mailing list