[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - 11 commits - libcmis/libcmis-0.3.0.patch sw/CppunitTest_sw_odfimport.mk sw/inc sw/qa sw/source writerfilter/CppunitTest_writerfilter_rtftok.mk writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Oct 22 07:01:25 PDT 2013


 libcmis/libcmis-0.3.0.patch                              |   14 +
 sw/CppunitTest_sw_odfimport.mk                           |    5 
 sw/inc/IDocumentSettingAccess.hxx                        |    2 
 sw/inc/crsrsh.hxx                                        |    6 
 sw/inc/doc.hxx                                           |    1 
 sw/inc/viewsh.hxx                                        |    2 
 sw/qa/extras/odfimport/data/fdo37606.odt                 |binary
 sw/qa/extras/odfimport/data/fdo69862.odt                 |binary
 sw/qa/extras/odfimport/data/fdo69979.odt                 |binary
 sw/qa/extras/odfimport/odfimport.cxx                     |  108 +++++++++++++++
 sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx     |binary
 sw/qa/extras/ooxmlimport/data/fdo66474.docx              |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                 |   24 +++
 sw/qa/extras/rtfimport/data/n823675.rtf                  |   27 +++
 sw/qa/extras/rtfimport/rtfimport.cxx                     |   22 +++
 sw/source/core/crsr/crsrsh.cxx                           |   35 ++++
 sw/source/core/doc/doc.cxx                               |    5 
 sw/source/core/doc/docnew.cxx                            |    1 
 sw/source/core/edit/eddel.cxx                            |    4 
 sw/source/core/edit/edglss.cxx                           |   12 +
 sw/source/core/layout/trvlfrm.cxx                        |   37 ++---
 sw/source/core/text/txtfly.cxx                           |   10 +
 sw/source/core/view/vnew.cxx                             |    2 
 sw/source/filter/ww8/ww8par.cxx                          |    1 
 sw/source/ui/inc/swdtflvr.hxx                            |    2 
 sw/source/ui/uno/SwXDocumentSettings.cxx                 |   14 +
 sw/source/ui/wrtsh/select.cxx                            |    9 -
 writerfilter/CppunitTest_writerfilter_rtftok.mk          |    1 
 writerfilter/source/dmapper/DomainMapper.cxx             |    3 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |   15 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |    9 +
 writerfilter/source/dmapper/GraphicImport.cxx            |    3 
 writerfilter/source/dmapper/PropertyIds.cxx              |    1 
 writerfilter/source/dmapper/PropertyIds.hxx              |    1 
 writerfilter/source/dmapper/PropertyMap.cxx              |    4 
 writerfilter/source/dmapper/WrapPolygonHandler.cxx       |    8 -
 writerfilter/source/dmapper/WrapPolygonHandler.hxx       |    2 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx           |   17 +-
 38 files changed, 363 insertions(+), 44 deletions(-)

New commits:
commit 93a0950779bbda9a597f3b53c7a3f0254421171d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Oct 2 11:19:18 2013 +0200

    fdo#69979 SwCrsrShell::ExtendedSelectAll: exclude headers, too
    
    It turns out, normal Ctrl-A doesn't select headers, footers and fly
    content, either (just like not selecting footnotes). So do the same when
    in the "doc starts with table" special mode.
    
    Change-Id: Ib9bc397944a4d07ea03bc326f1536733c57f42e6
    (cherry picked from commit 232df42b8dc0b4f7a335d2931fc0f29e73b8bca0)

diff --git a/sw/qa/extras/odfimport/data/fdo69979.odt b/sw/qa/extras/odfimport/data/fdo69979.odt
new file mode 100644
index 0000000..8f7d77e
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo69979.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 451abaf..029e7e5 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -36,6 +36,7 @@ public:
     void testFdo37606();
     void testFdo37606Copy();
     void testFdo69862();
+    void testFdo69979();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -62,6 +63,7 @@ void Test::run()
         {"fdo37606.odt", &Test::testFdo37606},
         {"fdo37606.odt", &Test::testFdo37606Copy},
         {"fdo69862.odt", &Test::testFdo69862},
+        {"fdo69979.odt", &Test::testFdo69979},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -410,7 +412,22 @@ void Test::testFdo69862()
 
     SwTxtNode& rEnd = dynamic_cast<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
     CPPUNIT_ASSERT_EQUAL(OUString("H" "\x01" "ello."), rEnd.GetTxt());
+}
+
+void Test::testFdo69979()
+{
+    // The test doc is special in that it starts with a table and it also has a header.
+    SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+    SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell();
+    SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false);
 
+    pWrtShell->SelAll();
+    SwTxtNode& rStart = dynamic_cast<SwTxtNode&>(pShellCrsr->Start()->nNode.GetNode());
+    // This was "", as Ctrl-A also selected headers, but it should not.
+    CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetTxt());
+
+    SwTxtNode& rEnd = dynamic_cast<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
+    CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetTxt());
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index b1db2ef..3dad9fa 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -539,7 +539,7 @@ void SwCrsrShell::ExtendedSelectAll(bool bFootnotes)
 {
     SwNodes& rNodes = GetDoc()->GetNodes();
     SwPosition* pPos = m_pCurCrsr->GetPoint();
-    pPos->nNode = bFootnotes ? rNodes.GetEndOfPostIts() : rNodes.GetEndOfInserts();
+    pPos->nNode = bFootnotes ? rNodes.GetEndOfPostIts() : rNodes.GetEndOfAutotext();
     pPos->nContent.Assign( rNodes.GoNext( &pPos->nNode ), 0 );
     pPos = m_pCurCrsr->GetMark();
     pPos->nNode = rNodes.GetEndOfContent();
@@ -550,7 +550,7 @@ void SwCrsrShell::ExtendedSelectAll(bool bFootnotes)
 bool SwCrsrShell::ExtendedSelectedAll(bool bFootnotes)
 {
     SwNodes& rNodes = GetDoc()->GetNodes();
-    SwNodeIndex nNode = bFootnotes ? rNodes.GetEndOfPostIts() : rNodes.GetEndOfInserts();
+    SwNodeIndex nNode = bFootnotes ? rNodes.GetEndOfPostIts() : rNodes.GetEndOfAutotext();
     SwCntntNode* pStart = rNodes.GoNext(&nNode);
 
     nNode = rNodes.GetEndOfContent();
commit fccfa3fa16685ded54aa6a5d54227d70c02f243a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Sep 30 11:45:35 2013 +0200

    fdo#69862 SwCrsrShell::ExtendedSelectAll: don't always select footnotes
    
    ExtendedSelectAll() was originally invented to e.g. select the whole
    document, change the language of the selection and then inmediately
    (before the layout is updated) undo the selection.
    
    When using it for "select all and doc starts with a table" purposes,
    then footnotes shouldn't be selected, just like those are not selected
    either, when the doc starts with a normal paragraph. Their anchor is
    still selected, and that's enough to have correct delete and copy&paste.
    
    (cherry picked from commit 959711f1276106b0aaee69ab660f1b0d3ece5bbc)
    
    Conflicts:
    	sw/source/core/edit/eddel.cxx
    
    Change-Id: I4fc49db628054a4b8a46effc2d0328eaabcaa9f8

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 4338e63..3ed5ba7 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -325,9 +325,9 @@ public:
     // SelAll() selects the document body content
     // if ExtendedSelect() is called afterwards, the whole nodes array is selected
     // only for usage in special cases allowed!
-    void ExtendedSelectAll();
+    void ExtendedSelectAll(bool bFootnotes = true);
     /// If ExtendedSelectAll() was called and selection didn't change since then.
-    bool ExtendedSelectedAll();
+    bool ExtendedSelectedAll(bool bFootnotes = true);
     /// If document body starts with a table.
     bool StartsWithTable();
 
diff --git a/sw/qa/extras/odfimport/data/fdo69862.odt b/sw/qa/extras/odfimport/data/fdo69862.odt
new file mode 100644
index 0000000..aec48fd
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo69862.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index cc21876..451abaf 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -35,6 +35,7 @@ public:
     void testFdo55814();
     void testFdo37606();
     void testFdo37606Copy();
+    void testFdo69862();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -60,6 +61,7 @@ void Test::run()
         {"fdo55814.odt", &Test::testFdo55814},
         {"fdo37606.odt", &Test::testFdo37606},
         {"fdo37606.odt", &Test::testFdo37606Copy},
+        {"fdo69862.odt", &Test::testFdo69862},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -394,6 +396,23 @@ void Test::testFdo37606Copy()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount());
 }
 
