[Libreoffice-commits] .: 14 commits - starmath/source sw/source

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jun 17 04:49:17 PDT 2011


 starmath/source/toolbox.cxx     |   12 ++++++------
 sw/source/core/edit/edfld.cxx   |    2 +-
 sw/source/ui/config/usrpref.cxx |   10 ----------
 3 files changed, 7 insertions(+), 17 deletions(-)

New commits:
commit ecb54f9f1aca6b0b0a3e6e23797bc2296679aef3
Merge: c2025a7... 5a6cd60...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 17 13:02:24 2011 +0200

    Merge remote-tracking branch 'origin/libreoffice-3-4'

commit 5a6cd607ac9ad0326fc490351fce8dd2156e0014
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jun 14 16:53:29 2011 +0200

    Version 3.4.1.1, tag libreoffice-3.4.1.1 (3.4.1-rc1)
commit 4a2d8af43d7408aa037f1afc9ec819a363c02278
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 9 15:25:49 2011 +0100

    fdo#37974 make recursive call of MarkManager::deleteMark do the right thing
    
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index e688cbc..f79374c 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -720,6 +720,19 @@ namespace sw { namespace mark
         //position as const iterator ppMark was
         iterator_t aI = m_vMarks.begin();
         std::advance(aI, std::distance<const_iterator_t>(aI, ppMark));
+
+        //fdo#37974
+        //a) a mark destructor may callback into this method.
+        //b) vector::erase first calls the destructor of the object, then
+        //removes it from the vector.
+        //So if the only reference to the object is the one
+        //in the vector then we may reenter this method when the mark
+        //is destructed but before it is removed, i.e. findMark still
+        //finds the object whose destructor is being run. Take a temp
+        //extra reference on the shared_ptr, remove the entry from the
+        //vector, and on xHoldPastErase release findMark won't find
+        //it anymore.
+        pMark_t xHoldPastErase = *aI;
         m_vMarks.erase(aI);
     }
 
commit 0e3b3cc3c3b94ef2f470be68d83129e9ed5f6fca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 8 10:23:22 2011 +0100

    Effective STL Item 27
    
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5a3cf3e..e688cbc 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -716,7 +716,11 @@ namespace sw { namespace mark
         DdeBookmark* const pDdeBookmark = dynamic_cast<DdeBookmark*>(ppMark->get());
         if(pDdeBookmark)
             pDdeBookmark->DeregisterFromDoc(m_pDoc);
-        m_vMarks.erase(m_vMarks.begin() + (ppMark - m_vMarks.begin())); // clumsy const-cast
+        //Effective STL Item 27, get a non-const iterator aI at the same
+        //position as const iterator ppMark was
+        iterator_t aI = m_vMarks.begin();
+        std::advance(aI, std::distance<const_iterator_t>(aI, ppMark));
+        m_vMarks.erase(aI);
     }
 
     void MarkManager::deleteMark(const IMark* const pMark)
commit b78c67c56500955a65c5f982a77d14fb451f9cf0
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Thu Jun 9 12:39:38 2011 +0300

    Typo
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 880651e..7518da3 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -381,7 +381,7 @@ bool SwTaggedPDFHelper::CheckReopenTag()
             {
                 FrmTagIdMap& rFrmTagIdMap = SwEnhancedPDFExportHelper::GetFrmTagIdMap();
                 const FrmTagIdMap::const_iterator aIter =  rFrmTagIdMap.find( pKey );
-                if ( aIterm != rFrmTagIdMap.end() )
+                if ( aIter != rFrmTagIdMap.end() )
                     nReopenTag = (*aIter).second;
             }
         }
commit 47a0a2e765aa7f364e4dd373b2779cc4f20a17c6
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Thu Jun 9 12:00:57 2011 +0300

    Add iterator sanity check, seems to fix fdo#36820
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 8090509..880651e 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -381,7 +381,8 @@ bool SwTaggedPDFHelper::CheckReopenTag()
             {
                 FrmTagIdMap& rFrmTagIdMap = SwEnhancedPDFExportHelper::GetFrmTagIdMap();
                 const FrmTagIdMap::const_iterator aIter =  rFrmTagIdMap.find( pKey );
-                nReopenTag = (*aIter).second;
+                if ( aIterm != rFrmTagIdMap.end() )
+                    nReopenTag = (*aIter).second;
             }
         }
     }
commit 0d3f3c3c45cadf06b7de2cc1592a59e6a44ebd60
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed Jun 8 17:26:35 2011 +0200

    fdo#37799: fixed broken loop causing a crash

diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index ebb1906..c07c4ef 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -204,7 +204,7 @@ void SwEditShell::FieldToText( SwFieldType* pType )
 
     SwFieldHint aHint( pPaM );
     SwClientIter aIter( *pType );
