summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2013-05-01 13:05:06 +0200
committerPetr Mladek <pmladek@suse.cz>2013-05-01 13:05:06 +0200
commit93e11e4fb697aaea63c99308f980e4c932bd1efa (patch)
tree1892e49932d8d7b7656ae504113a40e4e39f876f /sw
parenta5b6a379a2d628040db98060c2adfe8f2fac5607 (diff)
parentc6786add5a58268e11aa027c47054344040db1bc (diff)
Merge tag 'libreoffice-4.0.3.2' into suse-4.0
Tag libreoffice-4.0.3.2 Conflicts: basic/qa/cppunit/test_vba.cxx basic/source/runtime/step2.cxx dictionaries helpcontent2 instsetoo_native/util/openoffice.lst libvisio/UnpackedTarball_visio.mk sc/source/ui/vba/vbaapplication.cxx sc/source/ui/vba/vbavalidation.cxx solenv/inc/minor.mk sw/qa/extras/ooxmlimport/ooxmlimport.cxx translations Change-Id: Ic1f06489175f3db92d6bbcebb9732fadc1c61fed
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/IDocumentContentOperations.hxx2
-rw-r--r--sw/inc/doc.hxx3
-rw-r--r--sw/inc/docary.hxx5
-rw-r--r--sw/inc/docufld.hxx4
-rw-r--r--sw/inc/ndtxt.hxx1
-rw-r--r--sw/inc/numrule.hxx7
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo59273.docxbin0 -> 4358 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo60922.docxbin0 -> 4503 bytes
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/n780645.docxbin4001 -> 4014 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx20
-rw-r--r--sw/qa/extras/rtfexport/data/fdo30983.rtf43
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx13
-rw-r--r--sw/qa/extras/rtfimport/data/fdo37716.rtf5
-rw-r--r--sw/qa/extras/rtfimport/data/fdo51916.rtf319
-rw-r--r--sw/qa/extras/rtfimport/data/fdo61193.rtf1
-rw-r--r--sw/qa/extras/rtfimport/data/fdo61909.rtf28
-rw-r--r--sw/qa/extras/rtfimport/data/fdo62288.rtf23
-rw-r--r--sw/qa/extras/rtfimport/data/hello.rtf1
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx74
-rw-r--r--sw/source/core/crsr/crsrsh.cxx12
-rw-r--r--sw/source/core/crsr/findtxt.cxx43
-rw-r--r--sw/source/core/doc/docfld.cxx14
-rw-r--r--sw/source/core/doc/docfmt.cxx54
-rw-r--r--sw/source/core/doc/number.cxx4
-rw-r--r--sw/source/core/docnode/ndtbl.cxx57
-rw-r--r--sw/source/core/fields/docufld.cxx22
-rw-r--r--sw/source/core/fields/reffld.cxx13
-rw-r--r--sw/source/core/text/inftxt.cxx14
-rw-r--r--sw/source/core/txtnode/thints.cxx70
-rw-r--r--sw/source/core/unocore/unoportenum.cxx24
-rw-r--r--sw/source/filter/inc/fltshell.hxx25
-rw-r--r--sw/source/filter/inc/rtf.hxx4
-rw-r--r--sw/source/filter/ww1/fltshell.cxx91
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx3
-rw-r--r--sw/source/filter/ww8/docxexport.cxx5
-rw-r--r--sw/source/filter/ww8/docxexport.hxx2
-rw-r--r--sw/source/filter/ww8/escher.hxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx23
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx3
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx6
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx3
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx46
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx15
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx56
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx24
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx18
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx123
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx16
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx139
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx3
-rw-r--r--sw/source/filter/ww8/ww8par.cxx149
-rw-r--r--sw/source/filter/ww8/ww8par.hxx18
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx57
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx27
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx5
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx5
58 files changed, 1596 insertions, 154 deletions
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index e236102164ab..998bf6f6d349 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -165,7 +165,7 @@
sal_False.
*/
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
- const sal_uInt16 nFlags) = 0;
+ const sal_uInt16 nFlags,bool bExpandCharToPara=false) = 0;
virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
const sal_uInt16 nFlags) = 0;
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index d71ce5295656..ed168699ce83 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -874,8 +874,9 @@ public:
virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*);
virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
+ //Add a para for the char attribute exp...
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
- const SetAttrMode nFlags);
+ const SetAttrMode nFlags,bool bExpandCharToPara=false);
virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
const SetAttrMode nFlags);
virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 7212c067315b..3cf5d086c4e9 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -65,8 +65,11 @@ public:
virtual ~SwGrfFmtColls() {}
};
+/// stupid base class to work around MSVC dllexport mess
+class SAL_DLLPUBLIC_TEMPLATE SwFrmFmts_Base : public std::vector<SwFrmFmt*> {};
+
/// Specific frame formats (frames, DrawObjects).
-class SW_DLLPUBLIC SwFrmFmts : public std::vector<SwFrmFmt*>, public SwFmtsBase
+class SW_DLLPUBLIC SwFrmFmts : public SwFrmFmts_Base, public SwFmtsBase
{
public:
virtual size_t GetFmtCount() const { return size(); }
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 0779b256dd69..35ea4c156154 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -34,6 +34,7 @@ class SwTxtFld;
class SwFrm;
class OutlinerParaObject;
class SwTextAPIObject;
+class SwFmtFld;
enum SwAuthorFormat
{
@@ -530,6 +531,9 @@ public:
const String& rAuthor, const String& rTxt, const String& rInitials, const String& rName, const DateTime& rDate);
~SwPostItField();
+ /// Looks up a field identified by its unique name (used to get the postit field of a comment fieldmark)
+ static const SwFmtFld* GetByName(SwDoc* pDoc, const OUString& rName);
+
virtual String Expand() const;
virtual SwField* Copy() const;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 985e6e81e480..e3cc9d04edd1 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -206,6 +206,7 @@ public:
/// SMARTTAGS
void SetSmartTags( SwWrongList* pNew, bool bDelete = true );
SwWrongList* GetSmartTags();
+ bool TryCharSetExpandToNum(const SfxItemSet& pCharSet);
/// End: Data collected during idle time
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 1fe43ba6eece..6485c0c07867 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -48,7 +48,8 @@ const sal_Unicode cBulletChar = 0x2022; ///< Character for lists.
class SW_DLLPUBLIC SwNumFmt : public SvxNumberFormat, public SwClient
{
SwFmtVertOrient* pVertOrient;
-
+ //For i120928,record the cp info of graphic within bullet
+ sal_Unicode cGrfBulletCP;
SW_DLLPRIVATE void UpdateNumNodes( SwDoc* pDoc );
SW_DLLPRIVATE virtual void NotifyGraphicArrived();
@@ -77,6 +78,10 @@ public:
virtual void SetCharFmtName(const String& rSet);
virtual const String& GetCharFmtName()const;
+ //For i120928,access the cp info of graphic within bullet
+ void SetGrfBulletCP(sal_Unicode cP){cGrfBulletCP = cP;}
+ sal_Unicode GetGrfBulletCP()const {return cGrfBulletCP;}
+
virtual void SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize = 0, const sal_Int16* pOrient = 0);
virtual void SetVertOrient(sal_Int16 eSet);
diff --git a/sw/qa/extras/ooxmlimport/data/fdo59273.docx b/sw/qa/extras/ooxmlimport/data/fdo59273.docx
new file mode 100644
index 000000000000..fcdfd7734411
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo59273.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/data/fdo60922.docx b/sw/qa/extras/ooxmlimport/data/fdo60922.docx
new file mode 100644
index 000000000000..0d1ff2613ecd
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo60922.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/data/n780645.docx b/sw/qa/extras/ooxmlimport/data/n780645.docx
index 12ffa3870130..35ad11f35183 100755
--- a/sw/qa/extras/ooxmlimport/data/n780645.docx
+++ b/sw/qa/extras/ooxmlimport/data/n780645.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 54a14786efd5..29f38899fa32 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -114,6 +114,8 @@ public:
void testFdo53985();
void testFdo59638();
void testFdo61343();
+ void testFdo60922();
+ void testFdo59273();
void testN592908_Frame();
void testN592908_Picture();
@@ -182,6 +184,8 @@ void Test::run()
{"fdo53985.docx", &Test::testFdo53985},
{"fdo59638.docx", &Test::testFdo59638},
{"fdo61343.docx", &Test::testFdo61343},
+ {"fdo60922.docx", &Test::testFdo60922},
+ {"fdo59273.docx", &Test::testFdo59273},
{"n592908-frame.docx", &Test::testN592908_Frame},
{"n592908-picture.docx", &Test::testN592908_Picture},
};
@@ -1136,6 +1140,22 @@ void Test::testFdo61343()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
}
+void Test::testFdo60922()
+{
+ // This was 0, not 100, due to wrong import of w:position w:val="0"
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharEscapementHeight"));
+}
+
+void Test::testFdo59273()
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY);
+ // Was 9997, so the 4th column had ~zero width
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(7498), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[2].Position);
+}
+
void Test::testN592908_Frame()
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/qa/extras/rtfexport/data/fdo30983.rtf b/sw/qa/extras/rtfexport/data/fdo30983.rtf
new file mode 100644
index 000000000000..bd4dd96e1083
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo30983.rtf
@@ -0,0 +1,43 @@
+{\rtf1\ansi\deff4\adeflang1025
+\paperh15840\paperw12240\margl902\margr958\margt1440\margb735\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn902\margrsxn958\margtsxn1440\margbsxn735\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+\absw2380\absh-1244\pvpg\posy465\phpg\posx8437
+{\*\flymaincnt96\flyvert29040\flyhorz30464\flyanchor4\pgndec}
+\s111\sl200\slmult0\ql\widctlpar
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\ltrpar\cf0\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs16\lang1033
+{\dbch\af5\loch\f1\rtlch \ltrch\loch\loch\f5
+5983 Red Pine Blvd}
+\par \s111\sl200\slmult0\ql\widctlpar
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\ltrpar\cf0\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs16\lang1033
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+White Bear Township, MN 55110}
+\par \s110\sl200\slmult0\ql\widctlpar
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\ltrpar\cf0\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs16\lang1033
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+Home 651-426-9645}
+\par \s110\sl200\slmult0\ql\widctlpar
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\ltrpar\cf0\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs16\lang1033
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+Cell 651-245-1843}
+\par \s110\sl200\slmult0\ql\widctlpar
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\ltrpar\cf0\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs16\lang1033
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+E-mail dadsouch@gmail.com}
+\par \pard
+\pard\plain \s123\sl240\slmult0\ql\widctlpar
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\li2160\ri0\lin2160\rin0\fi0\sb0\sa440\ltrpar\cf0\expnd-4\expndtw-20\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs48\lang1033\li-11\ri0\lin-11\rin0\fi0\sb0\sa144
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+M}
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+ichael P. Soucheray}
+\par \pard\plain \s114\sl220\slmult0\ql\widctlpar\tx2160\tqr\tx6480
+{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}
+\aspalpha\li0\ri-360\lin0\rin-360\fi0\sb220\sa40\ltrpar\cf0\dbch\af6\langfe255\dbch\af6\afs20\alang1025\loch\f6\fs20\lang1033\li-11\ri0\lin-11\rin0\fi0\sb0\sa144
+{\dbch\af5\rtlch \ltrch\loch\loch\f5
+Experienced general}
+\par }
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 18ddf1bdf326..0610516b6349 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
#include <unotools/tempfile.hxx>
#include <vcl/svapp.hxx>
@@ -71,6 +72,7 @@ public:
void testFdo53604();
void testFdo52286();
void testFdo61507();
+ void testFdo30983();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -116,6 +118,7 @@ void Test::run()
{"fdo53604.odt", &Test::testFdo53604},
{"fdo52286.odt", &Test::testFdo52286},
{"fdo61507.rtf", &Test::testFdo61507},
+ {"fdo30983.rtf", &Test::testFdo30983},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -488,6 +491,16 @@ void Test::testFdo61507()
CPPUNIT_ASSERT_EQUAL(6, getLength());
}
+void Test::testFdo30983()
+{
+ // These were 'page text area', not 'entire page', i.e. both the horizontal
+ // and vertical positions were incorrect.
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xDraws->getByIndex(0), "HoriOrientRelation"));
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xDraws->getByIndex(0), "VertOrientRelation"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/rtfimport/data/fdo37716.rtf b/sw/qa/extras/rtfimport/data/fdo37716.rtf
new file mode 100644
index 000000000000..489bdb7fcd72
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo37716.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+\pard\plain \pvpg\phpg\posx1143\posy4743\absw9615\absh-2922\dfrmtxtx72\dfrmtxty72\nowrap
+Hello\par
+\pard\plain\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo51916.rtf b/sw/qa/extras/rtfimport/data/fdo51916.rtf
new file mode 100644
index 000000000000..b2359c3fbd8a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo51916.rtf
@@ -0,0 +1,319 @@
+{\rtf1
+{\fonttbl
+{\f0\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\f34\fbidi \froman\fcharset238\fprq2
+{\*\panose 02040503050406030204}
+Cambria Math;}
+{\f37\fbidi \fswiss\fcharset238\fprq2
+{\*\panose 020f0502020204030204}
+Calibri
+{\*\falt Century Gothic}
+;}
+{\f38\fbidi \fswiss\fcharset238\fprq2
+{\*\panose 020b0604030504040204}
+Tahoma;}
+{\flomajor\f31500\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fdbmajor\f31501\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fhimajor\f31502\fbidi \froman\fcharset238\fprq2
+{\*\panose 02040503050406030204}
+Cambria;}
+{\fbimajor\f31503\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\flominor\f31504\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fdbminor\f31505\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fhiminor\f31506\fbidi \fswiss\fcharset238\fprq2
+{\*\panose 020f0502020204030204}
+Calibri
+{\*\falt Century Gothic}
+;}
+{\fbiminor\f31507\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\f297\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\f296\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\f298\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f299\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\f300\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\f301\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\f302\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f303\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\f637\fbidi \froman\fcharset0\fprq2 Cambria Math;}
+{\f636\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}
+{\f638\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}
+{\f639\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
+{\f642\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
+{\f643\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}
+{\f667\fbidi \fswiss\fcharset0\fprq2 Calibri
+{\*\falt Century Gothic}
+;}
+{\f666\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr
+{\*\falt Century Gothic}
+;}
+{\f668\fbidi \fswiss\fcharset161\fprq2 Calibri Greek
+{\*\falt Century Gothic}
+;}
+{\f669\fbidi \fswiss\fcharset162\fprq2 Calibri Tur
+{\*\falt Century Gothic}
+;}
+{\f672\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic
+{\*\falt Century Gothic}
+;}
+{\f673\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese)
+{\*\falt Century Gothic}
+;}
+{\f677\fbidi \fswiss\fcharset0\fprq2 Tahoma;}
+{\f676\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}
+{\f679\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
+{\flomajor\f31510\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fdbmajor\f31520\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fhimajor\f31530\fbidi \froman\fcharset0\fprq2 Cambria;}
+{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}
+{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}
+{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
+{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}
+{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}
+{\fbimajor\f31540\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\flominor\f31550\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fdbminor\f31560\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fhiminor\f31570\fbidi \fswiss\fcharset0\fprq2 Calibri
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese)
+{\*\falt Century Gothic}
+;}
+{\fbiminor\f31580\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
+\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red255\green255\blue255;}
+{\upr
+{\stylesheet
+{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025
+\ltrch\fcs0 \f37\fs22\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 \sqformat \spriority0 Normal;}
+{\*\cs10 \additive \ssemihidden Default Paragraph Font;}
+{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused \sqformat Normal Table;}
+{
+\s15\ql \li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs28\alang1025 \ltrch\fcs0 \f37\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\sbasedon0 \snext15 \sautoupd \styrsid4140469 ????;}
+{\s16\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \f38\fs16\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+\sbasedon0 \snext16 \slink18 \ssemihidden \styrsid4282853 Balloon Text;}
+{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid11798718 Hyperlink;}
+{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
+\sbasedon10 \slink16 \slocked \ssemihidden \styrsid4282853 Balloon Text Char;}
+{\*\cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid11798718 search_color;}
+{
+\s20\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs24\alang1025 \ltrch\fcs0 \f37\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+\sbasedon0 \snext20 \styrsid11798718 Normal (Web);}
+}
+{\*\ud\uc0
+{\stylesheet
+{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0
+\f37\fs22\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 \sqformat \spriority0 Normal;}
+{\*\cs10 \additive \ssemihidden Default Paragraph Font;}
+{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused \sqformat Normal Table;}
+{
+\s15\ql \li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs28\alang1025 \ltrch\fcs0 \f37\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\sbasedon0 \snext15 \sautoupd \styrsid4140469
+{\uc1\u1047 ?\u1085 ?\u1072 ?\u1082 ?}
+;}
+{\s16\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
+\f38\fs16\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \sbasedon0 \snext16 \slink18 \ssemihidden \styrsid4282853 Balloon Text;}
+{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid11798718 Hyperlink;}
+{\*\cs18 \additive
+\rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink16 \slocked \ssemihidden \styrsid4282853 Balloon Text Char;}
+{\*\cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid11798718 search_color;}
+{
+\s20\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs24\alang1025 \ltrch\fcs0 \f37\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+\sbasedon0 \snext20 \styrsid11798718 Normal (Web);}
+}
+}
+}
+\ltrrow\trowd \irow0\irowband0\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
+\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
+\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+{\rtlch\fcs1
+\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1 \ab\af296\afs20 \ltrch\fcs0 \b\f296\fs20\ul\insrsid14318737\charrsid14318737 K}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \trowd \irow10\irowband10\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
+\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1 \ab\ai\af296\afs20 \ltrch\fcs0 \b\i\f296\fs20\insrsid14318737\charrsid14318737 L}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar
+\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \trowd \irow11\irowband11\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
+\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\qc \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb14\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1 \ai\af296\afs20
+\ltrch\fcs0 \i\f296\fs20\insrsid14318737\charrsid14318737 M}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737
+\trowd \irow12\irowband12\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142
+\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20
+\ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\itap2\pararsid8008194
+{\rtlch\fcs1 \ab\ai\af296\afs20 \ltrch\fcs0
+\b\i\f296\fs20\insrsid4282853\charrsid4282853 N}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid4282853\charrsid4282853
+\nestcell
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid4282853
+{\*\nesttableprops\trowd \irow0\irowband0\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth9662\clshdrawnil \cellx9662\nestrow}
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql \li17\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\itap2\pararsid1914047
+{\rtlch\fcs1 \af296\afs20 \ltrch\fcs0 \f296\fs20\insrsid4282853\charrsid4282853 O}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1914047
+\par }
+\pard \ltrpar\qj \li0\ri0\sl129\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2\pararsid8077423
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1914047\charrsid4282853 \nestcell
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid4282853
+{\*\nesttableprops\trowd \irow1\irowband1\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth9662\clshdrawnil \cellx9662\nestrow}
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql \li17\ri0\sb14\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\itap2\pararsid8008194
+{\rtlch\fcs1 \ai\af296\afs20 \ltrch\fcs0 \i\f296\fs20\insrsid4282853\charrsid4282853 P}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid4282853\charrsid4282853 \nestcell
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid4282853
+{\*\nesttableprops\trowd \irow2\irowband2\lastrow \ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth9662\clshdrawnil \cellx9662\nestrow}
+{\nonesttables
+\par }
+\ltrrow}
+\trowd \irow13\irowband13\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil
+\cellx142\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\pard \ltrpar\ql \li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1
+\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid4282853\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \trowd \irow13\irowband13\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
+\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar
+\qc \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0\pararsid1914047
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar
+\ql \li17\ri0\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\pararsid1914047
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \trowd \irow14\irowband14\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
+\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0\pararsid1914047
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\pararsid1914047
+{\rtlch\fcs1 \ab\ai\af296\afs20 \ltrch\fcs0 \b\i\f296\fs20\insrsid14318737\charrsid14318737 Q}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737
+\trowd \irow15\irowband15\lastrow \ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil
+\cellx142\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+{\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid14318737\charrsid14318737
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo61193.rtf b/sw/qa/extras/rtfimport/data/fdo61193.rtf
new file mode 100644
index 000000000000..6618bda8b4ac
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo61193.rtf
@@ -0,0 +1 @@
+{\rtf1\ansi text.{\footnote footnote}}
diff --git a/sw/qa/extras/rtfimport/data/fdo61909.rtf b/sw/qa/extras/rtfimport/data/fdo61909.rtf
new file mode 100644
index 000000000000..e31414a9b655
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo61909.rtf
@@ -0,0 +1,28 @@
+{\rtf1\deff0
+{\fonttbl
+{\f000 Courier New;}
+}
+{\colortbl
+\red000\green000\blue000;
+\red255\green255\blue255;
+\red255\green128\blue000;
+\red255\green255\blue255;
+\red000\green000\blue255;
+\red255\green255\blue255;
+\red128\green128\blue128;
+\red255\green255\blue255;
+\red128\green128\blue128;
+\red255\green255\blue255;
+\red128\green064\blue000;
+\red255\green255\blue255;
+\red000\green000\blue128;
+\red255\green255\blue255;
+\red000\green000\blue000;
+\red255\green255\blue255;
+\red128\green000\blue255;
+\red255\green255\blue255;
+\red000\green000\blue000;
+\red255\green255\blue255;
+}
+\highlight11 #include<iostream.h>\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo62288.rtf b/sw/qa/extras/rtfimport/data/fdo62288.rtf
new file mode 100644
index 000000000000..f5ec592fc1fc
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo62288.rtf
@@ -0,0 +1,23 @@
+{\rtf1
+\paperw11907\paperh16840\margl567\margr567\margt567\margb567
+\sb113\sa113
+{\b\fs22\cf1\kerning1\cgrid0 Objectives}
+{\fs24\kerning1\cgrid0
+\par }
+\trowd \trgaph10\trleft-10 \clvertalt\cltxlrtb \cellx4808\clvertalt\cltxlrtb \cellx5375\clvertalt\cltxlrtb \cellx10194\clvertalt\cltxlrtb \cellx10762\pard \li567\nowidctlpar\intbl\adjustright
+{\cf1\kerning1\cgrid0 One}
+{\fs24\kerning1\cgrid0 \cell }
+\pard \qc\nowidctlpar\intbl\adjustright
+{\cf1\kerning1\cgrid0 [ ]}
+{\fs24\kerning1\cgrid0 \cell }
+\pard \li567\nowidctlpar\intbl\adjustright
+{\cf1\kerning1\cgrid0 Two}
+{
+\fs24\kerning1\cgrid0 \cell }
+\pard \qc\nowidctlpar\intbl\adjustright
+{\cf1\kerning1\cgrid0 [ ]}
+{\fs24\kerning1\cgrid0 \cell }
+\pard \widctlpar\intbl\adjustright
+{\fs24\kerning1\cgrid0 \row }
+\pard\par
+}
diff --git a/sw/qa/extras/rtfimport/data/hello.rtf b/sw/qa/extras/rtfimport/data/hello.rtf
new file mode 100644
index 000000000000..472817d311b9
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/hello.rtf
@@ -0,0 +1 @@
+{\rtf1 Hello world!\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 3d3cbe6827ce..246358eb4c89 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -141,6 +141,11 @@ public:
void testFdo59953();
void testFdo59638();
void testFdo60722();
+ void testFdo61909();
+ void testFdo62288();
+ void testFdo37716();
+ void testFdo51916();
+ void testFdo61193();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -152,6 +157,26 @@ private:
void run();
/// Get page count.
int getPages();
+ /// Copy&paste helper.
+ void paste(OUString aFilename, uno::Reference<text::XTextRange> xTextRange = uno::Reference<text::XTextRange>())
+ {
+ uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.RtfFilter"), uno::UNO_QUERY_THROW);
+ uno::Reference<document::XImporter> xImporter(xFilter, uno::UNO_QUERY_THROW);
+ xImporter->setTargetDocument(mxComponent);
+ uno::Sequence<beans::PropertyValue> aDescriptor(xTextRange.is() ? 3 : 2);
+ aDescriptor[0].Name = "InputStream";
+ SvStream* pStream = utl::UcbStreamHelper::CreateStream(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + aFilename, STREAM_WRITE);
+ uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream));
+ aDescriptor[0].Value <<= xStream;
+ aDescriptor[1].Name = "IsNewDoc";
+ aDescriptor[1].Value <<= sal_False;
+ if (xTextRange.is())
+ {
+ aDescriptor[2].Name = "TextInsertModeRange";
+ aDescriptor[2].Value <<= xTextRange;
+ }
+ xFilter->filter(aDescriptor);
+ }
};
void Test::run()
@@ -232,6 +257,11 @@ void Test::run()
{"fdo59953.rtf", &Test::testFdo59953},
{"fdo59638.rtf", &Test::testFdo59638},
{"fdo60722.rtf", &Test::testFdo60722},
+ {"fdo61909.rtf", &Test::testFdo61909},
+ {"fdo62288.rtf", &Test::testFdo62288},
+ {"fdo37716.rtf", &Test::testFdo37716},
+ {"fdo51916.rtf", &Test::testFdo51916},
+ {"hello.rtf", &Test::testFdo61193},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -898,6 +928,15 @@ void Test::testCopyPasteFootnote()
CPPUNIT_ASSERT_EQUAL(OUString("bbb"), xTextRange->getString());
}
+void Test::testFdo61193()
+{
+ // Pasting content that contained a footnote caused a crash.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xEnd = xText->getEnd();
+ paste("fdo61193.rtf", xEnd);
+}
+
void Test::testShptxtPard()
{
// The problem was that \pard inside \shptxt caused loss of shape text
@@ -1131,6 +1170,41 @@ void Test::testFdo60722()
CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty<sal_uInt32>(xShape, "LineColor"));
}
+void Test::testFdo61909()
+{
+ uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1);
+ // Was the Writer default font.
+ CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty<OUString>(xTextRange, "CharFontName"));
+ // Was 0x008000.
+ CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(xTextRange, "CharBackColor"));
+}
+
+void Test::testFdo62288()
+{
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY);
+ // Margins were inherited from the previous cell, even there was a \pard there.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaLeftMargin"));
+}
+
+void Test::testFdo37716()
+{
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xFrames(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ // \nowrap got ignored, so Surround was text::WrapTextMode_PARALLEL
+ CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(xFrames->getByIndex(0), "Surround"));
+}
+
+void Test::testFdo51916()
+{
+ // Complex nested table caused a crash.
+}
+
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 379af07d0035..ac00ff73114b 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1859,13 +1859,17 @@ void SwCrsrShell::RefreshBlockCursor()
/// create a copy of the cursor and save it in the stack
void SwCrsrShell::Push()
{
- pCrsrStk = new SwShellCrsr( *this, *pCurCrsr->GetPoint(),
- pCurCrsr->GetPtPos(), pCrsrStk );
+ // fdo#60513: if we have a table cursor, copy that; else copy current.
+ // This seems to work because UpdateCrsr() will fix this up on Pop(),
+ // then MakeBoxSels() will re-create the current pCurCrsr cell ring.
+ SwShellCrsr *const pCurrent((pTblCrsr) ? pTblCrsr : pCurCrsr);
+ pCrsrStk = new SwShellCrsr( *this, *pCurrent->GetPoint(),
+ pCurrent->GetPtPos(), pCrsrStk );
- if( pCurCrsr->HasMark() )
+ if (pCurrent->HasMark())
{
pCrsrStk->SetMark();
- *pCrsrStk->GetMark() = *pCurCrsr->GetMark();
+ *pCrsrStk->GetMark() = *pCurrent->GetMark();
}
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index c1231f9f0630..427c4fab9efe 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -258,7 +258,7 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
{
if( pNode->IsTxtNode() )
{
- nTxtLen = ((SwTxtNode*)pNode)->GetTxt().Len();
+ nTxtLen = static_cast<SwTxtNode*>(pNode)->GetTxt().Len();
if( rNdIdx == pPam->GetMark()->nNode )
nEnd = pPam->GetMark()->nContent.GetIndex();
else
@@ -446,8 +446,9 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
}
xub_StrLen nStringEnd = nEnd;
- while ( (bSrchForward && nStart < nStringEnd) ||
- (! bSrchForward && nStart > nStringEnd) )
+ bool bZeroMatch = false; // zero-length match, i.e. only $ anchor as regex
+ while ( ((bSrchForward && nStart < nStringEnd) ||
+ (! bSrchForward && nStart > nStringEnd)) && !bZeroMatch )
{
// SearchAlgorithms_APPROXIMATE works on a per word base so we have to
// provide the text searcher with the correct locale, because it uses
@@ -475,7 +476,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
}
if( nSearchScript == nCurrScript &&
- (rSTxt.*fnMove->fnSearch)( sCleanStr, &nStart, &nEnd, 0 ))
+ (rSTxt.*fnMove->fnSearch)( sCleanStr, &nStart, &nEnd, 0 ) &&
+ !(bZeroMatch = (nStart == nEnd)))
{
// set section correctly
*GetPoint() = *pPam->GetPoint();
@@ -518,11 +520,14 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
if ( bFound )
return true;
- else if( ( bChkEmptyPara && !nStart && !nTxtLen ) || bChkParaEnd )
+ else if( ( bChkEmptyPara && !nStart && !nTxtLen ) || bChkParaEnd)
{
*GetPoint() = *pPam->GetPoint();
GetPoint()->nContent = bChkParaEnd ? nTxtLen : 0;
SetMark();
+ /* FIXME: this condition does not work for !bSrchForward backward
+ * search, it probably never did. (pSttNd != &rNdIdx.GetNode())
+ * is never true in this case. */
if( (bSrchForward || pSttNd != &rNdIdx.GetNode()) &&
Move( fnMoveForward, fnGoCntnt ) &&
(!bSrchForward || pSttNd != &GetPoint()->nNode.GetNode()) &&
@@ -655,30 +660,14 @@ String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam )
if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( sal_False ) )
{
utl::TextSearch aSTxt( rSearchOpt );
- String aStr( pPam->GetTxt() );
- String aReplaceStr( rSearchOpt.replaceString );
- aStr = comphelper::string::remove(aStr, CH_TXTATR_BREAKWORD);
- aStr = comphelper::string::remove(aStr, CH_TXTATR_INWORD);
- xub_StrLen nStart = 0;
- rtl::OUString sX( 'x' );
- if( pPam->Start()->nContent > 0 )
- {
- aStr.Insert( sX, 0 );
- ++nStart;
- }
- xub_StrLen nEnd = aStr.Len();
- bool bDeleteLastX = false;
- if( pPam->End()->nContent < (static_cast<const SwTxtNode*>(pTxtNode))->GetTxt().Len() )
- {
- aStr.Insert( sX );
- bDeleteLastX = true;
- }
+ const String& rStr = static_cast<const SwTxtNode*>(pTxtNode)->GetTxt();
+ xub_StrLen nStart = pPam->Start()->nContent.GetIndex();
+ xub_StrLen nEnd = pPam->End()->nContent.GetIndex();
SearchResult aResult;
- if( aSTxt.SearchFrwrd( aStr, &nStart, &nEnd, &aResult ) )
+ if( aSTxt.SearchFrwrd( rStr, &nStart, &nEnd, &aResult ) )
{
- if( bDeleteLastX )
- aStr.Erase( aStr.Len() - 1 );
- aSTxt.ReplaceBackReferences( aReplaceStr, aStr, aResult );
+ String aReplaceStr( rSearchOpt.replaceString );
+ aSTxt.ReplaceBackReferences( aReplaceStr, rStr, aResult );
pRet = new String( aReplaceStr );
}
}
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index c2d1dbc063e5..e99954b1dba8 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1304,10 +1304,16 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// This section will be hidden, but it wasn't before
if (nShownSections == 1)
{
- // This would be the last section, so set its condition to false, and avoid hiding it.
- OUString aCond("0");
- pSect->SetCondition(aCond);
- bHide = false;
+ // Is the last node part of a section?
+ SwPaM aPam(GetNodes());
+ aPam.Move(fnMoveForward, fnGoDoc);
+ if (aPam.Start()->nNode.GetNode().StartOfSectionNode()->IsSectionNode())
+ {
+ // This would be the last section, so set its condition to false, and avoid hiding it.
+ OUString aCond("0");
+ pSect->SetCondition(aCond);
+ bHide = false;
+ }
}
nShownSections--;
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 484c93c1aa46..4341aa971824 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -495,7 +495,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
static bool
lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
- const SetAttrMode nFlags, SwUndoAttr *const pUndo)
+ const SetAttrMode nFlags, SwUndoAttr *const pUndo,bool bExpandCharToPara=false)
{
// Divide the Sets (for selections in Nodes)
const SfxItemSet* pCharSet = 0;
@@ -899,6 +899,24 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
// Only selection in a Node.
if( pStt->nNode == pEnd->nNode )
{
+ //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
+ //Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that
+ //current setting attribute set is a character range properties set and comes from a MS word
+ //binary file, And the setting range include a paragraph end position (0X0D);
+ //More specifications, as such property inside the character range properties set recorded in
+ //MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we
+ //only dealing the scenario that the char properties set with 1 item inside;
+
+ if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1 )
+ {
+ SwTxtNode* pCurrentNd = pStt->nNode.GetNode().GetTxtNode();
+
+ if (pCurrentNd)
+ {
+ pCurrentNd->TryCharSetExpandToNum(*pCharSet);
+
+ }
+ }
DELETECHARSETS
return bRet;
}
@@ -1002,13 +1020,41 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
++nNodes;
}
+ //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
+ //Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that
+ //current setting attribute set is a character range properties set and comes from a MS word
+ //binary file, And the setting range include a paragraph end position (0X0D);
+ //More specifications, as such property inside the character range properties set recorded in
+ //MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we
+ //only dealing the scenario that the char properties set with 1 item inside;
+ if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1)
+ {
+ SwPosition aStartPos (*rRg.Start());
+ SwPosition aEndPos (*rRg.End());
+
+ if (aEndPos.nNode.GetNode().GetTxtNode() && aEndPos.nContent != aEndPos.nNode.GetNode().GetTxtNode()->Len())
+ aEndPos.nNode--;
+
+ sal_uLong nStart = aStartPos.nNode.GetIndex();
+ sal_uLong nEnd = aEndPos.nNode.GetIndex();
+ for(; nStart <= nEnd; ++nStart)
+ {
+ SwNode* pNd = pDoc->GetNodes()[ nStart ];
+ if (!pNd || !pNd->IsTxtNode())
+ continue;
+ SwTxtNode *pCurrentNd = (SwTxtNode*)pNd;
+ pCurrentNd->TryCharSetExpandToNum(*pCharSet);
+
+ }
+ }
+
DELETECHARSETS
return (nNodes != 0) || bRet;
}
-
+//Add a para for the char attribute exp...
bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
- const SetAttrMode nFlags )
+ const SetAttrMode nFlags, bool bExpandCharToPara)
{
SwDataChanged aTmp( rRg );
SwUndoAttr* pUndoAttr = 0;
@@ -1020,7 +1066,7 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
SfxItemSet aSet( GetAttrPool(), rHt.Which(), rHt.Which() );
aSet.Put( rHt );
- bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr );
+ bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr,bExpandCharToPara );
if (GetIDocumentUndoRedo().DoesUndo())
{
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 91b822b3de15..839b9bbf49a6 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -178,6 +178,7 @@ SwNumFmt::SwNumFmt() :
SvxNumberFormat(SVX_NUM_ARABIC),
SwClient( 0 ),
pVertOrient(new SwFmtVertOrient( 0, text::VertOrientation::NONE))
+ ,cGrfBulletCP(USHRT_MAX)//For i120928,record the cp info of graphic within bullet
{
}
@@ -185,6 +186,7 @@ SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SvxNumberFormat(rFmt),
SwClient( rFmt.GetRegisteredInNonConst() ),
pVertOrient(new SwFmtVertOrient( 0, rFmt.GetVertOrient()))
+ ,cGrfBulletCP(rFmt.cGrfBulletCP)//For i120928,record the cp info of graphic within bullet
{
sal_Int16 eMyVertOrient = rFmt.GetVertOrient();
SetGraphicBrush( rFmt.GetBrush(), &rFmt.GetGraphicSize(),
@@ -265,6 +267,8 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
rNumFmt.GetRegisteredInNonConst()->Add( this );
else if( GetRegisteredIn() )
GetRegisteredInNonConst()->Remove( this );
+ //For i120928,record the cp info of graphic within bullet
+ cGrfBulletCP = rNumFmt.cGrfBulletCP;
return *this;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 252ac7f87197..df85ebce8a96 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4022,41 +4022,42 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate )
SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE );
- sal_Bool bSetNumFmt = IsInsTblFormatNum(), bLockModify = sal_True;
- if( bSetNumFmt )
+ sal_Bool bLockModify = sal_True;
+ sal_Bool bSetNumFmt = sal_False;
+ const bool bForceNumberFormat = IsInsTblFormatNum() && IsInsTblChangeNumFormat();
+
+ // if the user forced a number format in this cell previously,
+ // keep it, unless the user set that she wants the full number
+ // format recognition
+ if( pNumFmtItem && !bForceNumberFormat )
{
- if( !IsInsTblChangeNumFormat() )
+ sal_uLong nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)->GetValue();
+ SvNumberFormatter* pNumFmtr = GetNumberFormatter();
+
+ short nFmtType = pNumFmtr->GetType( nFmtIdx );
+ if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) || NUMBERFORMAT_NUMBER == nFmtType )
{
- if( !pNumFmtItem )
- bSetNumFmt = sal_False;
- else
- {
- sal_uLong nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)->
- GetValue();
- SvNumberFormatter* pNumFmtr = GetNumberFormatter();
-
- short nFmtType = pNumFmtr->GetType( nFmtIdx );
- if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) ||
- NUMBERFORMAT_NUMBER == nFmtType )
- // Current and specified NumFormat match
- // -> keep old Format
- nFmtIdx = nOldNumFmt;
- else
- // Current and specified NumFormat do not match
- // -> insert as Text
- bLockModify = bSetNumFmt = sal_False;
- }
+ // Current and specified NumFormat match
+ // -> keep old Format
+ nFmtIdx = nOldNumFmt;
+ bSetNumFmt = sal_True;
}
-
- if( bSetNumFmt )
+ else
{
- pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
-
- aBoxSet.Put( SwTblBoxValue( fNumber ));
- aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx ));
+ // Current and specified NumFormat do not match
+ // -> insert as Text
+ bLockModify = bSetNumFmt = sal_False;
}
}
+ if( bSetNumFmt || bForceNumberFormat )
+ {
+ pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
+
+ aBoxSet.Put( SwTblBoxValue( fNumber ));
+ aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx ));
+ }
+
// It's not enough to only reset the Formula.
// Make sure that the Text is formatted accordingly
if( !bSetNumFmt && !bIsEmptyTxtNd && pNumFmtItem )
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index de0d3a841611..ebee25966357 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -92,6 +92,7 @@
#include <editeng/outliner.hxx>
#include <editeng/outlobj.hxx>
#include <switerator.hxx>
+#include <docary.hxx>
#define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS
@@ -1753,6 +1754,27 @@ SwPostItField::~SwPostItField()
}
}
+const SwFmtFld* SwPostItField::GetByName(SwDoc* pDoc, const OUString& rName)
+{
+ const SwFldTypes* pFldTypes = pDoc->GetFldTypes();
+ sal_uInt16 nCount = pFldTypes->size();
+ for (sal_uInt16 nType = 0; nType < nCount; ++nType)
+ {
+ const SwFieldType *pCurType = (*pFldTypes)[nType];
+ SwIterator<SwFmtFld, SwFieldType> aIter(*pCurType);
+ for (const SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next())
+ {
+ // Ignore the field if it's not an annotation or it doesn't have an anchor.
+ if (pCurFldFmt->GetFld()->GetTyp()->Which() != RES_POSTITFLD || !pCurFldFmt->GetTxtFld())
+ continue;
+
+ const SwPostItField* pField = dynamic_cast<const SwPostItField*>(pCurFldFmt->GetFld());
+ if (pField->GetName() == rName)
+ return pCurFldFmt;
+ }
+ }
+ return 0;
+}
String SwPostItField::Expand() const
{
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 806f055e0c95..8285416845b8 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -994,14 +994,9 @@ void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, bool bField )
GetFieldIdsFromDoc( rDestDoc, aIds );
GetFieldIdsFromDoc( rDoc, aDstIds );
- // Define the mappings now
- sal_uInt16 nMaxDstId = -1;
- if ( !aIds.empty() )
- nMaxDstId = *aIds.rbegin();
-
- // Map all the src fields to their value + nMaxDstId
+ // Map all the new src fields to the next available unused id
for ( std::set<sal_uInt16>::iterator pIt = aDstIds.begin(); pIt != aDstIds.end(); ++pIt )
- AddId( ++nMaxDstId, *pIt );
+ AddId( GetFirstUnusedId(aIds), *pIt );
// Change the Sequence number of all the SetExp fields in the destination document
SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
@@ -1024,9 +1019,9 @@ void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, bool bField )
bInit = true;
}
-/// Get the lowest unused ID in the passed set.
+/// Get the lowest number unused in the passed set.
/// @param[in] rIds The set of used ID numbers.
-/// @returns The lowest unused ID.
+/// @returns The lowest number unused by the passed set
sal_uInt16 _RefIdsMap::GetFirstUnusedId( std::set<sal_uInt16> &rIds )
{
sal_uInt16 num(0);
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 2785e92fc61c..42cdbe29aaac 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -66,6 +66,7 @@
#include <cstdio>
// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
+#include <docufld.hxx>
#include <unomid.h>
@@ -1106,17 +1107,14 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
// If this is a comment range, need to look up the color of the comment author.
if (pFieldmark->GetFieldname() == ODF_COMMENTRANGE)
{
- // Search for the position of the postit field
- const sal_Unicode fld[] = { CH_TXTATR_INWORD, 0 };
- xub_StrLen nEndIdx = GetTxt().SearchChar(fld, GetIdx());
- if (nEndIdx != STRING_NOTFOUND)
+ // Search for the postit field
+ const SwFmtFld* pField = SwPostItField::GetByName(pNd->GetDoc(), pFieldmark->GetName());
+ if (pField)
{
- SwTxtAttr* pTxtAttr = pNd->GetTxtAttrForCharAt(nEndIdx, RES_TXTATR_FIELD);
- const SwFmtFld& rPostItField = pTxtAttr->GetFld();
// Look up the author name
- const OUString& rAuthor = rPostItField.GetFld()->GetPar1();
+ const OUString& rAuthor = pField->GetFld()->GetPar1();
sal_uInt16 nIndex = pNd->GetDoc()->InsertRedlineAuthor(rAuthor);
- pOutDev->SetFillColor( SwPostItMgr::GetColorLight(nIndex) );
+ pOutDev->SetFillColor(SwPostItMgr::GetColorLight(nIndex));
bFilled = true;
}
}
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index cf549e3a8758..a2be20b37751 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1607,6 +1607,76 @@ void SwTxtNode::DelSoftHyph( const xub_StrLen nStt, const xub_StrLen nEnd )
}
}
+//In MS Word, the font underline setting of the paragraph end position wont affect the formatting of numbering, so we ignore it
+bool lcl_IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich)
+{
+ return (nWhich == RES_CHRATR_UNDERLINE);
+}
+
+//In MS Word, following properties of the paragraph end position wont affect the formatting of bullets, so we ignore them:
+//Font underline;
+//Font Italic of Western, CJK and CTL;
+//Font Bold of Wertern, CJK and CTL;
+bool lcl_IsIgnoredCharFmtForBullets(const sal_uInt16 nWhich)
+{
+ return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_POSTURE || nWhich == RES_CHRATR_WEIGHT
+ || nWhich == RES_CHRATR_CJK_POSTURE || nWhich == RES_CHRATR_CJK_WEIGHT
+ || nWhich == RES_CHRATR_CTL_POSTURE || nWhich == RES_CHRATR_CTL_WEIGHT);
+}
+
+//Condition for expanding char set to character style of specified number rule level:
+//The item inside the set should not conflict to any exist and non-default item inside paragraph properties set (SwCntntNode::SwPAttrSet);
+//The node should have applied a number rule;
+//The node should be counted in a list, if not, make it to be;
+//The item should not conflict to any exist and non-default item inside the character of specified number rule level;
+//The item should not be ignored depend on the exact number rule type;
+bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet)
+{
+ bool bRet = false;
+ SfxItemIter aIter( aCharSet );
+ const SfxPoolItem* pItem = aIter.FirstItem();
+ const sal_uInt16 nWhich = pItem->Which();
+
+ const SfxPoolItem& rInnerItem = GetAttr(nWhich,false);
+
+ if (!IsDefaultItem(&rInnerItem) && !IsInvalidItem(&rInnerItem))
+ return bRet;
+
+ if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
+ {
+ return bRet;
+ }
+
+ SwNumRule* pCurrNum = GetNumRule(false);
+
+ int nLevel = GetActualListLevel();
+
+ if (nLevel != -1 && pCurrNum)
+ {
+ const SwNumFmt* pCurrNumFmt = pCurrNum->GetNumFmt(static_cast<sal_uInt16>(nLevel));
+ if (pCurrNumFmt)
+ {
+ if (pCurrNumFmt->IsItemize() && lcl_IsIgnoredCharFmtForBullets(nWhich))
+ return bRet;
+ if (pCurrNumFmt->IsEnumeration() && lcl_IsIgnoredCharFmtForNumbering(nWhich))
+ return bRet;
+ SwCharFmt* pCurrCharFmt =pCurrNumFmt->GetCharFmt();
+
+ if (pCurrCharFmt && pCurrCharFmt->GetItemState(nWhich,false) != SFX_ITEM_SET)
+ {
+ pCurrCharFmt->SetFmtAttr(*pItem);
+ SwNumFmt aNewNumFmt(*pCurrNumFmt);
+ aNewNumFmt.SetCharFmt(pCurrCharFmt);
+ pCurrNum->Set(nLevel,aNewNumFmt);
+ bRet = true;
+ }
+ }
+ }
+
+
+ return bRet;
+}
+
// setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 2829d3f6b058..788965a42146 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -320,28 +320,6 @@ lcl_FillFieldMarkArray(FieldMarks_t & rFieldMarks, SwUnoCrsr const & rUnoCrsr,
}
}
-static const SwFmtFld* lcl_getFieldByName(SwDoc* pDoc, const OUString& rName)
-{
- const SwFldTypes* pFldTypes = pDoc->GetFldTypes();
- sal_uInt16 nCount = pFldTypes->size();
- for (sal_uInt16 nType = 0; nType < nCount; ++nType)
- {
- const SwFieldType *pCurType = (*pFldTypes)[nType];
- SwIterator<SwFmtFld, SwFieldType> aIter(*pCurType);
- for (const SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next())
- {
- // Ignore the field if it's not an annotation or it doesn't have an anchor.
- if (pCurFldFmt->GetFld()->GetTyp()->Which() != RES_POSTITFLD || !pCurFldFmt->GetTxtFld())
- continue;
-
- const SwPostItField* pField = dynamic_cast<const SwPostItField*>(pCurFldFmt->GetFld());
- if (pField->GetName() == rName)
- return pCurFldFmt;
- }
- }
- return 0;
-}
-
static uno::Reference<text::XTextRange>
lcl_ExportFieldMark(
uno::Reference< text::XText > const & i_xParentText,
@@ -378,7 +356,7 @@ lcl_ExportFieldMark(
{
pPortion->SetBookmark( SwXFieldmark::CreateXFieldmark( *pDoc, *pFieldmark ) );
Reference<XTextField> xField;
- const SwFmtFld* pField = lcl_getFieldByName(pDoc, pFieldmark->GetName());
+ const SwFmtFld* pField = SwPostItField::GetByName(pDoc, pFieldmark->GetName());
if (pField)
xField = SwXTextField::CreateSwXTextField(*pDoc, *pField);
pPortion->SetTextField(xField);
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 55ea8e4d6c80..e0a64b3ed103 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -111,6 +111,10 @@ public:
sal_Bool bOpen; //Entry open, awaiting being closed
sal_Bool bConsumedByField;
+ sal_Int32 mnStartCP;
+ sal_Int32 mnEndCP;
+ bool bIsParaEnd;
+
SW_DLLPUBLIC SwFltStackEntry(const SwPosition & rStartPos, SfxPoolItem* pHt );
SW_DLLPUBLIC ~SwFltStackEntry();
@@ -118,8 +122,16 @@ public:
SW_DLLPUBLIC void SetEndPos( const SwPosition & rEndPos);
SW_DLLPUBLIC bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck) const;
SW_DLLPUBLIC static bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion,
- bool bCheck, const SwFltPosition &rMkPos, const SwFltPosition &rPtPos,
+ bool bCheck, const SwFltPosition &rMkPos, const SwFltPosition &rPtPos, bool bIsParaEnd=false,
sal_uInt16 nWhich=0);
+
+ void SetStartCP(sal_Int32 nCP) {mnStartCP = nCP;}
+ void SetEndCP(sal_Int32 nCP) {mnEndCP = nCP;}
+ sal_Int32 GetStartCP() const {return mnStartCP;}
+ sal_Int32 GetEndCP() const {return mnEndCP;}
+ bool IsAbleMakeRegion();
+ bool IsParaEnd(){ return bIsParaEnd;}
+ void SetIsParaEnd(bool bArg){ bIsParaEnd = bArg;}
};
class SW_DLLPUBLIC SwFltControlStack : private ::boost::noncopyable
@@ -132,12 +144,23 @@ class SW_DLLPUBLIC SwFltControlStack : private ::boost::noncopyable
sal_uLong nFieldFlags;
KeyCode aEmptyKeyCode; // fuer Bookmarks
+private:
+ bool bHasSdOD;
+ bool bSdODChecked;
+
protected:
SwDoc* pDoc;
sal_Bool bIsEndStack;
void MoveAttrs( const SwPosition& rPos );
virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry& rEntry);
+ virtual sal_Int32 GetCurrAttrCP() const {return -1;}
+ virtual bool IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD=true) const;
+
+ //Clear the para end position recorded in reader intermittently for the least impact on loading performance
+ virtual void ClearParaEndPosition(){};
+ virtual bool CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd);
+ bool HasSdOD();
public:
enum Flags
diff --git a/sw/source/filter/inc/rtf.hxx b/sw/source/filter/inc/rtf.hxx
index f2fc54f7c226..f82780af9e92 100644
--- a/sw/source/filter/inc/rtf.hxx
+++ b/sw/source/filter/inc/rtf.hxx
@@ -27,7 +27,7 @@ class RTFVertOrient
union {
struct {
sal_uInt16 nOrient : 4;
- sal_uInt16 nRelOrient : 1;
+ sal_uInt16 nRelOrient : 4;
} Flags;
sal_uInt16 nVal;
} Value;
@@ -52,7 +52,7 @@ class RTFHoriOrient
struct {
sal_uInt16 nOrient : 4;
sal_uInt16 nRelAnchor : 4;
- sal_uInt16 nRelOrient : 1;
+ sal_uInt16 nRelOrient : 4;
} Flags;
sal_uInt16 nVal;
} Value;
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 2608e62c21f9..9eb936401e23 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -81,6 +81,9 @@ static SwCntntNode* GetCntntNode(SwDoc* pDoc, SwNodeIndex& rIdx, sal_Bool bNext)
SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, SfxPoolItem* pHt)
: m_aMkPos(rStartPos)
, m_aPtPos(rStartPos)
+ , mnStartCP(-1)
+ , mnEndCP(-1)
+ , bIsParaEnd(false)
{
pAttr = pHt; // speicher eine Kopie vom Attribut
bOld = sal_False; // used for marking Attributes *before* skipping field results
@@ -105,22 +108,26 @@ void SwFltStackEntry::SetEndPos(const SwPosition& rEndPos)
m_aPtPos.SetPos(rEndPos);
}
+
bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck,
- const SwFltPosition &rMkPos, const SwFltPosition &rPtPos,
+ const SwFltPosition &rMkPos, const SwFltPosition &rPtPos, bool bIsParaEnd,
sal_uInt16 nWhich)
{
// does this range actually contain something?
// empty range is allowed if at start of empty paragraph
// fields are special: never have range, so leave them
+ //
+ // The only position of 0x0D will not be able to make region in the old logic
+ // because it is beyond the length of para...need special consideration here.
SwCntntNode *const pCntntNode(
SwNodeIndex(rMkPos.m_nNode, +1).GetNode().GetCntntNode());
if (rMkPos == rPtPos &&
((0 != rPtPos.m_nCntnt) || (pCntntNode && (0 != pCntntNode->Len())))
- && (RES_TXTATR_FIELD != nWhich))
+ && (RES_TXTATR_FIELD != nWhich)
+ && !(bIsParaEnd && pCntntNode && pCntntNode->IsTxtNode() && 0 != pCntntNode->Len() ))
{
return false;
}
-
// !!! Die Content-Indizies beziehen sich immer auf den Node !!!
rRegion.GetPoint()->nNode = rMkPos.m_nNode.GetIndex() + 1;
SwCntntNode* pCNd = GetCntntNode(pDoc, rRegion.GetPoint()->nNode, sal_True);
@@ -144,12 +151,12 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck,
bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck) const
{
- return MakeRegion(pDoc, rRegion, bCheck, m_aMkPos, m_aPtPos,
+ return MakeRegion(pDoc, rRegion, bCheck, m_aMkPos, m_aPtPos, bIsParaEnd,
pAttr->Which());
}
SwFltControlStack::SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl)
- : nFieldFlags(nFieldFl), pDoc(pDo), bIsEndStack(false)
+ : nFieldFlags(nFieldFl),bHasSdOD(true), bSdODChecked(false), pDoc(pDo), bIsEndStack(false)
{
}
@@ -238,7 +245,11 @@ void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr
pExtendCandidate->bOpen=true;
}
else
- maEntries.push_back(new SwFltStackEntry(rPos, rAttr.Clone()));
+ {
+ SwFltStackEntry *pTmp = new SwFltStackEntry(rPos, rAttr.Clone() );
+ pTmp->SetStartCP(GetCurrAttrCP());
+ maEntries.push_back(pTmp);
+ }
}
void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
@@ -249,6 +260,14 @@ void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
myEIter aElement = maEntries.begin() + nCnt;
maEntries.erase(aElement);
}
+ //Clear the para end position recorded in reader intermittently for the least impact on loading performance
+ //Because the attributes handled based on the unit of para
+ if ( empty() )
+ {
+ ClearParaEndPosition();
+ bHasSdOD = true;
+ bSdODChecked = false;
+ }
}
// SwFltControlStack::StealAttr() loescht Attribute des angegebenen Typs vom Stack.
@@ -343,6 +362,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
{
rEntry.bConsumedByField = consumedByField;
rEntry.SetEndPos(rPos);
+ rEntry.SetEndCP(GetCurrAttrCP());
if (bLastEntry && nAttrId == rEntry.pAttr->Which())
{
//potential candidate for merging with an identical
@@ -446,6 +466,28 @@ static sal_Bool IterateNumrulePiece( const SwNodeIndex& rEnd,
return rTmpStart <= rTmpEnd; // gueltig ?
}
+//***This function will check whether there is existing individual attribute positon for 0x0D***/
+//The check will happen only once for a paragraph during loading
+bool SwFltControlStack::HasSdOD()
+{
+ bool bRet = false;
+
+ for (Entries::iterator it = maEntries.begin(); it != maEntries.end(); ++it)
+ {
+ SwFltStackEntry& rEntry = *it;
+ if ( rEntry.mnStartCP == rEntry.mnEndCP )
+ {
+ if ( CheckSdOD(rEntry.mnStartCP,rEntry.mnEndCP) )
+ {
+ bRet = true;
+ break;
+ }
+ }
+ }
+
+ return bRet;
+}
+
void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
SwFltStackEntry& rEntry)
{
@@ -628,14 +670,47 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
}
break;
default:
- if (rEntry.MakeRegion(pDoc, aRegion, sal_False))
{
- pDoc->InsertPoolItem(aRegion, *rEntry.pAttr, 0);
+ //Revised for more complex situations should be considered
+ if ( !bSdODChecked )
+ {
+ bHasSdOD = HasSdOD();
+ bSdODChecked = true;
+ }
+ sal_Int32 nStart = rEntry.GetStartCP();
+ sal_Int32 nEnd = rEntry.GetEndCP();
+ if (nStart != -1 && nEnd != -1 && nEnd >= nStart )
+ {
+ rEntry.SetIsParaEnd( IsParaEndInCPs(nStart,nEnd,bHasSdOD) );
+ }
+ if (rEntry.MakeRegion(pDoc, aRegion, sal_False))
+ {
+ nStart = rEntry.GetStartCP();
+ nEnd = rEntry.GetEndCP();
+ if (rEntry.IsParaEnd())
+ {
+ pDoc->InsertPoolItem(aRegion, *rEntry.pAttr, 0, true);
+ }
+ else
+ {
+ pDoc->InsertPoolItem(aRegion, *rEntry.pAttr, 0);
+ }
+ }
}
break;
}
}
+bool SwFltControlStack::IsParaEndInCPs(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/,bool /*bSdOD*/) const
+{
+ return false;
+}
+
+bool SwFltControlStack::CheckSdOD(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/)
+{
+ return false;
+}
+
SfxPoolItem* SwFltControlStack::GetFmtStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos)
{
size_t nSize = maEntries.size();
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 898acbbe640e..982cbef03c64 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -327,7 +327,8 @@ public:
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString ) = 0;
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush = 0) = 0; // #i120928 export graphic of bullet
protected:
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index fb0b39634164..a233f1281e40 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3037,7 +3037,8 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString )
+ const String &rNumberingString,
+ const SvxBrushItem* )
{
m_pSerializer->startElementNS( XML_w, XML_lvl,
FSNS( XML_w, XML_ilvl ), OString::valueOf( sal_Int32( nLevel ) ).getStr(),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index f42ffdf71ee1..ecdc243b9fdb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -265,7 +265,8 @@ public:
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString );
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush = 0 );
void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode );
void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark );
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 59e9bd1f2f59..0cbb453f0fa7 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -152,6 +152,11 @@ void DocxExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ )
m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds );
}
+void DocxExport::ExportGrfBullet(const SwTxtNode&)
+{
+ SAL_INFO("sw.docx", "TODO: " << OSL_THIS_FUNC);
+}
+
::rtl::OString DocxExport::AddRelation( const OUString& rType, const OUString& rTarget )
{
OUString sId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(),
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 56399e68a232..203dbea7e317 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -108,6 +108,8 @@ public:
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+ virtual void ExportGrfBullet(const SwTxtNode&);
+
/// Returns the relationd id
rtl::OString AddRelation( const rtl::OUString& rType, const rtl::OUString& rTarget );
diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index c7761a02af39..4adf3d8a221b 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -116,6 +116,8 @@ protected:
public:
SwBasicEscherEx(SvStream* pStrm, WW8Export& rWrt);
sal_Int32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nShapeId);
+ //For i120928,to export graphic of bullet
+ sal_Int32 WriteGrfBullet(const Graphic&);
sal_Int32 WriteOLEFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nShapeId);
void WriteEmptyFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nShapeId);
virtual void WriteFrmExtraData(const SwFrmFmt&);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 14afa3619218..33032b1905c2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1325,7 +1325,8 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 /*nListTabPos*/,
- const String &rNumberingString )
+ const String &rNumberingString,
+ const SvxBrushItem* /*pBrush*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -2769,7 +2770,15 @@ void RtfAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert
if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax )
{
- m_aRunText->append(OOO_STRING_SVTOOLS_RTF_PVPARA);
+ switch (rFlyVert.GetRelationOrient())
+ {
+ case text::RelOrientation::PAGE_FRAME:
+ m_aRunText->append(OOO_STRING_SVTOOLS_RTF_PVPG);
+ break;
+ default:
+ m_aRunText->append(OOO_STRING_SVTOOLS_RTF_PVPARA);
+ break;
+ }
switch (rFlyVert.GetVertOrient())
{
@@ -2807,7 +2816,15 @@ void RtfAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori
if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax )
{
- m_aRunText->append(OOO_STRING_SVTOOLS_RTF_PHCOL);
+ switch (rFlyHori.GetRelationOrient())
+ {
+ case text::RelOrientation::PAGE_FRAME:
+ m_aRunText->append(OOO_STRING_SVTOOLS_RTF_PHPG);
+ break;
+ default:
+ m_aRunText->append(OOO_STRING_SVTOOLS_RTF_PHCOL);
+ break;
+ }
const char* pS = 0;
switch(rFlyHori.GetHoriOrient())
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 65e493c41d10..c74ab4a1315d 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -202,7 +202,8 @@ public:
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString );
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush = 0);//For i120928,to export graphic of bullet
void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode );
void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds );
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index fc1afec58911..97f9b7304fee 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -167,6 +167,12 @@ void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ )
m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
}
+//For i120928,to export graphic of bullet for RTF filter
+void RtfExport::ExportGrfBullet(const SwTxtNode&)
+{
+ SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
+}
+
void RtfExport::WriteChar( sal_Unicode )
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 30d4c799a03b..cfd45be09cdd 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -73,6 +73,9 @@ public:
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+ //For i120928,add an interface to export graphic of bullet
+ virtual void ExportGrfBullet(const SwTxtNode& rNd);
+
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ }
virtual void WriteChar( sal_Unicode );
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 481b9a866cd7..b540868a3f96 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -49,6 +49,7 @@
#include <fchrfmt.hxx> //SwFmtCharFmt
#include <unotools/streamwrap.hxx>
#include <numrule.hxx>
+#include <vcl/svapp.hxx>//For i120928
using namespace com::sun::star;
using namespace nsSwGetPoolIdFromName;
@@ -149,15 +150,44 @@ namespace
namespace sw
{
+ //For i120928,size conversion before exporting graphic of bullet
+ Frame::Frame(const Graphic &rGrf, const SwPosition &rPos)
+ : mpFlyFrm(NULL)
+ , maPos(rPos)
+ , maSize()
+ , maLayoutSize()
+ , meWriterType(eBulletGrf)
+ , mpStartFrameContent(0)
+ , mbIsInline(true)
+ , mbForBullet(true)
+ , maGrf(rGrf)
+ {
+ const MapMode aMap100mm( MAP_100TH_MM );
+ Size aSize( rGrf.GetPrefSize() );
+ if ( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ {
+ aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap100mm );
+ }
+ else
+ {
+ aSize = OutputDevice::LogicToLogic( aSize,rGrf.GetPrefMapMode(), aMap100mm );
+ }
+ maSize = aSize;
+ maLayoutSize = maSize;
+ }
+
Frame::Frame(const SwFrmFmt &rFmt, const SwPosition &rPos)
- : mpFlyFrm(&rFmt),
- maPos(rPos),
- maSize(),
- maLayoutSize(), // #i43447#
- meWriterType(eTxtBox),
- mpStartFrameContent(0),
- // #i43447# - move to initialization list
- mbIsInline( (rFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR) )
+ : mpFlyFrm(&rFmt)
+ , maPos(rPos)
+ , maSize()
+ , maLayoutSize() // #i43447#
+ , meWriterType(eTxtBox)
+ , mpStartFrameContent(0)
+ // #i43447# - move to initialization list
+ , mbIsInline( (rFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR) )
+ // #i120928# - handle graphic of bullet within existing implementation
+ , mbForBullet(false)
+ , maGrf()
{
switch (rFmt.Which())
{
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index ad8f3a88bab1..f1361a819368 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -95,7 +95,7 @@ namespace sw
class Frame
{
public:
- enum WriterSource {eTxtBox, eGraphic, eOle, eDrawing, eFormControl};
+ enum WriterSource {eTxtBox, eGraphic, eOle, eDrawing, eFormControl,eBulletGrf};//For i120928,add Grf Bul Type
private:
const SwFrmFmt* mpFlyFrm;
SwPosition maPos;
@@ -108,9 +108,11 @@ namespace sw
WriterSource meWriterType;
const SwNode *mpStartFrameContent;
bool mbIsInline;
+ bool mbForBullet:1;
+ Graphic maGrf;
public:
Frame(const SwFrmFmt &rFlyFrm, const SwPosition &rPos);
-
+ Frame(const Graphic&, const SwPosition &);
/** Get the writer SwFrmFmt that this object describes
@return
@@ -164,6 +166,8 @@ namespace sw
the first node of content in the frame, might not be any at all.
*/
const SwNode *GetContent() const { return mpStartFrameContent; }
+ const Graphic &GetGraphic() const { return maGrf; }
+ bool HasGraphic() const { return mbForBullet; }
/** Does this sw::Frame refer to the same writer content as another
@@ -173,7 +177,12 @@ namespace sw
*/
bool RefersToSameFrameAs(const Frame &rOther) const
{
- return (mpFlyFrm == rOther.mpFlyFrm);
+ if (mbForBullet && rOther.mbForBullet)
+ return (maGrf == rOther.maGrf);
+ else if ((!mbForBullet) && (!rOther.mbForBullet))
+ return (mpFlyFrm == rOther.mpFlyFrm);
+ else
+ return false;
}
/** The Size of the contained element
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 6e0ae30c8ac0..3263817c0759 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1329,6 +1329,57 @@ sal_uInt32 AddMirrorFlags(sal_uInt32 nFlags, const SwMirrorGrf &rMirror)
}
return nFlags;
}
+//For i120928,this function is added to export graphic of bullet
+sal_Int32 SwBasicEscherEx::WriteGrfBullet(const Graphic& rGrf)
+{
+ OpenContainer( ESCHER_SpContainer );
+ AddShape(ESCHER_ShpInst_PictureFrame, 0xa00,0x401);
+ EscherPropertyContainer aPropOpt;
+ GraphicObject aGraphicObject( rGrf );
+ OString aUniqueId = aGraphicObject.GetUniqueID();
+ if ( !aUniqueId.isEmpty() )
+ {
+ const MapMode aMap100mm( MAP_100TH_MM );
+ Size aSize( rGrf.GetPrefSize() );
+ if ( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ {
+ aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap100mm );
+ }
+ else
+ {
+ aSize = OutputDevice::LogicToLogic( aSize,rGrf.GetPrefMapMode(), aMap100mm );
+ }
+ Point aEmptyPoint = Point();
+ Rectangle aRect( aEmptyPoint, aSize );
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID( *(mxGlobal->QueryPictureStream()), aUniqueId,aRect, NULL, 0 );
+ if (nBlibId)
+ aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
+ }
+ aPropOpt.AddOpt( ESCHER_Prop_pibFlags, ESCHER_BlipFlagDefault );
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextTop, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextRight, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextTop, 0 );
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, 0 );
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 );
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
+ const Color aTmpColor( COL_WHITE );
+ SvxBrushItem aBrush( aTmpColor, RES_BACKGROUND );
+ const SvxBrushItem *pRet = rWrt.GetCurrentPageBgBrush();
+ if (pRet && (pRet->GetGraphic() ||( pRet->GetColor() != COL_TRANSPARENT)))
+ aBrush = *pRet;
+ WriteBrushAttr(aBrush, aPropOpt);
+
+ aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0 );
+ aPropOpt.Commit( GetStream() );
+ AddAtom(4, ESCHER_ClientAnchor);
+ GetStream() << (sal_uInt32)0x80000000;
+ CloseContainer();
+
+ return 0;
+}
sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nShapeId)
{
@@ -1983,6 +2034,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
WriteOCXControl(rFmt, nShapeId = GenerateShapeId());
break;
case sw::Frame::eDrawing:
+ {
aWinwordAnchoring.SetAnchoring(rFmt);
const SdrObject* pSdrObj = rFmt.FindRealSdrObject();
if (pSdrObj)
@@ -2010,6 +2062,10 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
OSL_ENSURE( !this, "Where is the SDR-Object?" );
#endif
}
+ break;
+ default:
+ break;
+ }
if( !nShapeId )
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 9320e7004ca1..e5b312de5410 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1738,6 +1738,16 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo( mpTableInfo->getTableNodeInfo( &rNode ) );
+ //For i120928,identify the last node
+ bool bLastCR = false;
+ bool bExported = false;
+ {
+ SwNodeIndex aNextIdx(rNode,1);
+ SwNodeIndex aLastIdx(rNode.GetNodes().GetEndOfContent());
+ if (aNextIdx == aLastIdx)
+ bLastCR = true;
+ }
+
AttrOutput().StartParagraph( pTextNodeInfo );
bool bFlyInTable = mpParentFrame && IsInTable();
@@ -1971,6 +1981,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
m_aCurrentCharPropStarts.pop();
AttrOutput().EndTOX( *pTOXSect );
}
+ //For i120928,the position of the bullet's graphic is at end of doc
+ if (bLastCR && (!bExported))
+ {
+ ExportGrfBullet(rNode);
+ bExported = true;
+ }
+
WriteCR( pTextNodeInfoInner );
}
}
@@ -2007,6 +2024,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
aAttrIter.OutFlys( nEnd );
// insert final bookmarks if any before CR and after flys
AppendBookmarks( rNode, nEnd, 1 );
+ WriteCR( pTextNodeInfoInner );
+ // #i120928 - position of the bullet's graphic is at end of doc
+ if (bLastCR && (!bExported))
+ {
+ ExportGrfBullet(rNode);
+ bExported = true;
+ }
if ( pTOXSect )
{
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 68826bab030d..d64c9bc2e325 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -196,7 +196,8 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush //For i120928,to transfer graphic of bullet
)
{
// Start value
@@ -254,6 +255,18 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
}
m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.mbExportModeRTF );
+ //For i120928,achieve graphic's index of bullet from the bullet bookmark
+ if (SVX_NUM_BITMAP == nNumberingType && pBrush)
+ {
+ int nIndex = m_rWW8Export.GetGrfIndex(*pBrush);
+ if ( nIndex != -1 )
+ {
+ m_rWW8Export.InsUInt16(0x6887);
+ m_rWW8Export.InsUInt32(nIndex);
+ m_rWW8Export.InsUInt16(0x4888);
+ m_rWW8Export.InsUInt16(1);
+ }
+ }
m_rWW8Export.pO = pOldpO;
}
@@ -479,7 +492,8 @@ void MSWordExportBase::AbstractNumberingDefinitions()
nFollow,
pPseudoFont, pOutSet,
nIndentAt, nFirstLineIndex, nListTabPos,
- sNumStr );
+ sNumStr,
+ rFmt.GetNumberingType()==SVX_NUM_BITMAP ? rFmt.GetBrush():0);
delete pPseudoFont;
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 7651b40ad06c..269b913bf93e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -108,7 +108,9 @@
#include <rtl/random.h>
#include "WW8Sttbf.hxx"
#include "WW8FibData.hxx"
-
+#ifndef _NUMRULE_HXX
+#include "numrule.hxx"//For i120928
+#endif
using namespace sw::util;
using namespace sw::types;
@@ -1410,6 +1412,125 @@ void WW8Export::AppendBookmark( const rtl::OUString& rName, bool bSkip )
pBkmks->Append( nSttCP, rName );
}
+// #i120928 collect all the graphics of bullets applied to paragraphs
+int WW8Export::CollectGrfsOfBullets() const
+{
+ m_vecBulletPic.clear();
+
+ if ( pDoc )
+ {
+ int nCountRule = pDoc->GetNumRuleTbl().size();
+ for (int n = 0; n < nCountRule; ++n)
+ {
+ const SwNumRule &rRule = *( pDoc->GetNumRuleTbl().at(n) );
+ sal_uInt16 nLevels = rRule.IsContinusNum() ? 1 : 9;
+ for (sal_uInt16 nLvl = 0; nLvl < nLevels; ++nLvl)
+ {
+ const SwNumFmt &rFmt = rRule.Get(nLvl);
+ if (SVX_NUM_BITMAP != rFmt.GetNumberingType())
+ {
+ continue;
+ }
+ const Graphic *pGraf = rFmt.GetBrush()? rFmt.GetBrush()->GetGraphic():0;
+ if ( pGraf )
+ {
+ bool bHas = false;
+ for (unsigned i = 0; i < m_vecBulletPic.size(); ++i)
+ {
+ if (m_vecBulletPic[i]->GetChecksum() == pGraf->GetChecksum())
+ {
+ bHas = true;
+ break;
+ }
+ }
+ if (!bHas)
+ {
+ m_vecBulletPic.push_back(pGraf);
+ }
+ }
+ }
+ }
+ }
+
+ return m_vecBulletPic.size();
+}
+//Export Graphic of Bullets
+void WW8Export::ExportGrfBullet(const SwTxtNode& rNd)
+{
+ int nCount = CollectGrfsOfBullets();
+ if (nCount > 0)
+ {
+ SwPosition aPos(rNd);
+ OUString aPicBullets("_PictureBullets");
+ AppendBookmark(aPicBullets);
+ for (int i = 0; i < nCount; i++)
+ {
+ sw::Frame aFrame(*(m_vecBulletPic[i]), aPos);
+ OutGrfBullets(aFrame);
+ }
+ AppendBookmark(aPicBullets);
+ }
+}
+
+static sal_uInt8 nAttrMagicIdx = 0;
+void WW8Export::OutGrfBullets(const sw::Frame & rFrame)
+{
+ if ( !pGrf || !pChpPlc || !pO )
+ return;
+
+ pGrf->Insert(rFrame);
+ pChpPlc->AppendFkpEntry( Strm().Tell(), pO->size(), pO->data() );
+ pO->clear();
+ //if links...
+ WriteChar( (char)1 );
+
+ sal_uInt8 aArr[ 22 ];
+ sal_uInt8* pArr = aArr;
+
+ // sprmCFSpec
+ if( bWrtWW8 )
+ Set_UInt16( pArr, 0x855 );
+ else
+ Set_UInt8( pArr, 117 );
+ Set_UInt8( pArr, 1 );
+
+ Set_UInt16( pArr, 0x083c );
+ Set_UInt8( pArr, 0x81 );
+
+ // sprmCPicLocation
+ if( bWrtWW8 )
+ Set_UInt16( pArr, 0x6a03 );
+ else
+ {
+ Set_UInt8( pArr, 68 );
+ Set_UInt8( pArr, 4 );
+ }
+ Set_UInt32( pArr, GRF_MAGIC_321 );
+
+ //extern nAttrMagicIdx;
+ --pArr;
+ Set_UInt8( pArr, nAttrMagicIdx++ );
+ pChpPlc->AppendFkpEntry( Strm().Tell(), static_cast< short >(pArr - aArr), aArr );
+}
+//Achieve the index position
+int WW8Export::GetGrfIndex(const SvxBrushItem& rBrush)
+{
+ int nIndex = -1;
+ if ( rBrush.GetGraphic() )
+ {
+ for (unsigned i = 0; i < m_vecBulletPic.size(); ++i)
+ {
+ if (m_vecBulletPic[i]->GetChecksum() == rBrush.GetGraphic()->GetChecksum())
+ {
+ nIndex = i;
+ break;
+ }
+ }
+ }
+
+ return nIndex;
+}
+
void MSWordExportBase::AppendWordBookmark( const String& rName )
{
AppendBookmark( BookmarkToWord( rName ) );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index b405f59ae604..165274023890 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -38,6 +38,9 @@
#include "../inc/msfilter.hxx"
#include <expfld.hxx>
+#include <vcl/graph.hxx>
+class SvxBrushItem;
+
// einige Forward Deklarationen
class SwWW8AttrIter;
namespace msfilter
@@ -644,6 +647,8 @@ public:
virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen ) = 0;
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ) = 0;
+ //For i120928,add this interface to export graphic of bullet
+ virtual void ExportGrfBullet(const SwTxtNode& rNd) = 0;
// FIXME probably a hack...
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t() ) = 0;
@@ -908,6 +913,8 @@ public:
sal_uInt8 bWrtWW8 : 1; ///< Write WW95 (false) or WW97 (true) file format
+ mutable std::vector<const Graphic*> m_vecBulletPic; ///< Vector to record all the graphics of bullets
+
protected:
SwWW8Writer *m_pWriter; ///< Pointer to the writer
WW8AttributeOutput *m_pAttrOutput; ///< Converting attributes to stream data
@@ -1001,6 +1008,12 @@ public:
virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen );
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+
+ virtual void ExportGrfBullet(const SwTxtNode& rNd);
+ int CollectGrfsOfBullets() const;
+ void OutGrfBullets(const sw::Frame &rFrame);
+ int GetGrfIndex(const SvxBrushItem& rBrush);
+
void MoveFieldMarks(sal_uLong nFrom, sal_uLong nTo);
void WriteAsStringTable(const ::std::vector<rtl::OUString>&, sal_Int32& rfcSttbf,
@@ -1336,6 +1349,9 @@ private:
void WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rNd,
const sw::Frame &rFly, sal_uInt16 nWidth, sal_uInt16 nHeight);
+ void WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight);
+ void WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight);
+
//No copying
SwWW8WrGrf(const SwWW8WrGrf&);
SwWW8WrGrf& operator=(const SwWW8WrGrf&);
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 53489364f677..e3facdfea11f 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -717,6 +717,134 @@ void SwWW8WrGrf::WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rGrfNd,
}
}
}
+//For i120928,export graphic info of bullet
+void SwWW8WrGrf::WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf,
+ sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight)
+{
+ sal_Int16 nXSizeAdd = 0, nYSizeAdd = 0;
+ sal_Int16 nCropL = 0, nCropR = 0, nCropT = 0, nCropB = 0;
+
+ Size aGrTwipSz(rGrf.GetPrefSize());
+ bool bWrtWW8 = rWrt.bWrtWW8;
+ sal_uInt16 nHdrLen = bWrtWW8 ? 0x44 : 0x3A;
+
+ sal_uInt8 aArr[ 0x44 ] = { 0 };
+
+ sal_uInt8* pArr = aArr + 0x2E; //Do borders first
+
+ sal_uInt8 aLnArr[4] = { BOX_LINE_TOP, BOX_LINE_LEFT,
+ BOX_LINE_BOTTOM, BOX_LINE_RIGHT };
+ for( sal_uInt8 i = 0; i < 4; ++i )
+ {
+ WW8_BRC aBrc;
+
+ short nSpacing;
+ short nThick = aBrc.DetermineBorderProperties(!bWrtWW8,
+ &nSpacing);
+ switch (aLnArr[ i ])
+ {
+ case BOX_LINE_TOP:
+ case BOX_LINE_BOTTOM:
+ nHeight -= nThick;
+ nHeight = nHeight - nSpacing;
+ break;
+ case BOX_LINE_LEFT:
+ case BOX_LINE_RIGHT:
+ default:
+ nWidth -= nThick;
+ nWidth = nWidth - nSpacing;
+ break;
+ }
+ memcpy( pArr, &aBrc.aBits1, 2);
+ pArr+=2;
+
+ if( bWrtWW8 )
+ {
+ memcpy( pArr, &aBrc.aBits2, 2);
+ pArr+=2;
+ }
+ }
+
+ pArr = aArr + 4; //skip lcb
+ Set_UInt16( pArr, nHdrLen ); // set cbHeader
+
+ Set_UInt16( pArr, mm ); // set mm
+
+ if ( (aGrTwipSz.Width() * 254L / 144 > USHRT_MAX) || (aGrTwipSz.Height() * 254L / 144 > USHRT_MAX)
+ || (aGrTwipSz.Width() < 0 ) || (aGrTwipSz.Height() < 0) )
+ {
+ aGrTwipSz.Width() = nWidth;
+ aGrTwipSz.Height() = nHeight;
+ }
+ using namespace sw::types;
+ // set xExt & yExt
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Width() * 254L / 144));
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Height() * 254L / 144));
+ pArr += 16;
+ // skip hMF & rcWinMF
+ // set dxaGoal & dyaGoal
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Width()));
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Height()));
+
+ if( aGrTwipSz.Width() + nXSizeAdd ) // set mx
+ {
+ double fVal = nWidth * 1000.0 / (aGrTwipSz.Width() + nXSizeAdd);
+ Set_UInt16( pArr, (sal_uInt16)::rtl::math::round(fVal) );
+ }
+ else
+ pArr += 2;
+
+ if( aGrTwipSz.Height() + nYSizeAdd ) // set my
+ {
+ double fVal = nHeight * 1000.0 / (aGrTwipSz.Height() + nYSizeAdd);
+ Set_UInt16( pArr, (sal_uInt16)::rtl::math::round(fVal) );
+ }
+ else
+ pArr += 2;
+
+ Set_UInt16( pArr, nCropL ); // set dxaCropLeft
+ Set_UInt16( pArr, nCropT ); // set dyaCropTop
+ Set_UInt16( pArr, nCropR ); // set dxaCropRight
+ Set_UInt16( pArr, nCropB ); // set dyaCropBottom
+
+ rStrm.Write( aArr, nHdrLen );
+}
+
+void SwWW8WrGrf::WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight)
+{
+ if (rWrt.bWrtWW8)
+ {
+ WritePICBulletFHeader(rStrm,rGrf, 0x64,nWidth,nHeight);
+ SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
+ aInlineEscher.WriteGrfBullet(rGrf);
+ aInlineEscher.WritePictures();
+ }
+ else
+ {
+ GDIMetaFile aMeta;
+ switch (rGrf.GetType())
+ {
+ case GRAPHIC_BITMAP: // Bitmap -> in Metafile abspielen
+ {
+ VirtualDevice aVirt;
+ aMeta.Record(&aVirt);
+ aVirt.DrawBitmap( Point( 0,0 ), rGrf.GetBitmap() );
+ aMeta.Stop();
+ aMeta.WindStart();
+ aMeta.SetPrefMapMode( rGrf.GetPrefMapMode());
+ aMeta.SetPrefSize( rGrf.GetPrefSize());
+ }
+ break;
+ case GRAPHIC_GDIMETAFILE : // GDI ( =SV ) Metafile
+ aMeta = rGrf.GetGDIMetaFile();
+ break;
+ default:
+ return;
+ }
+ WritePICBulletFHeader(rStrm, rGrf, 8, nWidth, nHeight);
+ WriteWindowMetafileBits(rStrm, aMeta);
+ }
+}
void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
{
@@ -736,6 +864,17 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
WriteGrfFromGrfNode(rStrm, *pNd, rItem.maFly, nWidth, nHeight);
}
break;
+ //For i120928,add branch to export graphic of bullet
+ case sw::Frame::eBulletGrf:
+ {
+ if (rItem.maFly.HasGraphic())
+ {
+ const Graphic& rGrf = rItem.maFly.GetGraphic();
+ WriteGrfForBullet(rStrm, rGrf, nWidth, nHeight);
+ }
+ }
+ break;
+
case sw::Frame::eOle:
{
#ifdef OLE_PREVIEW_AS_EMF
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index d1e17bb86a63..edaa905152ae 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -190,7 +190,8 @@ public:
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString );
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush = 0); //For i120928,transfer graphic of bullet
protected:
/// Output frames - the implementation.
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d18106e20db8..26cfd3e8bfc1 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -34,6 +34,7 @@
#include <comphelper/docpasswordrequest.hxx>
#include <comphelper/string.hxx>
+#include <editeng/brshitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/langitem.hxx>
@@ -85,6 +86,11 @@
#include "writerwordglue.hxx"
+#include "ndgrf.hxx"
+#include <editeng/editids.hrc>
+#include <txtflcnt.hxx>
+#include <fmtflcnt.hxx>
+#include <txatbase.hxx>
#include "ww8par2.hxx" // class WW8RStyle, class WW8AnchorPara
@@ -1015,6 +1021,30 @@ const SwNumFmt* SwWW8FltControlStack::GetNumFmtFromStack(const SwPosition &rPos,
return pRet;
}
+sal_Int32 SwWW8FltControlStack::GetCurrAttrCP() const
+{
+ return rReader.GetCurrAttrCP();
+}
+
+bool SwWW8FltControlStack::IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD) const
+{
+ return rReader.IsParaEndInCPs(nStart,nEnd,bSdOD);
+}
+
+//Clear the para end position recorded in reader intermittently for the least impact on loading performance
+void SwWW8FltControlStack::ClearParaEndPosition()
+{
+ if ( !empty() )
+ return;
+
+ rReader.ClearParaEndPosition();
+}
+
+bool SwWW8FltControlStack::CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd)
+{
+ return rReader.IsParaEndInCPs(nStart,nEnd);
+}
+
void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
SwFltStackEntry& rEntry)
{
@@ -3344,6 +3374,34 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTxtPos, bool& rbStartLine)
return nNext;
}
+//Revised 2012.8.16 for the complex attribute presentation of 0x0D in MS
+bool SwWW8ImplReader::IsParaEndInCPs(sal_Int32 nStart, sal_Int32 nEnd,bool bSdOD) const
+{
+ //Revised for performance consideration
+ if (nStart == -1 || nEnd == -1 || nEnd < nStart )
+ return false;
+
+ for (cp_vector::const_reverse_iterator aItr = maEndParaPos.rbegin(); aItr!= maEndParaPos.rend(); aItr++)
+ {
+ //Revised 2012.8.16,to the 0x0D,the attribute will have two situations
+ //*********within***********exact******//
+ //*********but also sample with only left and the position of 0x0d is the edge of the right side***********//
+ if ( bSdOD && ( (nStart < *aItr && nEnd > *aItr) || ( nStart == nEnd && *aItr == nStart)) )
+ return true;
+ else if ( !bSdOD && (nStart < *aItr && nEnd >= *aItr) )
+ return true;
+ }
+
+ return false;
+}
+
+//Clear the para end position recorded in reader intermittently for the least impact on loading performance
+void SwWW8ImplReader::ClearParaEndPosition()
+{
+ if ( maEndParaPos.size() > 0 )
+ maEndParaPos.clear();
+}
+
void SwWW8ImplReader::ReadAttrs(WW8_CP& rNext, WW8_CP& rTxtPos, bool& rbStartLine)
{
if( rTxtPos >= rNext )
@@ -3351,6 +3409,7 @@ void SwWW8ImplReader::ReadAttrs(WW8_CP& rNext, WW8_CP& rTxtPos, bool& rbStartLin
do
{
+ maCurrAttrCP = rTxtPos;
rNext = ReadTextAttr( rTxtPos, rbStartLine );
}
while( rTxtPos >= rNext );
@@ -3434,7 +3493,12 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
// create a new txtnode and join the two paragraphs together
if (bStartLine && !pPreviousNode) // Zeilenende
+ {
+ //We will record the CP of a paragraph end ('0x0D'), if current loading contents is from main stream;
+ if (mbOnLoadingMain)
+ maEndParaPos.push_back(l-1);
AppendTxtNode(*pPaM->GetPoint());
+ }
if (pPreviousNode && bStartLine)
{
@@ -3593,7 +3657,9 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage,
nDropCap(0),
nIdctHint(0),
bBidi(false),
- bReadTable(false)
+ bReadTable(false),
+ maCurrAttrCP(-1),
+ mbOnLoadingMain(false)
{
pStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
nWantedVersion = nVersionPara;
@@ -4599,7 +4665,9 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
StoreMacroCmds();
}
+ mbOnLoadingMain = true;
ReadText(0, pWwFib->ccpText, MAN_MAINTEXT);
+ mbOnLoadingMain = false;
}
@@ -4688,7 +4756,6 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
GrafikDtor();
DELETEZ( pMSDffManager );
DELETEZ( pHdFt );
- DELETEZ( pLstManager );
DELETEZ( pSBase );
delete pWDop;
DELETEZ( pFonts );
@@ -4704,6 +4771,84 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
delete mpRedlineStack;
DeleteAnchorStk();
DeleteRefStks();
+ //For i120928,achieve the graphics from the special bookmark with is for graphic bullet
+ {
+ std::vector<const SwGrfNode*> vecBulletGrf;
+ std::vector<SwFrmFmt*> vecFrmFmt;
+
+ IDocumentMarkAccess* const pMarkAccess =
+ rDoc.getIDocumentMarkAccess();
+ if ( pMarkAccess )
+ {
+ IDocumentMarkAccess::const_iterator_t ppBkmk =
+ pMarkAccess->findBookmark( "_PictureBullets" );
+ if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
+ IDocumentMarkAccess::GetType( *(ppBkmk->get()) )
+ == IDocumentMarkAccess::BOOKMARK )
+ {
+ SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode();
+ if ( pTxtNode )
+ {
+ const SwpHints *pHints = pTxtNode->GetpSwpHints();
+ for(int nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos)
+ {
+ const SwTxtAttr *pHt = (*pHints)[nHintPos];
+ xub_StrLen st = *(pHt->GetStart());
+ if(pHt && pHt->Which() == RES_TXTATR_FLYCNT && (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex()))
+ {
+ SwFrmFmt *pFrmFmt = pHt->GetFlyCnt().GetFrmFmt();
+ const SwNodeIndex *pNdIdx = pFrmFmt->GetCntnt().GetCntntIdx();
+ const SwNodes &nos = pNdIdx->GetNodes();
+ const SwGrfNode *pGrf = dynamic_cast<const SwGrfNode*>(nos[pNdIdx->GetIndex() + 1]);
+ if (pGrf)
+ {
+ vecBulletGrf.push_back(pGrf);
+ vecFrmFmt.push_back(pFrmFmt);
+ }
+ }
+ }
+ // update graphic bullet information
+ size_t nCount = pLstManager->GetWW8LSTInfoNum();
+ for (size_t i = 0; i < nCount; ++i)
+ {
+ SwNumRule* pRule = pLstManager->GetNumRule(i);
+ for (int j = 0; j < MAXLEVEL; ++j)
+ {
+ SwNumFmt aNumFmt(pRule->Get(j));
+ sal_Int16 nType = aNumFmt.GetNumberingType();
+ sal_uInt16 nGrfBulletCP = aNumFmt.GetGrfBulletCP();
+ if (nType == SVX_NUM_BITMAP && vecBulletGrf.size() > nGrfBulletCP)
+ {
+ Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf();
+ SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH);
+ Font aFont = numfunc::GetDefBulletFont();
+ int nHeight = aFont.GetHeight() * 12;//20;
+ Size aPrefSize( aGraphic.GetPrefSize());
+ if (aPrefSize.Height() * aPrefSize.Width() != 0 )
+ {
+ int nWidth = (nHeight * aPrefSize.Width()) / aPrefSize.Height();
+ Size aSize(nWidth, nHeight);
+ aNumFmt.SetGraphicBrush(&aBrush, &aSize);
+ }
+ else
+ {
+ aNumFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ aNumFmt.SetBulletChar(0x2190);
+ }
+ pRule->Set( j, aNumFmt );
+ }
+ }
+ }
+ // Remove additional pictures
+ for (sal_uInt16 i = 0; i < vecFrmFmt.size(); ++i)
+ {
+ rDoc.DelLayoutFmt(vecFrmFmt[i]);
+ }
+ }
+ }
+ }
+ DELETEZ( pLstManager );
+ }
//remove extra paragraphs after attribute ctrl
//stacks etc. are destroyed, and before fields
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 31321f763668..485177f55723 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -159,6 +159,8 @@ public:
std::vector<sal_uInt8> &rParaSprms, SwTxtNode *pNode=0);
SwNumRule* CreateNextRule(bool bSimple);
~WW8ListManager();
+ SwNumRule* GetNumRule(size_t i);
+ size_t GetWW8LSTInfoNum() const{return maLSTInfos.size();}
private:
wwSprmParser maSprmParser;
SwWW8ImplReader& rReader;
@@ -330,6 +332,12 @@ protected:
virtual void SetAttrInDoc(const SwPosition& rTmpPos,
SwFltStackEntry& rEntry);
+ virtual sal_Int32 GetCurrAttrCP() const;
+ virtual bool IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD=true) const;
+ //Clear the para end position recorded in reader intermittently for the least impact on loading performance
+ virtual void ClearParaEndPosition();
+ virtual bool CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd);
+
public:
SwWW8FltControlStack(SwDoc* pDo, sal_uLong nFieldFl, SwWW8ImplReader& rReader_ )
: SwFltControlStack( pDo, nFieldFl ), rReader( rReader_ ),
@@ -910,6 +918,8 @@ struct WW8PostProcessAttrsInfo
//-----------------------------------------
// Storage-Reader
//-----------------------------------------
+typedef std::vector<WW8_CP> cp_vector;
+
class SwWW8ImplReader
{
private:
@@ -1208,6 +1218,9 @@ private:
bool bReadTable;
boost::shared_ptr<SwPaM> mpTableEndPaM;
+ cp_vector maEndParaPos;
+ WW8_CP maCurrAttrCP;
+ bool mbOnLoadingMain:1;
//---------------------------------------------
const SprmReadInfo& GetSprmReadInfo(sal_uInt16 nId) const;
@@ -1534,7 +1547,10 @@ public: // eigentlich private, geht aber leider nur public
sal_uInt16 GetToggleBiDiAttrFlags() const;
void SetToggleAttrFlags(sal_uInt16 nFlags);
void SetToggleBiDiAttrFlags(sal_uInt16 nFlags);
-
+ WW8_CP GetCurrAttrCP() const {return maCurrAttrCP;}
+ bool IsParaEndInCPs(sal_Int32 , sal_Int32,bool bSdOD=true) const;
+ //Clear the para end position recorded in reader intermittently for the least impact on loading performance
+ void ClearParaEndPosition();
long Read_Ftn(WW8PLCFManResult* pRes);
sal_uInt16 End_Ftn();
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 90170614cc1f..d8bb2f615e9e 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -503,6 +503,9 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
SvxExtNumType eType; // Writer-Num-Typ
SvxAdjust eAdj; // Ausrichtung (Links/rechts/zent.)
sal_Unicode cBullet(0x2190); // default safe bullet
+
+ sal_Unicode cGrfBulletCP(USHRT_MAX);
+
String sPrefix;
String sPostfix;
WW8LVL aLVL;
@@ -642,12 +645,28 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
//
// 3. ggfs. CHPx einlesen und
//
+ sal_uInt16 nWitchPicIsBullet = USHRT_MAX;
+ bool bIsPicBullet = false;
+
if( aLVL.nLenGrpprlChpx )
{
sal_uInt8 aGrpprlChpx[ 255 ];
memset(&aGrpprlChpx, 0, sizeof( aGrpprlChpx ));
if(aLVL.nLenGrpprlChpx != rSt.Read(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
return false;
+
+ //For i120928,parse the graphic info of bullets
+ sal_uInt8 *pSprmWhichPis = GrpprlHasSprm(0x6887,aGrpprlChpx[0],aLVL.nLenGrpprlChpx);
+ sal_uInt8 *pSprmIsPicBullet = GrpprlHasSprm(0x4888,aGrpprlChpx[0],aLVL.nLenGrpprlChpx);
+ if (pSprmWhichPis)
+ {
+ nWitchPicIsBullet = *pSprmWhichPis;
+ }
+ if (pSprmIsPicBullet)
+ {
+ bIsPicBullet = (*pSprmIsPicBullet) & 0x0001;
+ }
+
// neues ItemSet fuer die Zeichenattribute anlegen
rpItemSet = new SfxItemSet( rDoc.GetAttrPool(), RES_CHRATR_BEGIN,
RES_CHRATR_END - 1 );
@@ -717,6 +736,12 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
case 23:
case 25:
eType = SVX_NUM_CHAR_SPECIAL;
+ //For i120928,type info
+ if (bIsPicBullet)
+ {
+ eType = SVX_NUM_BITMAP;
+ }
+
break;
case 255:
eType = SVX_NUM_NUMBER_NONE;
@@ -790,6 +815,10 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
if (!cBullet) // unsave control code?
cBullet = 0x2190;
}
+ else if (SVX_NUM_BITMAP == eType) //For i120928,position index info of graphic
+ {
+ cGrfBulletCP = nWitchPicIsBullet; // This is a bullet picture ID
+ }
else
{
/*
@@ -860,6 +889,11 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
// Don't forget: unten, nach dem Bauen eventueller Styles auch noch
// SetBulletFont() rufen !!!
}
+ //For i120928,position index info
+ else if (SVX_NUM_BITMAP == eType)
+ {
+ rNumFmt.SetGrfBulletCP(cGrfBulletCP);
+ }
else
{
// reminder: Garnix ist default Prefix
@@ -995,6 +1029,21 @@ void WW8ListManager::AdjustLVL( sal_uInt8 nLevel, SwNumRule& rNumRule,
//
aNumFmt.SetCharFmt( pFmt );
}
+ //Ensure the default char fmt is initialized for any level of num ruler if no customized attr
+ else
+ {
+ SwCharFmt* pFmt = aNumFmt.GetCharFmt();
+ if ( !pFmt)
+ {
+ OUString aName = ( sPrefix.Len() ? sPrefix : rNumRule.GetName() );
+ aName += "z" + OUString::valueOf( nLevel );
+
+ pFmt = rDoc.MakeCharFmt(aName, (SwCharFmt*)rDoc.GetDfltCharFmt());
+ bNewCharFmtCreated = true;
+ rCharFmt[ nLevel ] = pFmt;
+ aNumFmt.SetCharFmt( pFmt );
+ }
+ }
//
// ggfs. Bullet Font an das NumFormat haengen
//
@@ -1038,6 +1087,14 @@ SwNumRule* WW8ListManager::CreateNextRule(bool bSimple)
return pMyNumRule;
}
+SwNumRule* WW8ListManager::GetNumRule(size_t i)
+{
+ if (i < maLSTInfos.size())
+ return maLSTInfos[i]->pNumRule;
+ else
+ return 0;
+}
+
// oeffentliche Methoden /////////////////////////////////////////////////////
//
WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 3a2456594e99..7f67fb0b441d 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -90,7 +90,32 @@ using namespace sw::sidebarwindows;
bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b)
{
// sort by anchor position
- return a->GetAnchorPosition() < b->GetAnchorPosition();
+ SwPosition aPosAnchorA = a->GetAnchorPosition();
+ SwPosition aPosAnchorB = b->GetAnchorPosition();
+
+ bool aAnchorAInFooter = false;
+ bool aAnchorBInFooter = false;
+
+ // is the anchor placed in Footnote or the Footer?
+ if( aPosAnchorA.nNode.GetNode().FindFootnoteStartNode() || aPosAnchorA.nNode.GetNode().FindFooterStartNode() )
+ aAnchorAInFooter = true;
+ if( aPosAnchorB.nNode.GetNode().FindFootnoteStartNode() || aPosAnchorB.nNode.GetNode().FindFooterStartNode() )
+ aAnchorBInFooter = true;
+
+ // fdo#34800
+ // if AnchorA is in footnote, and AnchorB isn't
+ // we do not want to change over the position
+ if( aAnchorAInFooter && !aAnchorBInFooter )
+ return false;
+ // if aAnchorA is not placed in a footnote, and aAnchorB is
+ // force a change over
+ else if( !aAnchorAInFooter && aAnchorBInFooter )
+ return true;
+ // If neither or both are in the footer, compare the positions.
+ // Since footnotes are in Inserts section of nodes array and footers
+ // in Autotext section, all footnotes precede any footers so no need
+ // to check that.
+ return aPosAnchorA < aPosAnchorB;
}
SwPostItMgr::SwPostItMgr(SwView* pView)
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index 8ad2c153b502..c0417adb9eff 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -320,6 +320,7 @@ void SwSidebarWin::InitControls()
mpOutliner->SetUpdateMode( sal_True );
Rescale();
+ mpSidebarTxtControl->EnableRTL( sal_False );
mpOutlinerView = new OutlinerView ( mpOutliner, mpSidebarTxtControl );
mpOutlinerView->SetBackgroundColor(COL_TRANSPARENT);
mpOutliner->InsertView(mpOutlinerView );
@@ -327,10 +328,6 @@ void SwSidebarWin::InitControls()
mpOutlinerView->SetAttribs(DefaultItem());
- // TODO: ??
- EEHorizontalTextDirection aDefHoriTextDir = Application::GetSettings().GetLayoutRTL() ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R;
- mpOutliner->SetDefaultHorizontalTextDirection( aDefHoriTextDir );
-
//create Scrollbars
mpVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
mpVScrollbar->EnableNativeWidget(false);
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index c089cfc53482..a923cc26623b 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -270,8 +270,9 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
DelRight();
// eingefuegte Grafik in eigenen Absatz, falls am Ende
// eines nichtleeren Absatzes
- if ( IsEndPara() && !IsSttPara() )
- SwFEShell::SplitNode();
+ //For i120928,avoid to split node
+ //if ( IsEndPara() && !IsSttPara() )
+ // SwFEShell::SplitNode();
EnterSelFrmMode();