+void Test::testFdo69862()
+{
+    // The test doc is special in that it starts with a table and it also has a footnote.
+    SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+    SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell();
+    SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false);
+
+    pWrtShell->SelAll();
+    SwTxtNode& rStart = dynamic_cast<SwTxtNode&>(pShellCrsr->Start()->nNode.GetNode());
+    // This was "Footnote.", as Ctrl-A also selected footnotes, but it should not.
+    CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetTxt());
+
+    SwTxtNode& rEnd = dynamic_cast<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
+    CPPUNIT_ASSERT_EQUAL(OUString("H" "\x01" "ello."), rEnd.GetTxt());
+
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index b52cd1c..b1db2ef 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -238,7 +238,7 @@ void SwCrsrShell::StartAction()
 
 void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
 {
-    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll());
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false));
     sal_Bool bVis = m_bSVCrsrVis;
 
     // Idle-formatting?
@@ -535,11 +535,11 @@ sal_Bool SwCrsrShell::SttEndDoc( sal_Bool bStt )
     return bRet;
 }
 
-void SwCrsrShell::ExtendedSelectAll()
+void SwCrsrShell::ExtendedSelectAll(bool bFootnotes)
 {
     SwNodes& rNodes = GetDoc()->GetNodes();
     SwPosition* pPos = m_pCurCrsr->GetPoint();
-    pPos->nNode = rNodes.GetEndOfPostIts();
+    pPos->nNode = bFootnotes ? rNodes.GetEndOfPostIts() : rNodes.GetEndOfInserts();
     pPos->nContent.Assign( rNodes.GoNext( &pPos->nNode ), 0 );
     pPos = m_pCurCrsr->GetMark();
     pPos->nNode = rNodes.GetEndOfContent();
@@ -547,10 +547,10 @@ void SwCrsrShell::ExtendedSelectAll()
     pPos->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 );
 }
 
-bool SwCrsrShell::ExtendedSelectedAll()
+bool SwCrsrShell::ExtendedSelectedAll(bool bFootnotes)
 {
     SwNodes& rNodes = GetDoc()->GetNodes();
-    SwNodeIndex nNode = rNodes.GetEndOfPostIts();
+    SwNodeIndex nNode = bFootnotes ? rNodes.GetEndOfPostIts() : rNodes.GetEndOfInserts();
     SwCntntNode* pStart = rNodes.GoNext(&nNode);
 
     nNode = rNodes.GetEndOfContent();
@@ -1188,7 +1188,7 @@ sal_Bool SwCrsrShell::GoPrevCrsr()
 
 void SwCrsrShell::Paint( const Rectangle &rRect)
 {
-    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll());
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false));
     SET_CURR_SHELL( this );
 
     // always switch off all cursors when painting
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 1f98618..064fe3d 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -39,7 +39,7 @@
 
 void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
 {
-    bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
+    bool bSelectAll = StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false);
     // nur bei Selektion
     if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark())
         return;
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index c1cdbd6..45ffe72 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -226,7 +226,7 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
         bool bColSel = _GetCrsr()->IsColumnSelection();
         if( bColSel && pInsDoc->IsClipBoard() )
             pInsDoc->SetColumnSelection( true );