-    for ( SwClient* pClient = aIter.GoStart(); pClient; aIter++ )
+    for ( SwClient* pClient = aIter.GoStart(); pClient; pClient = aIter++ )
     {
         pPaM->DeleteMark();
         pClient->SwClientNotifyCall( *pType, aHint );
commit fd702d8c2809fc0d640a46db6cfca79cadc29da0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 8 14:32:06 2011 +0100

    fix loss of init on merge
    (cherry picked from commit 0e530a0cf6e4a06b9c59033f23bb09470db256c1)

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index fc63edc..dbb8d2c 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1919,7 +1919,7 @@ String WW8ReadPString(SvStream& rStrm, rtl_TextEncoding eEnc,
 
 String WW8Read_xstz(SvStream& rStrm, sal_uInt16 nChars, bool bAtEndSeekRel1)
 {
-    sal_uInt16 b;
+    sal_uInt16 b(0);
 
     if( nChars )
         b = nChars;
commit 73a9de430716486d4bd7d535df257fb50889a12b
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed Jun 8 10:06:23 2011 +0200

    fdo#37584: Make a real copy of the text where to count words
    
    Const-casting a reference doesn't create a copy of it and then the
    spaces replacement made by the WordCount was also made on the actual
    text node. Use String::Copy() to actually copy the text and safely
    operate on it.
    (cherry picked from commit 135cf4fdbec71e8d93edc0339e8617d50766f151)
    
    Signed-off-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index d4c02b6..08d0c6b 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1814,7 +1814,7 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
     }
 
     // make a copy of the text
-    String& rTextCopy = const_cast<String&>(m_Text);
+    String rTextCopy = m_Text.Copy( );
 
     // mask out the redlined and hidden text with ' '
     const xub_Unicode cChar(' ');
commit 43e429a19f39274eb93122507463d719980c96a8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 8 13:16:49 2011 +0100

    restore CVE fix. unit tests rule
    (cherry picked from commit 7a8fe22857c48a424dd0d947de507de081e39dc7)

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index d4f7cb2..9e8324b 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3367,7 +3367,7 @@ sal_uInt16 WW8TabDesc::GetLogicalWWCol() const // returns number of col as INDIC
     sal_uInt16 nCol = 0;
     if( pActBand && pActBand->pTCs)
     {
-        for( sal_uInt16 iCol = 1; iCol <= nAktCol; ++iCol )
+        for( sal_uInt16 iCol = 1; iCol <= nAktCol && iCol <= pActBand->nWwCols; ++iCol )
         {
             if( !pActBand->pTCs[ iCol-1 ].bMerged )
                 ++nCol;
commit 6cd59648812a164a10febe459b71bdeb35d8f3f2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 8 11:05:37 2011 +0100

    Resolves: rhbz#699909 crash in export of .doc in lcl_getFieldId
    (cherry picked from commit 65e841076a947bcf115526e609de78e6952332e7)

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 863b2ea..ca502d4 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -121,7 +121,9 @@ using namespace nsFieldFlags;
 static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
     OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
 
-    if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
+    if ( !pFieldmark) {
+        return String();
+    } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
         return String::CreateFromAscii(" FORMTEXT ");
     } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
         return String::CreateFromAscii(" FORMDROPDOWN ");
@@ -140,7 +142,9 @@ static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
 
 ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
     OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
-    if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
+    if ( !pFieldmark ) {
+        return ww::eUNKNOWN;
+    } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
         return ww::eFORMTEXT;
     } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
         return ww::eFORMDROPDOWN;
@@ -1844,11 +1848,11 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                 ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
                 OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
 
-                if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
+                if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
                     AppendBookmark( pFieldmark->GetName(), false );
                 ww::eField eFieldId = lcl_getFieldId( pFieldmark );
                 String sCode = lcl_getFieldCode( pFieldmark );
-                if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
+                if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
                 {
                     IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
                             rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
@@ -1869,13 +1873,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                     }
                 }
                 OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START );
-                if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
+                if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
                     WriteFormData( *pFieldmark );
-                else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) )
+                else if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) )
                     WriteHyperlinkData( *pFieldmark );
                 OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END );
 
-                if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
+                if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
                 {
                     // Check for the presence of a linked OLE object
                     IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
@@ -1897,7 +1901,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                 OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" );
 
                 ww::eField eFieldId = lcl_getFieldId( pFieldmark );
-                if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
+                if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
                 {
                     IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
                             rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
@@ -1910,7 +1914,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                 }
 
                 OutputField( NULL, eFieldId, String(), WRITEFIELD_CLOSE );
-                if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
+                if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
                     AppendBookmark( pFieldmark->GetName(), false );
             }
             else if ( ch == CH_TXT_ATR_FORMELEMENT )
@@ -1919,8 +1923,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                 ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
                 OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
 
