[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 11 commits - g qadevOOo/qa solenv/gbuild sw/inc sw/source

Michael Stahl mstahl at redhat.com
Fri Jun 19 09:26:34 PDT 2015


 g                                            |    6 +--
 qadevOOo/qa/registrymodifications.xcu        |    9 ++++
 solenv/gbuild/JunitTest.mk                   |    3 +
 sw/inc/authfld.hxx                           |    2 -
 sw/inc/fldbas.hxx                            |    2 -
 sw/source/core/doc/docbm.cxx                 |    1 
 sw/source/core/fields/fldbas.cxx             |    6 ---
 sw/source/core/txtnode/txatbase.cxx          |    9 ++++
 sw/source/filter/ww8/docxattributeoutput.cxx |   10 ++++-
 sw/source/filter/ww8/wrtw8nds.cxx            |   52 +++++++++++++++++++++++----
 sw/source/filter/ww8/ww8atr.cxx              |   37 +++++++++++++++++--
 11 files changed, 112 insertions(+), 25 deletions(-)

New commits:
commit 1bcd54e93245dfaea0a072493d8bab9e569bae93
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat Jun 13 00:37:39 2015 +0200

    tdf#88697: sw: make WW8 export of CITATION fields compatible with
    
    ... older versions of Word and LO.
    
    Based on a prototype patch by Yury <yury.tarasievich at gmail.com>
    
    The problem is that Word 2003 does not understand the new CITATION field
    added in commit 06f7d1a96eef5aa69d4872ff6d96eb5085296d09.
    
    Word 2010 does appear to at least recognize it as a field.
    
    Also fix the textual field type, which was omitted for CITATION fields,
    except when the document was imported from DOCX.
    
    Change-Id: I62b13a4f585dce535d587555b357ab7e4ef0e460
    (cherry picked from commit f56289ac6d7f3da7fd45dd431ce4c540aadcad56)

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 40cfbc7..c5354b7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1828,6 +1828,27 @@ WW8_WrPlcField* WW8Export::CurrentFieldPlc() const
 void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
     const OUString& rFieldCmd, sal_uInt8 nMode )
 {
+    OUString sFieldCmd(rFieldCmd);
+    switch (eFieldType)
+    {
+        // map fields that are not supported in WW8 as of Word 2003
+        case ww::eBIBLIOGRPAHY:
+            eFieldType = ww::eQUOTE;
+            assert(rFieldCmd == FieldString(ww::eBIBLIOGRPAHY));
+            sFieldCmd = FieldString(ww::eQUOTE);
+            break;
+        case ww::eCITATION:
+            eFieldType = ww::eQUOTE;
+            assert(rFieldCmd.startsWith(FieldString(ww::eCITATION)));
+            sFieldCmd = rFieldCmd.replaceFirst(FieldString(ww::eCITATION),
+                                               FieldString(ww::eQUOTE));
+            break;
+        default:
+            break;
+    }
+
+    assert(eFieldType <= 0x5F); // 95 is the highest documented one
+
     bool bUnicode = IsUnicode();
     WW8_WrPlcField* pFieldP = CurrentFieldPlc();
 
@@ -1845,10 +1866,10 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
     if (WRITEFIELD_CMD_START & nMode)
     {
         if (bUnicode)
-            SwWW8Writer::WriteString16(Strm(), rFieldCmd, false);
+            SwWW8Writer::WriteString16(Strm(), sFieldCmd, false);
         else
         {
-            SwWW8Writer::WriteString8(Strm(), rFieldCmd, false,
+            SwWW8Writer::WriteString8(Strm(), sFieldCmd, false,
                 RTL_TEXTENCODING_MS_1252);
         }
         // #i43956# - write hyperlink character including
@@ -1901,7 +1922,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
         if( pField )
             sOut = lcl_GetExpandedField(*pField);
         else
-            sOut = rFieldCmd;
+            sOut = sFieldCmd;
         if( !sOut.isEmpty() )
         {
             if( bUnicode )
@@ -2902,8 +2923,15 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
         break;
     case RES_AUTHORITY:
     {
-        OUString const sRet(static_cast<SwAuthorityField const*>(pField)
+        OUString sRet(static_cast<SwAuthorityField const*>(pField)
                         ->ExpandCitation(AUTH_FIELD_IDENTIFIER));
+        // FIXME: DomainMapper_Impl::CloseFieldCommand() stuffs fully formed
+        // field instructions in here, but if the field doesn't originate
+        // from those filters it won't have that
+        if (!sRet.trim().startsWith("CITATION"))
+        {
+            sRet = FieldString(ww::eCITATION) + " \"" + sRet + "\"";
+        }
         GetExport().OutputField( pField, ww::eCITATION, sRet );
     }
     break;
commit 1b5dc145e4e73fb2b8eaab1af3cb18d48048a1f0
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jun 19 13:55:12 2015 +0200

    sw: remove the SwField::ExpandCitation disaster
    
    Change-Id: I3adf4182ad77bfd1af3737f640e9d3fe6db5dfc9
    (cherry picked from commit 8ee3cb95638f25fea8dc85e2dc5eec89ea41fc38)

diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index 11ce33e..73e1d09 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -155,7 +155,7 @@ public:
     OUString ConditionalExpand(ToxAuthorityField eField) const;
 
     //To handle Citation
-    OUString ExpandCitation(ToxAuthorityField eField) const;
+    SW_DLLPUBLIC OUString ExpandCitation(ToxAuthorityField eField) const;
 
     SwAuthorityField(SwAuthorityFieldType* pType, const OUString& rFieldContents);
     SwAuthorityField(SwAuthorityFieldType* pType, sal_IntPtr nHandle);
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 7447fdb..6406fae 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -319,8 +319,6 @@ public:
       */
     OUString            ExpandField(bool const bCached, ToxAuthorityField eField = AUTH_FIELD_IDENTIFIER) const;
 
-    OUString            ExpandCitation(ToxAuthorityField eField = AUTH_FIELD_IDENTIFIER) const;
-
     /// @return name or content.
     virtual OUString    GetFieldName() const;
 
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index 7f02e0a..40b96c2 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -435,12 +435,6 @@ OUString SwField::ExpandField(bool const bCached, ToxAuthorityField eField) cons
     return Expand();
 }
 
-OUString SwField::ExpandCitation(ToxAuthorityField eField) const
-{
-    const SwAuthorityField* pAuthorityField = static_cast<const SwAuthorityField*>(this);
-        return (pAuthorityField ? pAuthorityField->ExpandCitation(eField) : OUString());
-}
-
 SwField * SwField::CopyField() const
 {
     SwField *const pNew = Copy();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index d07cf9e..073ec34 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -91,6 +91,7 @@
 #include <svl/whiter.hxx>
 
 #include <docufld.hxx>
+#include <authfld.hxx>
 #include <flddropdown.hxx>
 #include <fmtclds.hxx>
 #include <fmtinfmt.hxx>
@@ -1558,7 +1559,8 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
         OUString sExpand;
         if(rInfos.eType == ww::eCITATION)
         {
-            sExpand = rInfos.pField->ExpandCitation(AUTH_FIELD_TITLE);
+            sExpand = static_cast<SwAuthorityField const*>(rInfos.pField.get())
+                        ->ExpandCitation(AUTH_FIELD_TITLE);
         }
         else
         {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 42e0a42..40cfbc7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2902,7 +2902,8 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
         break;
     case RES_AUTHORITY:
     {
-        OUString sRet(pField->ExpandCitation(AUTH_FIELD_IDENTIFIER));
+        OUString const sRet(static_cast<SwAuthorityField const*>(pField)
+                        ->ExpandCitation(AUTH_FIELD_IDENTIFIER));
         GetExport().OutputField( pField, ww::eCITATION, sRet );
     }
     break;
commit a8fc9918971bbad60577fa2eb49371e2bb3e6a1e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jun 19 12:32:26 2015 +0200

    qadevOOo: fix _XDataPilotTables failure in non-english locales
    
    Set the UILocale to en but do that with a registrymodifications.xcu as
    setting it via configmgr requires a restart.
    
    Change-Id: I26d9f6aa07852a7f18e2b3b7baccdb2e85524ea4
    (cherry picked from commit 32b6002d46682819d440243aff4dd53556e89754)

diff --git a/qadevOOo/qa/registrymodifications.xcu b/qadevOOo/qa/registrymodifications.xcu
new file mode 100644
index 0000000..9d9c2a8a
--- /dev/null
+++ b/qadevOOo/qa/registrymodifications.xcu
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Force EN Calc function names and UI so "Filter" match also
+     when building with non-en system locales -->
+<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<item oor:path="/org.openoffice.Office.Calc/Formula/Syntax"><prop oor:name="EnglishFunctionName" oor:op="fuse"><value>true</value></prop></item>
+<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooSetupSystemLocale" oor:op="fuse"><value>en-US</value></prop></item>
+<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooLocale" oor:op="fuse"><value>en</value></prop></item>
+<item oor:path="/org.openoffice.Office.Linguistic/General"><prop oor:name="UILocale" oor:op="fuse"><value>en-US</value></prop></item>
+</oor:items>
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 4078421..30e226d 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -35,7 +35,8 @@ $(call gb_JunitTest_get_target,%) :
 	$(call gb_Output_announce,$*,$(true),JUT,2)
 	$(call gb_Helper_abbreviate_dirs,\
         rm -rf $(call gb_JunitTest_get_userdir,$*) && \
-		mkdir -p $(call gb_JunitTest_get_userdir,$*) && \
+		mkdir -p $(call gb_JunitTest_get_userdir,$*)/user && \
+		cp $(SRCDIR)/qadevOOo/qa/registrymodifications.xcu $(call gb_JunitTest_get_userdir,$*)/user/ && \
         ($(gb_JunitTest_JAVACOMMAND) \
             -classpath "$(T_CP)" \
             $(DEFS) \
commit a3d193da68107ba5e3a4a4087446806f7ab59c96
Author: Tomofumi Yagi <yagit at mknada.sakura.ne.jp>
Date:   Mon Jun 15 21:20:19 2015 +0900

    'g' doesn't work correctly when config_host.mk contains non-ascii characters.
    
    In 'g' shell script, we use grep to get substring from config_host.mk file.
    When config_host.mk file contains non-ascii characters(e.g. Japanese),
    this processing doesn't work.
    As a result, some variables(SUBMODULES_CONFIGURED, REFERENCED_GIT, LINKED_GIT) will be
    assigned to "Binary file (standard input) matches".
    This is an error message of grep.
    The problem will reproduce on Cygwin64 with Japanese locale.
    
    With '-a' option, grep will work well, and 'g' shell script will work correctly.
    
    Please refer the following commit,too.
    http://cgit.freedesktop.org/libreoffice/core/commit/?id=0293ec98c92fd58a592f7dd86fbbf47e7b9195c6
    
    Change-Id: If4e0b356173c8f442e3539ed343f441d87dbfd48
    Reviewed-on: https://gerrit.libreoffice.org/16344
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 125f06dbf73c287c3559acbb3096330b5e75135b)

diff --git a/g b/g
index 2db87cf..423a200 100755
--- a/g
+++ b/g
@@ -147,7 +147,7 @@ get_configured_submodules()
 {
     SUBMODULES_CONFIGURED=""
     if [ -f config_host.mk ] ; then
-	SUBMODULES_CONFIGURED=$(cat config_host.mk | grep GIT_NEEDED_SUBMODULES | sed -e "s/.*=//")
+	SUBMODULES_CONFIGURED=$(cat config_host.mk | grep -a GIT_NEEDED_SUBMODULES | sed -e "s/.*=//")
     else
 	# if we need the configured submoduel before the configuration is done. we assumed you want them all
 	SUBMODULES_CONFIGURED=${SUBMODULES_ALL?}
@@ -158,11 +158,11 @@ get_git_reference()
 {
     REFERENCED_GIT=""
     if [ -f config_host.mk ]; then
-	REFERENCED_GIT=$(cat config_host.mk | grep GIT_REFERENCE_SRC | sed -e "s/.*=//")
+	REFERENCED_GIT=$(cat config_host.mk | grep -a GIT_REFERENCE_SRC | sed -e "s/.*=//")
     fi
     LINKED_GIT=""
     if [ -f config_host.mk ]; then
-	LINKED_GIT=$(cat config_host.mk | grep GIT_LINK_SRC | sed -e "s/.*=//")
+	LINKED_GIT=$(cat config_host.mk | grep -a GIT_LINK_SRC | sed -e "s/.*=//")
     fi
 }
 
commit 5ad61bd0b961541b7d31b26bc31c69136088d9ab
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 18 00:21:24 2015 +0200

    sw: WW8 export: speed up attribute iteration
    
    Change-Id: I9da47d7add4fadf34fd4e3c9aa6f1e65cf100b20
    (cherry picked from commit ef82115aef668b649a80324f5cd126f93a169c4d)

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 448371f..a3779e4 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1230,6 +1230,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                     }
                     break;
             }
+            if (nPos < *pHt->GetAnyEnd())
+                break; // sorted by end
         }
         for ( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
@@ -1282,6 +1284,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                     }
                     break;
             }
+            if (nPos < pHt->GetStart())
+                break; // sorted by start
         }
         m_rExport.m_aCurrentCharPropStarts.pop(); // HasTextItem only allowed in the above range
     }
commit 04563b0bcb9bc0c84d042078c0ba415aa505eab3
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 18 00:18:02 2015 +0200

    sw: DOCX export: fix exporting of hyperlink inside ruby
    
    The problem is that the hints are iterated in order of start position,
    and if there is a hyperlink inside a ruby then its end position will be
    reached after the end position of the ruby due to the sort order, which
    leads to overlapping XML elements.
    
    So for any given position, first export the end positions, then the
    start positions.
    
    Change-Id: I2db28d7a36e4e34fbd394b3a69fe4549ee905250
    Example: fdo82849-1.docx
    (cherry picked from commit e5ae9bed63a742d9fb40cf63ce92eba5ac72b23d)

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 09c9b8f..448371f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1198,6 +1198,39 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
     {
         m_rExport.m_aCurrentCharPropStarts.push( nPos );
         const sal_Int32* pEnd;
+        // first process ends of attributes with extent
+        for (size_t i = 0; i < pTextAttrs->GetEndCount(); ++i)
+        {
+            const SwTextAttr* pHt = pTextAttrs->GetEnd(i);
+            const SfxPoolItem* pItem = &pHt->GetAttr();
+            switch ( pItem->Which() )
+            {
+                case RES_TXTATR_INETFMT:
+                    pEnd = pHt->End();
+                    if (nPos == *pEnd && nPos != pHt->GetStart())
+                    {
+                        if (m_rExport.AttrOutput().EndURL(nPos == rNd.Len()))
+                            --nRet;
+                    }
+                    break;
+                case RES_TXTATR_REFMARK:
+                    pEnd = pHt->End();
+                    if (nullptr != pEnd && nPos == *pEnd && nPos != pHt->GetStart())
+                    {
+                        OutSwFormatRefMark(*static_cast<const SwFormatRefMark*>(pItem), false);
+                        --nRet;
+                    }
+                    break;
+                case RES_TXTATR_CJK_RUBY:
+                    pEnd = pHt->End();
+                    if (nPos == *pEnd && nPos != pHt->GetStart())
+                    {
+                        m_rExport.AttrOutput().EndRuby();
+                        --nRet;
+                    }
+                    break;
+            }
+        }
         for ( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
             const SwTextAttr* pHt = (*pTextAttrs)[i];
@@ -1212,8 +1245,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                             ++nRet;
                     }
                     pEnd = pHt->End();
-                    if (nPos == *pEnd )
-                    {
+                    if (nPos == *pEnd && nPos == pHt->GetStart())
+                    {   // special case: empty must be handled here
                         if (m_rExport.AttrOutput().EndURL(nPos == rNd.Len()))
                             --nRet;
                     }
@@ -1225,8 +1258,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                         ++nRet;
                     }
                     pEnd = pHt->End();
-                    if (nullptr != pEnd && nPos == *pEnd)
-                    {
+                    if (nullptr != pEnd && nPos == *pEnd && nPos == pHt->GetStart())
+                    {   // special case: empty TODO: is this possible or would empty one have pEnd null?
                         OutSwFormatRefMark( *static_cast< const SwFormatRefMark* >( pItem ), false );
                         --nRet;
                     }
@@ -1242,8 +1275,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                         ++nRet;
                     }
                     pEnd = pHt->End();
-                    if (nPos == *pEnd)
-                    {
+                    if (nPos == *pEnd && nPos == pHt->GetStart())
+                    {   // special case: empty must be handled here
                         m_rExport.AttrOutput().EndRuby();
                         --nRet;
                     }
commit b5e98cef215442d6aef60ff6443822b6867e59ac
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 18 00:13:57 2015 +0200

    sw: DOCX export fix non-well-formed XML if hyperlink followed by ruby
    
    If a hyperlink ends on the same position as a ruby starts, the hyperlink is
    not closed before the ruby so its end tag is written inside the ruby
    element.  Example: fdo82849-1.odt
    
    Change-Id: I4531327ee23a99e366c2de5d9b08ddabb1be69c7
    (cherry picked from commit 84ea33ef9a86f097a248b526554cdc3581c8d725)

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6b10ae4..d07cf9e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2125,6 +2125,12 @@ void DocxAttributeOutput::RawText( const OUString& /*rText*/, bool /*bForceUnico
 void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby )
 {
     OSL_TRACE("TODO DocxAttributeOutput::StartRuby( const SwTextNode& rNode, const SwFormatRuby& rRuby )" );
+    if (m_closeHyperlinkInThisRun)
+    {
+        EndRun(); // end hyperlink before starting ruby to avoid overlap
+        assert(!m_closeHyperlinkInThisRun);
+        assert(!m_closeHyperlinkInPreviousRun);
+    }
     m_pSerializer->startElementNS( XML_w, XML_ruby, FSEND );
     m_pSerializer->startElementNS( XML_w, XML_rubyPr, FSEND );
     // hps
commit 7d848348700d82e5688207b17606736d535bf344
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 17 22:09:51 2015 +0200

    sw: WW8: except refmark these attributes always have an end position
    
    Change-Id: I33c51176b4497f1fcfe5a05d07741e8b74e7243b
    (cherry picked from commit 1f154e31bf609dc32001a271fa13f9302f18a207)

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 64919a1..09c9b8f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1211,7 +1211,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                         if ( m_rExport.AttrOutput().StartURL( rINet->GetValue(), rINet->GetTargetFrame() ) )
                             ++nRet;
                     }
-                    if ( 0 != ( pEnd = pHt->End() ) && nPos == *pEnd )
+                    pEnd = pHt->End();
+                    if (nPos == *pEnd )
                     {
                         if (m_rExport.AttrOutput().EndURL(nPos == rNd.Len()))
                             --nRet;
@@ -1223,7 +1224,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                         OutSwFormatRefMark( *static_cast< const SwFormatRefMark* >( pItem ), true );
                         ++nRet;
                     }
-                    if ( 0 != ( pEnd = pHt->End() ) && nPos == *pEnd )
+                    pEnd = pHt->End();
+                    if (nullptr != pEnd && nPos == *pEnd)
                     {
                         OutSwFormatRefMark( *static_cast< const SwFormatRefMark* >( pItem ), false );
                         --nRet;
@@ -1239,7 +1241,8 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
                         m_rExport.AttrOutput().StartRuby( rNd, nPos, *static_cast< const SwFormatRuby* >( pItem ) );
                         ++nRet;
                     }
-                    if ( 0 != ( pEnd = pHt->End() ) && nPos == *pEnd )
+                    pEnd = pHt->End();
+                    if (nPos == *pEnd)
                     {
                         m_rExport.AttrOutput().EndRuby();
                         --nRet;
commit f9a860f66b7d327661a24f9d5a3e0f9f7e08b822
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 17 21:23:40 2015 +0200

    sw: dump ruby text in nodes dump
    
    Change-Id: Iae673ac8ed8e5817efefd665dbf5f061e80f94bc
    (cherry picked from commit ca6667f8de0fff6af128fc27458da30a1a6e5046)

diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx
index d480907..f9087b9 100644
--- a/sw/source/core/txtnode/txatbase.cxx
+++ b/sw/source/core/txtnode/txatbase.cxx
@@ -110,6 +110,13 @@ void SwTextAttr::dumpAsXml(xmlTextWriterPtr pWriter) const
             oValue = "url: " + rFormat.GetValue().toUtf8();
             break;
         }
+    case RES_TXTATR_CJK_RUBY:
+        {
+            pWhich = "ruby";
+            const SwFormatRuby& rFormat = GetRuby();
+            oValue = "rubytext: " + rFormat.GetText().toUtf8();
+            break;
+        }
     default:
         break;
     }
commit caf22cc0d2088d66bb3a26d857f23236351b8533
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 17 21:19:34 2015 +0200

    sw: fix duplicate whichId attributes in node dump
    
    Change-Id: I5089ce8e13d26dcc773f63b3a6f0ef17474444e0
    (cherry picked from commit 894ce91bfd456df6101977621c69441e9338d500)

diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx
index 0d3c8da..d480907 100644
--- a/sw/source/core/txtnode/txatbase.cxx
+++ b/sw/source/core/txtnode/txatbase.cxx
@@ -114,7 +114,7 @@ void SwTextAttr::dumpAsXml(xmlTextWriterPtr pWriter) const
         break;
     }
     if (pWhich)
-        xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(pWhich));
+        xmlTextWriterWriteAttribute(pWriter, BAD_CAST("which"), BAD_CAST(pWhich));
     if (oValue)
         xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(oValue->getStr()));
     if (Which() == RES_TXTATR_AUTOFMT)
commit f4da7de956c7932ead092edbf91dce00338f045b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 17 17:53:26 2015 +0200

    sw: tweak CrossRefBookmark hack to re-sort if applied
    
    Change-Id: I8ea68819a87abecb2a6561fbd5b695902dd4af63
    (cherry picked from commit 4a273473998a47ea7d125d3d4bd7e6d8b252767a)

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index b88bd17..be4805c 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -636,6 +636,7 @@ namespace sw { namespace mark
                 {
                     // ensure that cross ref bookmark always starts at 0
                     aNewPosRel.nContent = 0; // HACK for WW8 import
+                    isSortingNeeded = true; // and sort them to be safe...
                 }
                 aNewPosRel.nContent += pMark->GetMarkPos().nContent.GetIndex();
                 pMark->SetMarkPos(aNewPosRel);


More information about the Libreoffice-commits mailing list