-        bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
+        bool bSelectAll = StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false);
         {
         FOREACHPAM_START(this)
 
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 149d299..1e9262f 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -162,7 +162,7 @@ long SwWrtShell::SelAll()
 
         bool bStartsWithTable = StartsWithTable();
         if (bStartsWithTable)
-            ExtendedSelectAll();
+            ExtendedSelectAll(/*bFootnotes =*/ false);
 
         if( pStartPos )
         {
commit 8b20972782d01ed935de269345673c7fc8a3e96a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Sep 16 12:12:42 2013 +0200

    fdo#37606 SwWrtShell::SelAll(): fix for doc starting with table
    
    SwWrtShell::SelAll() can now detect if the body text starts with a
    table, and if so, it explicitly selects the whole document, not just the
    first cell of the starting table.
    
    Also, SwCrsrShell::EndAction() now checks for this "select all and doc
    starts with table" situation, and if that's the case, it activates a
    special select all mode, so layout can act accordingly.
    
    (cherry picked from commit 3b11e66ab89c201591d8be8f1ab1af1aba11a821)
    
    Conflicts:
    	sw/source/core/crsr/crsrsh.cxx
    	sw/source/core/layout/trvlfrm.cxx
    
    fdo#37606 SwWrtShell: fix select all when doc starts with table and cursor ...
    
    ... is outside that table
    
    (cherry picked from commit 4b6445dba6bb5b2aed3edb4878ecb327446286e9)
    
    fdo#37606 SwEditShell::DeleteSel(): handle document starting with a table
    
    If the whole document is selected and the document starts with a table,
    then we used to delete the contents of the document, except the starting
    table, which was just cleared. Change this and do what is expected:
    remove the table as well, so the document will have a single empty
    paragraph only.
    
    (cherry picked from commit 0fb4adcff534e3841cf6df0e2363fb0797af7022)
    
    Conflicts:
    	sw/source/core/edit/eddel.cxx
    
    fdo#37606 SwEditShell: fix copying when doc starts with a table ...
    
    ... and the whole document was selected
    
    The problem is that the cursor starts at the first cell of the starting
    table, but when copying, we want to copy the preceding startnode and
    tablenode as well.
    
    (cherry picked from commit 49505336a629a75f4fb48bbe0c532b402e857ed4)
    
    fdo#37606 testcase
    
    (cherry picked from commit f5fa78d75abac3dbe0f9edf9e9106f63ca5dca53)
    
    Conflicts:
    	sw/qa/extras/odfimport/odfimport.cxx
    
    Change-Id: I60d34906a90a5143163e516f618648cf7178430e

diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk
index d302127..956799e 100644
--- a/sw/CppunitTest_sw_odfimport.mk
+++ b/sw/CppunitTest_sw_odfimport.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_odfimport, \
     cppu \
     cppuhelper \
     sal \
+	svt \
 	sw \
     test \
     unotest \
@@ -36,6 +37,7 @@ $(eval $(call gb_CppunitTest_use_externals,sw_odfimport,\
 $(eval $(call gb_CppunitTest_set_include,sw_odfimport,\
     -I$(SRCDIR)/sw/inc \
     -I$(SRCDIR)/sw/source/core/inc \
+    -I$(SRCDIR)/sw/source/ui/inc \
 	-I$(SRCDIR)/sw/qa/extras/inc \
     $$(INCLUDE) \
 ))
@@ -70,6 +72,9 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfimport,\
     unotools/util/utl \
     unoxml/source/service/unoxml \
     uui/util/uui \
+    $(if $(filter-out MACOSX WNT,$(OS)), \
+		vcl/vcl.unx \
+    ) \
 	$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
     xmloff/util/xo \
 ))
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index a652acc..4338e63 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -326,6 +326,10 @@ public:
     // if ExtendedSelect() is called afterwards, the whole nodes array is selected
     // only for usage in special cases allowed!
     void ExtendedSelectAll();
+    /// If ExtendedSelectAll() was called and selection didn't change since then.
+    bool ExtendedSelectedAll();
+    /// If document body starts with a table.
+    bool StartsWithTable();
 
     SwPaM* GetCrsr( sal_Bool bMakeTblCrsr = sal_True ) const;
     inline SwCursor* GetSwCrsr( sal_Bool bMakeTblCrsr = sal_True ) const;
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 72d7c48..f3d867a 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -193,6 +193,7 @@ protected:
 
     sal_uInt16 mnStartAction; ///< != 0 if at least one ::com::sun::star::chaos::Action is active.
     sal_uInt16 mnLockPaint;   ///< != 0 if Paint is locked.
+    bool      mbSelectAll; ///< Special select all mode: whole document selected, even if doc starts with table.
 
 public:
     TYPEINFO();
@@ -564,6 +565,7 @@ public:
     bool IsHeaderFooterEdit() const { return mbHeaderFooterEdit; }
     bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? mbShowHeaderSeparator: mbShowFooterSeparator; }
     virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; }
+    bool IsSelectAll() { return mbSelectAll; }
 };
 
 //---- class CurrShell manages global ShellPointer -------------------
diff --git a/sw/qa/extras/odfimport/data/fdo37606.odt b/sw/qa/extras/odfimport/data/fdo37606.odt
new file mode 100644
index 0000000..462984f
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo37606.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 92139c1..cc21876 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -12,6 +12,12 @@
 #include <com/sun/star/text/XTextTable.hpp>
 #include <swmodeltestbase.hxx>
 
+#include <wrtsh.hxx>
+#include <ndtxt.hxx>
+#include <swdtflvr.hxx>
+#include <view.hxx>
+#include <edtwin.hxx>
+
 typedef std::map<OUString, com::sun::star::uno::Sequence< com::sun::star::table::BorderLine> > AllBordersMap;
 typedef std::pair<OUString, com::sun::star::uno::Sequence< com::sun::star::table::BorderLine> > StringSequencePair;
 
@@ -27,6 +33,8 @@ public:
     void testFdo60842();
     void testFdo56272();
     void testFdo55814();
+    void testFdo37606();
+    void testFdo37606Copy();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -50,6 +58,8 @@ void Test::run()
         {"fdo60842.odt", &Test::testFdo60842},
         {"fdo56272.odt", &Test::testFdo56272},
         {"fdo55814.odt", &Test::testFdo55814},
+        {"fdo37606.odt", &Test::testFdo37606},
+        {"fdo37606.odt", &Test::testFdo37606Copy},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -322,6 +332,68 @@ void Test::testFdo55814()
     CPPUNIT_ASSERT_EQUAL(OUString("Hide==\"Yes\""), getProperty<OUString>(xSections->getByIndex(0), "Condition"));
 }
 
+void Test::testFdo37606()
+{
+    SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+    SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell();
+    SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false);
+
+    {
+        pWrtShell->SelAll();
+        SwTxtNode& rStart = dynamic_cast<SwTxtNode&>(pShellCrsr->Start()->nNode.GetNode());
+        CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetTxt());
+
+        SwTxtNode& rEnd = dynamic_cast<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
+        // This was "A1", i.e. Ctrl-A only selected the A1 cell of the table, not the whole document.
+        CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetTxt());
+    }
+
+    {
+        pWrtShell->SttEndDoc(false); // Go to the end of the doc.
+        pWrtShell->SelAll(); // And now that we're outside of the table, try Ctrl-A again.
+        SwTxtNode& rStart = dynamic_cast<SwTxtNode&>(pShellCrsr->Start()->nNode.GetNode());
+        // This was "Hello", i.e. Ctrl-A did not select the starting table.
+        CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetTxt());
+
+        SwTxtNode& rEnd = dynamic_cast<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
+        CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetTxt());
+    }
+
+    {
+        pWrtShell->Delete(); // Delete the selection
+        // And make sure the table got deleted as well.
+        SwNodes& rNodes = pWrtShell->GetDoc()->GetNodes();
+        SwNodeIndex nNode(rNodes.GetEndOfExtras());
+        SwCntntNode* pCntntNode = rNodes.GoNext(&nNode);
+        // First content node was in a table -> table wasn't deleted.
+        CPPUNIT_ASSERT(!pCntntNode->FindTableNode());
+    }
+}
+
+void Test::testFdo37606Copy()
+{
+    SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+    SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell();
+    // Ctrl-A
+    pWrtShell->SelAll();
+
+    // Ctrl-C
+    SwTransferable* pTransferable = new SwTransferable(*pWrtShell);
+    uno::Reference<datatransfer::XTransferable> xTransferable(pTransferable);
+    pTransferable->Copy();
+
+    pWrtShell->SttEndDoc(false); // Go to the end of the doc.
+
+    // Ctrl-V
+    TransferableDataHelper aDataHelper(TransferableDataHelper::CreateFromSystemClipboard(&pWrtShell->GetView().GetEditWin()));
+    SwTransferable::Paste( *pWrtShell, aDataHelper );
+
+    // Previously copy&paste failed to copy the table in case it was the document-starting one.
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 38b75c9..b52cd1c 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -58,6 +58,7 @@
 #include <numrule.hxx>
 #include <IGrammarContact.hxx>
 
+#include <comphelper/flagguard.hxx>
 #include <globals.hrc>
 
 #include <comcore.hrc>
@@ -237,6 +238,7 @@ void SwCrsrShell::StartAction()
 
 void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
 {
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll());
     sal_Bool bVis = m_bSVCrsrVis;
 
     // Idle-formatting?
@@ -545,6 +547,32 @@ void SwCrsrShell::ExtendedSelectAll()
     pPos->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 );
 }
 