-                bool isDropdownOrCheckbox = pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
-                    pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) );
+                bool isDropdownOrCheckbox = pFieldmark && (pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
+                    pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ));
 
                 if ( isDropdownOrCheckbox )
                     AppendBookmark( pFieldmark->GetName(), 0 );
commit f1575d39d539f261d40d81aca48820f8fb495ff8
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Mon May 23 12:51:49 2011 +0200

    fdo#32684: Really don't handle the CJK unit by default
    
    Signed-off-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx
index 7c1eec9..20627df 100644
--- a/sw/source/ui/config/usrpref.cxx
+++ b/sw/source/ui/config/usrpref.cxx
@@ -32,7 +32,6 @@
 
 #include <tools/stream.hxx>
 #include <unotools/syslocale.hxx>
-#include <svl/cjkoptions.hxx>
 
 #include "swtypes.hxx"
 #include "hintids.hxx"
@@ -74,17 +73,8 @@ SwMasterUsrPref::SwMasterUsrPref(sal_Bool bWeb) :
     bApplyCharUnit(sal_False)
 {
     MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
-    SvtCJKOptions aCJKOptions;
     eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH;
 
-    sal_Bool bCJKEnabled = aCJKOptions.IsAsianTypographyEnabled();
-    bApplyCharUnit = bCJKEnabled;
-    eHScrollMetric = bApplyCharUnit ? FUNIT_CHAR : eUserMetric;
-    eVScrollMetric = bApplyCharUnit ? FUNIT_LINE : eUserMetric;
-
-    bIsHScrollMetricSet = bApplyCharUnit;
-    bIsVScrollMetricSet = bApplyCharUnit;
-
     aContentConfig.Load();
     aLayoutConfig.Load();
     aGridConfig.Load();
commit 5586202428a483004bf38bcd477ab62a3d0ca945
Author: Andras Timar <atimar at suse.com>
Date:   Tue Jun 7 17:01:30 2011 +0200

    fdo#37869 re-add missing elements to Elements dialog in Math
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx
index 3ee46f1..663f685 100644
--- a/starmath/source/toolbox.cxx
+++ b/starmath/source/toolbox.cxx
@@ -238,7 +238,7 @@ void SmToolBoxWindow::StateChanged( StateChangedType nStateChange )
 void SmToolBoxWindow::AdjustPosSize( bool bSetPos )
 {
     Size aCatSize( aToolBoxCat.CalcWindowSizePixel( 2 ) );
-    Size aCmdSize( pToolBoxCmd->CalcWindowSizePixel( 4 /* see nLines in SetCategory*/ ) );
+    Size aCmdSize( pToolBoxCmd->CalcWindowSizePixel( 5 /* see nLines in SetCategory*/ ) );
     OSL_ENSURE( aCatSize.Width() == aCmdSize.Width(), "width mismatch" );
 
     // catalog settings
@@ -307,13 +307,13 @@ void SmToolBoxWindow::SetCategory(sal_uInt16 nCategoryRID)
     switch (nCategoryRID)
     {
         case RID_UNBINOPS_CAT :     nLines = 4; break;
-        case RID_RELATIONS_CAT:     nLines = 4; break;
-        case RID_SETOPERATIONS_CAT: nLines = 4; break;
-        case RID_FUNCTIONS_CAT:     nLines = 4; break;
+        case RID_RELATIONS_CAT:     nLines = 5; break;
+        case RID_SETOPERATIONS_CAT: nLines = 5; break;
+        case RID_FUNCTIONS_CAT:     nLines = 5; break;
         case RID_OPERATORS_CAT:     nLines = 3; break;
-        case RID_ATTRIBUTES_CAT:    nLines = 4; break;
+        case RID_ATTRIBUTES_CAT:    nLines = 5; break;
         case RID_MISC_CAT:          nLines = 4; break;
-        case RID_BRACKETS_CAT:      nLines = 4; break;
+        case RID_BRACKETS_CAT:      nLines = 5; break;
         case RID_FORMAT_CAT:        nLines = 3; break;
         default:
             // nothing to be done
commit c8b527732436964d85e1150ec3ae627066557dab
Author: Andras Timar <atimar at suse.com>
Date:   Mon Jun 6 23:41:44 2011 +0200

    fdo#38007 fix for a truncated German string
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index bd95664..4af01f1 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -471,7 +471,7 @@ TabPage TP_STD_FONT
     FixedText FT_SIZE
     {
         Pos = MAP_APPFONT ( 204 , 14 ) ;
-        Size = MAP_APPFONT ( 30 , 8 ) ;
+        Size = MAP_APPFONT ( 40 , 8 ) ;
         Text [ en-US ] = "Size";
     };
     MetricBox LB_STANDARD_SIZE


More information about the Libreoffice-commits mailing list