+bool SwCrsrShell::ExtendedSelectedAll()
+{
+    SwNodes& rNodes = GetDoc()->GetNodes();
+    SwNodeIndex nNode = rNodes.GetEndOfPostIts();
+    SwCntntNode* pStart = rNodes.GoNext(&nNode);
+
+    nNode = rNodes.GetEndOfContent();
+    SwCntntNode* pEnd = rNodes.GoPrevious(&nNode);
+
+    if (!pStart || !pEnd)
+        return false;
+
+    SwPosition aStart(*pStart, 0);
+    SwPosition aEnd(*pEnd, pEnd->Len());
+    SwShellCrsr* pShellCrsr = getShellCrsr(false);
+    return aStart == *pShellCrsr->Start() && aEnd == *pShellCrsr->End();
+}
+
+bool SwCrsrShell::StartsWithTable()
+{
+    SwNodes& rNodes = GetDoc()->GetNodes();
+    SwNodeIndex nNode(rNodes.GetEndOfExtras());
+    SwCntntNode* pCntntNode = rNodes.GoNext(&nNode);
+    return pCntntNode->FindTableNode();
+}
+
 sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
 {
     sal_Bool bRet = sal_False;
@@ -1160,6 +1188,7 @@ sal_Bool SwCrsrShell::GoPrevCrsr()
 
 void SwCrsrShell::Paint( const Rectangle &rRect)
 {
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll());
     SET_CURR_SHELL( this );
 
     // always switch off all cursors when painting
@@ -1338,7 +1367,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
         mpDoc->IsIdxInTbl( pTstCrsr->GetPoint()->nNode ) &&
           ( m_pTblCrsr ||
             pTstCrsr->GetNode( sal_True )->StartOfSectionNode() !=
-            pTstCrsr->GetNode( sal_False )->StartOfSectionNode() ) )
+            pTstCrsr->GetNode( sal_False )->StartOfSectionNode() ) && !mbSelectAll)
     {
         SwShellCrsr* pITmpCrsr = getShellCrsr( true );
         Point aTmpPt( pITmpCrsr->GetPtPos() );
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index ca20b2d..1f98618 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -39,6 +39,7 @@
 
 void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
 {
+    bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
     // nur bei Selektion
     if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark())
         return;
@@ -49,9 +50,10 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
     //  1. Point und Mark stehen in einer Box, Selection normal loeschen
     //  2. Point und Mark stehen in unterschiedlichen Boxen, alle
     // selektierten Boxen suchen in den Inhalt loeschen
+    // 3. Point and Mark are at the document start and end, Point is in a table: delete selection as usual
     if( rPam.GetNode()->FindTableNode() &&
         rPam.GetNode()->StartOfSectionNode() !=
-        rPam.GetNode(sal_False)->StartOfSectionNode() )
+        rPam.GetNode(sal_False)->StartOfSectionNode() && !bSelectAll )
     {
         // in Tabellen das Undo gruppieren
         if( pUndo && !*pUndo )
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index f63912e..c1cdbd6 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -226,6 +226,7 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
         bool bColSel = _GetCrsr()->IsColumnSelection();
         if( bColSel && pInsDoc->IsClipBoard() )
             pInsDoc->SetColumnSelection( true );
+        bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
         {
         FOREACHPAM_START(this)
 
@@ -244,7 +245,16 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
             }
             else
             {
-                bRet = GetDoc()->CopyRange( *PCURCRSR, aPos, false ) || bRet;
+                // Make a copy, so that in case we need to adjust the selection
+                // for the purpose of copying, our shell cursor is not touched.
+                // (Otherwise we would have to restore it.)
+                SwPaM aPaM(*PCURCRSR);
+                if (bSelectAll)
+                    // Selection starts at the first para of the first cell,
+                    // but we want to copy the table and the start node before
+                    // the first cell as well.
+                    aPaM.Start()->nNode = aPaM.Start()->nNode.GetNode().FindTableNode()->GetIndex();
+                bRet = GetDoc()->CopyRange( aPaM, aPos, false ) || bRet;
             }
 
         FOREACHPAM_END()
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index f26c53d..3973467 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2619,6 +2619,9 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
             bool const bBody = pStartFrm->IsInDocBody();
             const SwTableBox* pCellBox = pStartFrm->GetUpper()->IsCellFrm() ?
                                          ((SwCellFrm*)pStartFrm->GetUpper())->GetTabBox() : 0;
+            if (pSh->IsSelectAll())
+                pCellBox = 0;
+
             const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
             SwRect aPrvRect;
 
@@ -2640,6 +2643,8 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
                 // same cell frame (or its follow cell)
                 const SwTableBox* pTmpCellBox = pCntnt->GetUpper()->IsCellFrm() ?
                                                 ((SwCellFrm*)pCntnt->GetUpper())->GetTabBox() : 0;
+                if (pSh->IsSelectAll())
+                    pTmpCellBox = 0;
                 if ( bBody == pCntnt->IsInDocBody() &&
                     ( !pCellBox || pCellBox == pTmpCellBox ) )
                 {
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 2c3053a..4977ba1 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -167,6 +167,7 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
     mpDoc( &rDocument ),
     mnStartAction( 0 ),
     mnLockPaint( 0 ),
+    mbSelectAll(false),
     mpPrePostOutDev(0), // #i72754#
     maPrePostMapMode()
 {
@@ -243,6 +244,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
     mpDoc( rShell.GetDoc() ),
     mnStartAction( 0 ),
     mnLockPaint( 0 ),
+    mbSelectAll(false),
     mpPrePostOutDev(0), // #i72754#
     maPrePostMapMode()
 {
diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index e790297..0b369d0 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -53,7 +53,7 @@ namespace nsTransferBufferType
 }
 
 
-class SwTransferable : public TransferableHelper
+class SW_DLLPUBLIC SwTransferable : public TransferableHelper
 {
     friend class SwView_Impl;
     SfxObjectShellLock             aDocShellRef;
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 370b449..149d299 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -159,6 +159,11 @@ long SwWrtShell::SelAll()
         }
         SttSelect();
         GoEnd(sal_True, &bMoveTable);
+
+        bool bStartsWithTable = StartsWithTable();
+        if (bStartsWithTable)
+            ExtendedSelectAll();
+
         if( pStartPos )
         {
             pTmpCrsr = getShellCrsr( false );
@@ -169,9 +174,9 @@ long SwWrtShell::SelAll()
                 // if the last selection was behind the first section or
                 // if the last selection was already the first section
                 // In this both cases we select to the end of document
-                if( *pTmpCrsr->GetPoint() < *pEndPos ||
+                if( ( *pTmpCrsr->GetPoint() < *pEndPos ||
                     ( *pStartPos == *pTmpCrsr->GetMark() &&
-                      *pEndPos == *pTmpCrsr->GetPoint() ) )
+                      *pEndPos == *pTmpCrsr->GetPoint() ) ) && !bStartsWithTable)
                     SwCrsrShell::SttEndDoc(sal_False);
             }
             delete pStartPos;
commit 44efea1a29446f44213fe2a02b934d94b17ac45e
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Aug 14 15:10:34 2013 +0200

    w:spacing in a paragraph should also apply to as-char objects (bnc#780044)
    
    Otherwise global w:spacing will be used even if overriden locally.
    
    (cherry picked from commit 186fc4c434384e07c18ff2dd2bd0e00a49bf17a7)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    [ Miklos: fix build. ]
    
    Change-Id: I01f0a3a323566f6e29faf73bf9d2ba874565eb42

diff --git a/sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx b/sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx
new file mode 100644
index 0000000..927d4d3
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ef14f15..709431d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -138,6 +138,7 @@ public:
     void testBnc779620();
     void testDefaultSectBreakCols();
     void testFdo66474();
+    void testBnc780044Spacing();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -240,6 +241,7 @@ void Test::run()
         {"bnc779620.docx", &Test::testBnc779620},
         {"default-sect-break-cols.docx", &Test::testDefaultSectBreakCols},
         {"fdo66474.docx", &Test::testFdo66474},
+        {"bnc780044_spacing.docx", &Test::testBnc780044Spacing},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1680,6 +1682,17 @@ void Test::testFdo66474()
     CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth"));
 }
 
+void Test::testBnc780044Spacing()
+{
+    // The document has global w:spacing in styles.xml , and local w:spacing in w:pPr, which however
+    // only applied to text runs, not to as-character pictures. So the picture made the line higher.
+    uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+    uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+    uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+    xCursor->jumpToLastPage();
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 45cc5fe..b3eb0fe 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1749,6 +1749,15 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
             {
                 xProps->setPropertyValue( rPropNameSupplier.GetName( PROP_ANCHOR_TYPE ), bIsGraphic  ?  uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) : uno::makeAny( text::TextContentAnchorType_AT_PARAGRAPH ) );
             }
+            else
+            {
+                // Fix spacing for as-character objects. If the paragraph has CT_Spacing_after set,
+                // it needs to be set on the object too, as that's what object placement code uses.
+                PropertyMapPtr paragraphContext = GetTopContextOfType( CONTEXT_PARAGRAPH );
+                PropertyMap::const_iterator pos = paragraphContext->find( PropertyDefinition( PROP_PARA_BOTTOM_MARGIN, true ));
+                if( pos != paragraphContext->end())
+                    xProps->setPropertyValue( rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ), (*pos).second );
+            }
         }
     }
     catch ( const uno::Exception& e )
commit 613004417384005db286c2429bb3771b383e69ac
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Tue Aug 6 17:02:42 2013 +0200

    compatibility setting for MS Word wrapping text in less space (bnc#822908)
    
    The document itself is stupid and uses a SURROUND_THROUGH object with a number
    of empty lines that make it act is if it in fact was SURROUND_NONE, rather
    than actually disabling wrapping for the object and be done with it.
    But the difference was that Word still managed to fit those empty lines
    next to the object into the little space that was there, while LO already
    considered the space too small. So keep a compatibility setting for Word
    documents in order to avoid problems with such lame documents and hopefully
    that's enough.
    
    (cherry picked from commit 8f8b31abd02876c3601e343b8b3274754f8a61b6)
    
    Conflicts:
    	writerfilter/source/dmapper/PropertyIds.cxx
    	writerfilter/source/dmapper/PropertyIds.hxx
    
    Change-Id: I7d17b90de381fd86914ce5efd9c5a29fe4850edc

diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 1203915..73c14f9 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -77,6 +77,8 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
          CLIPPED_PICTURES,
          BACKGROUND_PARA_OVER_DRAWINGS,
          TAB_OVER_MARGIN,
+         // MS Word still wraps text around objects with less space than LO would.
+         SURROUND_TEXT_WRAP_SMALL,
          // COMPATIBILITY FLAGS END
 
          BROWSE_MODE,
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 12ab476..a977835 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -582,6 +582,7 @@ private:
     bool mbClippedPictures;
     bool mbBackgroundParaOverDrawings;
     bool mbTabOverMargin;
+    bool mbSurroundTextWrapSmall;
 
     bool mbLastBrowseMode                           : 1;
 
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 8cf4f11..c928888 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -192,6 +192,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
         case CLIPPED_PICTURES: return mbClippedPictures;
         case BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
         case TAB_OVER_MARGIN: return mbTabOverMargin;
+        case SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
 
         case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked!
         case HTML_MODE: return mbHTMLMode;
@@ -348,6 +349,10 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
             mbTabOverMargin = value;
             break;
 
+        case SURROUND_TEXT_WRAP_SMALL:
+            mbSurroundTextWrapSmall = value;
+            break;
+
          // COMPATIBILITY FLAGS END
 
         case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 91aa23b..50fb905 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -313,6 +313,7 @@ SwDoc::SwDoc()
     mbClippedPictures(false),
     mbBackgroundParaOverDrawings(false),
     mbTabOverMargin(false),
+    mbSurroundTextWrapSmall(false),
     mbLastBrowseMode( false ),
     mn32DummyCompatabilityOptions1(0),
     mn32DummyCompatabilityOptions2(0),
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 54635d7..65bf05e 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1342,6 +1342,9 @@ SwRect SwTxtFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
 // Wrap only on sides with at least 2cm space for the text
 #define TEXT_MIN 1134
 
+// MS Word wraps on sides with even less space (value guessed).
+#define TEXT_MIN_SMALL 300
+
 // Wrap on both sides up to a frame width of 1.5cm
 #define FRAME_MAX 850
 
@@ -1398,9 +1401,12 @@ SwSurround SwTxtFly::_GetSurroundForTextWrap( const SwAnchoredObject* pAnchoredO
                 else
                     nRight = 0;
             }
-            if( nLeft < TEXT_MIN )
+            const int textMin = GetMaster()->GetNode()
+                ->getIDocumentSettingAccess()->get(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL )
+                ? TEXT_MIN_SMALL : TEXT_MIN;
+            if( nLeft < textMin )
                 nLeft = 0;
-            if( nRight < TEXT_MIN )
+            if( nRight < textMin )
                 nRight = 0;
             if( nLeft )
                 eSurroundForTextWrap = nRight ? SURROUND_PARALLEL : SURROUND_LEFT;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index bf5bea0..bacc0fc 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1574,6 +1574,7 @@ void SwWW8ImplReader::ImportDop()
     rDoc.set(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS, true);
     rDoc.set(IDocumentSettingAccess::CLIPPED_PICTURES, true);
     rDoc.set(IDocumentSettingAccess::TAB_OVER_MARGIN, true);
+    rDoc.set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, true);
 
     //
     // COMPATIBILITY FLAGS END
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 080f3b7..f43c7e5 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -123,6 +123,7 @@ enum SwDocumentSettingsPropertyHandles
     HANDLE_EMBED_FONTS,
     HANDLE_EMBED_SYSTEM_FONTS,
     HANDLE_TAB_OVER_MARGIN,
+    HANDLE_SURROUND_TEXT_WRAP_SMALL
 };
 
 static MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -192,6 +193,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
         { RTL_CONSTASCII_STRINGPARAM("EmbedFonts"), HANDLE_EMBED_FONTS, CPPUTYPE_BOOLEAN, 0, 0},
         { RTL_CONSTASCII_STRINGPARAM("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, CPPUTYPE_BOOLEAN, 0, 0},
         { RTL_CONSTASCII_STRINGPARAM("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, CPPUTYPE_BOOLEAN, 0, 0},
+        { RTL_CONSTASCII_STRINGPARAM("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, CPPUTYPE_BOOLEAN, 0, 0},
 /*
  * As OS said, we don't have a view when we need to set this, so I have to
  * find another solution before adding them to this property set - MTG
@@ -789,6 +791,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
             mpDoc->set(IDocumentSettingAccess::TAB_OVER_MARGIN, bTmp);
         }
         break;
+        case HANDLE_SURROUND_TEXT_WRAP_SMALL:
+        {
+            sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+            mpDoc->set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, bTmp);
+        }
+        break;
         default:
             throw UnknownPropertyException();
     }
@@ -1203,6 +1211,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
             rValue.setValue( &bTmp, ::getBooleanCppuType() );
         }
         break;
+        case HANDLE_SURROUND_TEXT_WRAP_SMALL:
+        {
+            sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL );
+            rValue.setValue( &bTmp, ::getBooleanCppuType() );
+        }
+        break;
         default:
             throw UnknownPropertyException();
     }
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 5ac4b05..46ceef3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -100,6 +100,9 @@ LoggedStream(dmapper_logger, "DomainMapper"),
     m_pImpl->SetDocumentSettingsProperty(
         PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_TABS_RELATIVE_TO_INDENT ),
         uno::makeAny( false ) );
+    m_pImpl->SetDocumentSettingsProperty(
+        PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_SURROUND_TEXT_WRAP_SMALL ),
+        uno::makeAny( true ) );
 
     //import document properties
     try
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 46a316c..1c8f129 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -325,6 +325,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
             case PROP_GRAPHIC_URL: sName = "GraphicURL"; break;
             case PROP_GRAPHIC_BITMAP: sName = "GraphicBitmap"; break;
             case PROP_LABEL_CATEGORY: sName = "LabelCategory"; break;
+            case PROP_SURROUND_TEXT_WRAP_SMALL: sName = "SurroundTextWrapSmall"; break;
         }
         ::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt =
                 m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 92d3928d..c4ba7f55 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -296,6 +296,7 @@ enum PropertyIds
         ,PROP_IS_WIDTH_RELATIVE
         ,PROP_GRAPHIC_URL
         ,PROP_GRAPHIC_BITMAP
+        ,PROP_SURROUND_TEXT_WRAP_SMALL
     };
 struct PropertyNameSupplier_Impl;
 class PropertyNameSupplier
commit e5f7049bd713d1386a3cae3e603102e7fbaba020
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jul 26 16:50:07 2013 +0200

    fdo#66474 DOCX import: fix handling of mixed fixed/auto cell widths
    
    Instead of checking if any cells have fixed width, check if all calls
    have fixed with.  Regression from
    74c5ed19f430327988194cdcd6bdff09591a93fa.
    
    (cherry picked from commit 67163f5531c29ff1983661ba832bd205944b33f3)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: I58d3d16cbaa2c54a8a1ac309910336c72dcb39b7

diff --git a/sw/qa/extras/ooxmlimport/data/fdo66474.docx b/sw/qa/extras/ooxmlimport/data/fdo66474.docx
new file mode 100755
index 0000000..0252746
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo66474.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bbf1d3e..ef14f15 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -137,6 +137,7 @@ public:
     void testGroupshapeSdt();
     void testBnc779620();
     void testDefaultSectBreakCols();
+    void testFdo66474();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -238,6 +239,7 @@ void Test::run()
         {"groupshape-sdt.docx", &Test::testGroupshapeSdt},
         {"bnc779620.docx", &Test::testBnc779620},
         {"default-sect-break-cols.docx", &Test::testDefaultSectBreakCols},
+        {"fdo66474.docx", &Test::testFdo66474},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1669,6 +1671,15 @@ void Test::testDefaultSectBreakCols()
     CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount());
 }
 
+void Test::testFdo66474()
+{
+    // The table wasn't relative (relative with was 0), so the table didn't
+    // take the full available width, like it would have to.
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index c3f4c5b..d86693a 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -140,20 +140,24 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
                             the final sizing of the table, but then must use the contents of each cell to determine final column widths.
                             (See 17.18.87 of the ISO/IEC 29500-1:2011.)
                             */
-                            bool bFixed = false;
+                            bool bFixed = true;
                             sal_Int32 nRowFixedWidth = 0;
                             if (!m_aCellWidths.empty())
                             {
-                                // Step 1. Check whether any cell has fixed width in the given row of table.
+                                // Step 1. Check whether all cells have fixed widths in the given row of table.
                                 ::std::vector< IntVectorPtr >::iterator itr;
                                 for (itr = m_aCellWidths.begin(); itr != m_aCellWidths.end(); itr ++)
                                 {
                                     IntVectorPtr itrVal = (*itr);
                                     for (std::vector<sal_Int32>::const_iterator aValIter = itrVal->begin(); aValIter != itrVal->end(); ++aValIter)
                                     {
+                                        if (*aValIter == -1)
+                                        {
+                                            bFixed = false;
+                                            break;
+                                        }
                                         // Sum the width of cells to find the total width of given row
                                         nRowFixedWidth += (*aValIter);
-                                        bFixed = true;
                                     }
                                 }
                             }
@@ -368,7 +372,10 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
                     {
                         MeasureHandlerPtr pMeasureHandler(new MeasureHandler());
                         pProperties->resolve(*pMeasureHandler);
-                        getCurrentCellWidths()->push_back(pMeasureHandler->getMeasureValue());
+                        if (sal::static_int_cast<Id>(pMeasureHandler->getUnit()) == NS_ooxml::LN_Value_ST_TblWidth_auto)
+                            getCurrentCellWidths()->push_back(sal_Int32(-1));
+                        else
+                            getCurrentCellWidths()->push_back(pMeasureHandler->getMeasureValue());
                         if (getTableDepthDifference() > 0)
                             m_bPushCurrentWidth = true;
                     }
commit 884ea3678a43adadb065cd00df6b87f0695f8e52
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Jun 26 15:47:54 2013 +0200

    bnc#823675 RTF import: fix import of numbering bullet associated font
    
    There were multiple problems here:
    
    - \f had a special handler for the listlevel destination, \af had not
    - in case of multiple \f or \af, the first one is used for the bullet
      font
    - in case only \af is used for the bullet font, its value should be used
      for \f as well
    
    (cherry picked from commit 55162d7422a3b175c7fe9c175e0dec91b1932b6a)
    
    Conflicts:
    	sw/qa/extras/rtfimport/rtfimport.cxx
    
    Change-Id: I6631504c1aa9f2e0792a3469a5fdce5b7bd49518

diff --git a/sw/qa/extras/rtfimport/data/n823675.rtf b/sw/qa/extras/rtfimport/data/n823675.rtf
new file mode 100644
index 0000000..a8a2bd3
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n823675.rtf
@@ -0,0 +1,27 @@
+{\rtf1
+{\fonttbl
+{\f0\fbidi \froman\fcharset0\fprq2
+Times New Roman;}
+{\f2\fbidi \fmodern\fcharset0\fprq1
+Courier New;}
+{\f3\fbidi \froman\fcharset2\fprq2
+Symbol;}
+{\fdbminor\f31505\fbidi \froman\fcharset136\fprq2
+PMingLiU;}
+}
+{\*\listtable
+{\list\listtemplateid1917372094
+{\listlevel\levelnfc23
+\leveljc0\levelfollow0\levelstartat0
+{\leveltext\'01\u-3913 ?;}
+{\levelnumbers;}
+\loch\af3\hich\af3\dbch\af31505 \fi-360\li720\lin720 }
+\listid1377391170}
+}
+{\*\listoverridetable
+{\listoverride\listid1377391170\listoverridecount0\ls1}
+}
+\pard\plain
+\ls1
+This\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 687baac..7c27a34 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -6,6 +6,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <com/sun/star/awt/FontDescriptor.hpp>
 #include <com/sun/star/document/XFilter.hpp>
 #include <com/sun/star/document/XImporter.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
@@ -161,6 +162,7 @@ public:
     void testFdo68291();
     void testFdo69384();
     void testFdo70221();
+    void testN823675();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -306,6 +308,7 @@ void Test::run()
         {"fdo68291.odt", &Test::testFdo68291},
         {"hello.rtf", &Test::testFdo69384},
         {"fdo70221.rtf", &Test::testFdo70221},
+        {"n823675.rtf", &Test::testN823675},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1488,6 +1491,25 @@ void Test::testFdo70221()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
 }
 
+void Test::testN823675()
+{
+    uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+    uno::Sequence<beans::PropertyValue> aProps;
+    xLevels->getByIndex(0) >>= aProps; // 1st level
+    awt::FontDescriptor aFont;
+
+    for (int i = 0; i < aProps.getLength(); ++i)
+    {
+        const beans::PropertyValue& rProp = aProps[i];
+
+        if (rProp.Name == "BulletFont")
+            aFont = rProp.Value.get<awt::FontDescriptor>();
+    }
+    // This was empty, i.e. no font name was set for the bullet numbering.
+    CPPUNIT_ASSERT_EQUAL(OUString("Symbol"), aFont.Name);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/CppunitTest_writerfilter_rtftok.mk b/writerfilter/CppunitTest_writerfilter_rtftok.mk
index 1043b7a..1369119 100644
--- a/writerfilter/CppunitTest_writerfilter_rtftok.mk
+++ b/writerfilter/CppunitTest_writerfilter_rtftok.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_CppunitTest_use_ure,writerfilter_rtftok))
 
 $(eval $(call gb_CppunitTest_use_components,writerfilter_rtftok,\
 	configmgr/source/configmgr \
+	i18npool/util/i18npool \
 	svtools/util/svt \
 	ucb/source/core/ucb1 \
 	ucb/source/ucp/file/ucpfile1 \
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5e7ea2a..3cb949d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2719,7 +2719,6 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
     // Trivial character sprms.
     switch (nKeyword)
     {
-        case RTF_AF: nSprm = (m_aStates.top().bIsCjk ? NS_sprm::LN_CRgFtc1 : NS_sprm::LN_CRgFtc2); break;
         case RTF_FS: nSprm = NS_sprm::LN_CHps; break;
         case RTF_AFS: nSprm = NS_sprm::LN_CHpsBi; break;
         case RTF_ANIMTEXT: nSprm = NS_sprm::LN_CSfxText; break;
@@ -2850,6 +2849,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
     switch (nKeyword)
     {
         case RTF_F:
+        case RTF_AF:
+            if (nKeyword == RTF_F)
+                nSprm = NS_sprm::LN_CRgFtc0;
+            else
+                nSprm = (m_aStates.top().bIsCjk ? NS_sprm::LN_CRgFtc1 : NS_sprm::LN_CRgFtc2);
             if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE || m_aStates.top().nDestinationState == DESTINATION_FONTENTRY)
             {
                 m_aFontIndexes.push_back(nParam);
@@ -2858,16 +2862,21 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
             else if (m_aStates.top().nDestinationState == DESTINATION_LISTLEVEL)
             {
                 RTFSprms aFontSprms;
-                aFontSprms.set(NS_sprm::LN_CRgFtc0, RTFValue::Pointer_t(new RTFValue(getFontIndex(nParam))));
+                aFontSprms.set(nSprm, RTFValue::Pointer_t(new RTFValue(getFontIndex(nParam))));
+                // In the context of listlevels, \af seems to imply \f.
+                if (nKeyword == RTF_AF)
+                    aFontSprms.set(NS_sprm::LN_CRgFtc0, RTFValue::Pointer_t(new RTFValue(getFontIndex(nParam))));
                 RTFSprms aRunPropsSprms;
                 aRunPropsSprms.set(NS_ooxml::LN_EG_RPrBase_rFonts, RTFValue::Pointer_t(new RTFValue(RTFSprms(), aFontSprms)));
-                m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_rPr, RTFValue::Pointer_t(new RTFValue(RTFSprms(), aRunPropsSprms)));
+                // If there are multiple \f or \af tokens, only handle the first one.
+                if (!m_aStates.top().aTableSprms.find(NS_ooxml::LN_CT_Lvl_rPr))
+                    m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_rPr, RTFValue::Pointer_t(new RTFValue(RTFSprms(), aRunPropsSprms)));
             }
             else
             {
                 int nFontIndex = getFontIndex(nParam);
                 RTFValue::Pointer_t pValue(new RTFValue(nFontIndex));
-                m_aStates.top().aCharacterSprms.set(NS_sprm::LN_CRgFtc0, pValue);
+                m_aStates.top().aCharacterSprms.set(nSprm, pValue);
                 m_aStates.top().nCurrentEncoding = getEncoding(nFontIndex);
             }
             break;
commit fcbb426f2536e86aa4c3281825bc7b9a38ba43ba
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed Jun 19 10:42:47 2013 +0200

    n#820800: docx import of wrap polyon was based on dest size of picture
    
    ... instead of the original size of it.
    
    Change-Id: Ib251206dd092a7c47343caf50bd05a3dfec1af09
    (cherry picked from commit ae6981601b0e9175efaf9849b1279290ea3380f6)

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index a6c6295..ce80724 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1536,8 +1536,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
                 if( aGraphicSize.Width && aGraphicSize.Height &&
                     m_pImpl->mpWrapPolygon.get() != NULL)
                 {
-                    awt::Size aDstSize(m_pImpl->getXSize(), m_pImpl->getYSize());
-                    WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize, aDstSize);
+                    WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize);
                     aContourPolyPolygon <<= pCorrected->getPointSequenceSequence();
                 }
 
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.cxx b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
index 885925d..134c49c 100644
--- a/writerfilter/source/dmapper/WrapPolygonHandler.cxx
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
@@ -104,7 +104,7 @@ WrapPolygon::Pointer_t WrapPolygon::scale(const Fraction & rFractionX, const Fra
     return pResult;
 }
 
-WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize)
+WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSrcSize)
 {
     WrapPolygon::Pointer_t pResult;
 
@@ -119,9 +119,9 @@ WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSr
     Fraction aScaleY(nWrap100Percent, Fraction(nWrap100Percent) - aMove);
     pResult = pResult->scale(aScaleX, aScaleY);
 
-    Fraction aScaleDestX(rDstSize.Width, nWrap100Percent);
-    Fraction aScaleDestY(rDstSize.Height, nWrap100Percent);
-    pResult = pResult->scale(aScaleDestX, aScaleDestY);
+    Fraction aScaleSrcX(rSrcSize.Width, nWrap100Percent);
+    Fraction aScaleSrcY(rSrcSize.Height, nWrap100Percent);
+    pResult = pResult->scale(aScaleSrcX, aScaleSrcY);
 
     return pResult;
 }
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.hxx b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
index c56a524..dca767f 100644
--- a/writerfilter/source/dmapper/WrapPolygonHandler.hxx
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
@@ -55,7 +55,7 @@ public:
 
     WrapPolygon::Pointer_t move(const awt::Point & rMove);
     WrapPolygon::Pointer_t scale(const Fraction & rFractionX, const Fraction & rFractionY);
-    WrapPolygon::Pointer_t correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize);
+    WrapPolygon::Pointer_t correctWordWrapPolygon(const awt::Size & rSrcSize);
     drawing::PointSequenceSequence getPointSequenceSequence() const;
 };
 
commit 360b04c41b7e176eb2c991a72fd6cbfaaa6a29f3
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Jun 18 11:01:20 2013 +0200

    n#820836: dmapper, fixed typos in first page style creation
    
    Change-Id: I80031cab7c0304311bd5acbb3a2ead48e15594bb
    (cherry picked from commit ab653ae64d782e5bd54bd169ab11755dab310553)

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 2de47e9..f6586ce 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1047,9 +1047,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
 
             sal_Int32 nPaperBin = m_nFirstPaperBin >= 0 ? m_nFirstPaperBin : m_nPaperBin >= 0 ? m_nPaperBin : 0;
             if( nPaperBin )
-                xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) );
+                xFirstPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) );
             if( xColumns.is() )
-                xFollowPageStyle->setPropertyValue(
+                xFirstPageStyle->setPropertyValue(
                     rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xColumns ));
         }
 
commit 9c918d4d8d0a47dbf9aa7617d5d0f360835ee0ed
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Thu Jun 13 14:45:48 2013 +0200

    Fixed libcmis handling of related multipart content types
    
    Change-Id: I8468286be1affc635838b5329d2df72b53f5c9de
    (cherry picked from commit 6b10219eefc0d6bd0e871976d6fe781a26020c8b)

diff --git a/libcmis/libcmis-0.3.0.patch b/libcmis/libcmis-0.3.0.patch
index 37644c8..772c828 100644
--- a/libcmis/libcmis-0.3.0.patch
+++ b/libcmis/libcmis-0.3.0.patch
@@ -33,3 +33,17 @@ index 7c2a8e6..e7014cb 100644
              contentLength = it->second->getLongs( ).front( );
          return contentLength;
      }
+diff --git src/libcmis/ws-relatedmultipart.cxx src/libcmis/ws-relatedmultipart.cxx
+index ef91b4d..3a990e7 100644
+--- src/libcmis/ws-relatedmultipart.cxx
++++ src/libcmis/ws-relatedmultipart.cxx
+@@ -93,6 +93,8 @@ RelatedMultipart::RelatedMultipart( const string& body, const string& contentTyp
+             if ( value[0] == '"' && value[value.length() - 1] == '"' )
+                 value = value.substr( 1, value.length( ) - 2 );
+ 
++            name = libcmis::trim( name );
++
+             if ( name == "start" )
+             {
+                 m_startId = value;
+-- 
commit 54a5bfa2ce7896175d37949702813d2c6ae316a2
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Jun 10 14:48:59 2013 +0200

    bnc#802888 SwPageFrm: one more clickable field fix
    
    This is similar to a996678ed30804e16103e1cfdc439c8546e5d3b0. If we have
    both a background object and some clickable field to select, we should
    always prefer the clickable field.
    
    This time, the problem was to click on a clickable field, when the
    cursor was in normal text and we had a full-page background object.
    
    Change-Id: Id25036d8cb2ddf62011c22bfc50844b793b942bd
    (cherry picked from commit 721baad94ee81d9d6281edb93ee45936f6e0e496)

diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index fcaa4af..f26c53d 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -259,13 +259,28 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
             }
         }
 
+        SwCntntNode* pTextNd = aTextPos.nNode.GetNode( ).GetCntntNode( );
+        bool bConsiderBackground = true;
+        // If the text position is a clickable field, then that should have priority.
+        if (pTextNd && pTextNd->IsTxtNode())
+        {
+            SwTxtNode* pTxtNd = pTextNd->GetTxtNode();
+            SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(aTextPos.nContent.GetIndex(), RES_TXTATR_FIELD);
+            if (pTxtAttr)
+            {
+                const SwField* pField = pTxtAttr->GetFld().GetFld();
+                if (pField->IsClickable())
+                    bConsiderBackground = false;
+            }
+        }
+
         // Check objects in the background if nothing else matched
         if ( GetSortedObjs() )
         {
             bBackRet = lcl_GetCrsrOfst_Objects( this, true, &aBackPos, rPoint, pCMS );
         }
 
-        if ( ( bTestBackground && bBackRet ) || !bTextRet )
+        if ( ( bConsiderBackground && bTestBackground && bBackRet ) || !bTextRet )
         {
             bRet = bBackRet;
             (*pPos) = aBackPos;
@@ -281,10 +296,8 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
              * text and brackground object, then we compute the distance between both
              * would-be positions and the click point. The shortest distance wins.
              */
-            SwCntntNode* pTextNd = aTextPos.nNode.GetNode( ).GetCntntNode( );
             double nTextDistance = 0;
             bool bValidTextDistance = false;
-            bool bConsiderBackground = true;
             if ( pTextNd )
             {
                 SwCntntFrm* pTextFrm = pTextNd->getLayoutFrm( getRootFrm( ) );
@@ -331,19 +344,6 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 
                 nTextDistance = lcl_getDistance(aTextRect, rPoint);
                 bValidTextDistance = true;
-
-                // If the text position is a clickable field, then that should have priority.
-                if (pTextNd->IsTxtNode())
-                {
-                    SwTxtNode* pTxtNd = pTextNd->GetTxtNode();
-                    SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(aTextPos.nContent.GetIndex(), RES_TXTATR_FIELD);
-                    if (pTxtAttr)
-                    {
-                        const SwField* pField = pTxtAttr->GetFld().GetFld();
-                        if (pField->IsClickable())
-                            bConsiderBackground = false;
-                    }
-                }
             }
 
             double nBackDistance = 0;


More information about the Libreoffice-commits mailing list