summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-03-14 10:01:15 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-03-14 10:01:15 +0100
commit218937a8bcf82d69a56fedd872ef774c89c444d0 (patch)
treeb499544a19893710dfc5f39cb36c25eda9201412
parentAutomated merge with file:///d:\tools\master\ooo (diff)
parentCWS-TOOLING: integrate CWS os146 (diff)
downloadcore-218937a8bcf82d69a56fedd872ef774c89c444d0.tar.gz
core-218937a8bcf82d69a56fedd872ef774c89c444d0.zip
dba34d: pulled and merged DEV300.m102
-rwxr-xr-xsw/JunitTest_sw_complex.mk13
-rwxr-xr-xsw/inc/fmtmeta.hxx25
-rw-r--r--sw/inc/ndhints.hxx10
-rw-r--r--sw/inc/swtypes.hxx2
-rw-r--r--sw/inc/txtatr.hxx21
-rw-r--r--sw/inc/txtrfmrk.hxx2
-rw-r--r--sw/inc/txttxmrk.hxx3
-rw-r--r--sw/inc/unotext.hxx12
-rw-r--r--sw/qa/complex/accessibility/makefile.mk50
-rw-r--r--sw/qa/complex/checkColor/makefile.mk50
-rw-r--r--sw/qa/complex/writer/TestDocument.java3
-rw-r--r--sw/qa/unoapi/makefile.mk48
-rwxr-xr-x[-rw-r--r--]sw/source/core/crsr/swcrsr.cxx11
-rw-r--r--sw/source/core/doc/doclay.cxx18
-rwxr-xr-x[-rw-r--r--]sw/source/core/doc/tblafmt.cxx4
-rwxr-xr-x[-rw-r--r--]sw/source/core/edit/acorrect.cxx20
-rw-r--r--sw/source/core/edit/autofmt.cxx3
-rwxr-xr-x[-rw-r--r--]sw/source/core/inc/acorrect.hxx1
-rw-r--r--sw/source/core/text/txttab.cxx112
-rw-r--r--sw/source/core/txtnode/atrref.cxx2
-rw-r--r--sw/source/core/txtnode/atrtox.cxx2
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx85
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx26
-rw-r--r--sw/source/core/txtnode/thints.cxx9
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx18
-rwxr-xr-x[-rw-r--r--]sw/source/core/txtnode/txtedt.cxx10
-rw-r--r--sw/source/core/unocore/unorefmk.cxx2
-rw-r--r--sw/source/core/unocore/unotext.cxx55
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.cxx17
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.hxx2
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/wrtw8nds.cxx24
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx1
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx1
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx5
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx52
-rw-r--r--sw/source/ui/app/apphdl.cxx23
-rw-r--r--sw/source/ui/app/swmodul1.cxx7
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/index/cnttab.src4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/lingu/hhcwrp.cxx10
-rwxr-xr-x[-rw-r--r--]sw/source/ui/shells/textsh.cxx8
-rw-r--r--sw/source/ui/table/tabledlg.cxx10
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxdoc.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxvw.cxx2
-rw-r--r--sw/source/ui/utlui/navipi.cxx4
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx6
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/sglobal/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/sweb/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swform/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swreport/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swriter/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swxform/menubar/menubar.xml2
53 files changed, 560 insertions, 251 deletions
diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 4eb0dc405264..df81b22f712d 100755
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -27,6 +27,11 @@
$(eval $(call gb_JunitTest_JunitTest,sw_complex))
+$(eval $(call gb_JunitTest_set_defs,sw_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/sw/qa/complex/writer/testdocuments \
+))
+
$(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
sw/qa/complex/checkColor/CheckChangeColor \
sw/qa/complex/indeterminateState/CheckIndeterminateState \
@@ -52,6 +57,14 @@ $(eval $(call gb_JunitTest_add_jars,sw_complex,\
$(eval $(call gb_JunitTest_add_classes,sw_complex,\
complex.accessibility.AccessibleRelationSet \
complex.checkColor.CheckChangeColor \
+ complex.writer.CheckCrossReferences \
+ complex.writer.CheckFlies \
+ complex.writer.CheckIndexedPropertyValues \
+ complex.writer.CheckNamedPropertyValues \
+ complex.writer.TextPortionEnumerationTest \
))
+# currently fails (should run again in os146) (except on windows)
+# complex.writer.CheckBookmarks \
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index b486434d19df..922bf1cbf881 100755
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -74,17 +74,13 @@ namespace com { namespace sun { namespace star {
* <li>The pool item is cloned (because it is non-poolable); the clone
* points to the same metadatable entity, but the metadatable entity's
* reverse pointer is unchanged.</li>
- * <li>A new text hint is created, taking over the new pool item.
- * Unfortunately, this also makes the metadatable entity point at the
- * cloned pool item.</li>
- * <li>The text hint is inserted into the hints array of some text node.</li>
- * <li>The DoCopy() method must be called at the new pool item:
- * it will clone the metadatable entity (using RegisterAsCopyOf),
- * and fix the reverse pointer of the original to point at the
- * original pool item.
+ * <li>The DoCopy() method is called at the new pool item:
+ * it will clone the metadatable entity (using RegisterAsCopyOf).
* This is necessary, because first, a metadatable entity may
* only be inserted once into a document, and second, the copy may be
* inserted into a different document than the source document!</li>
+ * <li>A new text hint is created, taking over the new pool item.</li>
+ * <li>The text hint is inserted into the hints array of some text node.</li>
* </ol>
*/
@@ -99,7 +95,7 @@ class SwFmtMeta
: public SfxPoolItem
{
private:
- friend class SwTxtMeta; // needs SetTxtAttr
+ friend class SwTxtMeta; // needs SetTxtAttr, DoCopy
friend class ::sw::Meta; // needs m_pTxtAttr
::boost::shared_ptr< ::sw::Meta > m_pMeta;
@@ -108,6 +104,10 @@ private:
SwTxtMeta * GetTxtAttr() { return m_pTxtAttr; }
void SetTxtAttr(SwTxtMeta * const i_pTxtAttr);
+ /// this method <em>must</em> be called when the hint is actually copied
+ void DoCopy(::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode & i_rTargetTxtNode);
+
explicit SwFmtMeta( const sal_uInt16 i_nWhich );
public:
@@ -119,14 +119,11 @@ public:
// SfxPoolItem
virtual int operator==( const SfxPoolItem & ) const;
virtual SfxPoolItem * Clone( SfxItemPool *pPool = 0 ) const;
-// TYPEINFO();
/// notify clients registered at m_pMeta that this meta is being (re-)moved
void NotifyChangeTxtNode(SwTxtNode *const pTxtNode);
static SwFmtMeta * CreatePoolDefault( const sal_uInt16 i_nWhich );
::sw::Meta * GetMeta() { return m_pMeta.get(); }
- /// this method <em>must</em> be called when the hint is actually copied
- void DoCopy( SwFmtMeta & rOriginalMeta );
};
@@ -146,6 +143,7 @@ protected:
::com::sun::star::rdf::XMetadatable> m_wXMeta;
SwFmtMeta * m_pFmt;
+ SwTxtNode * m_pTxtNode;
SwTxtMeta * GetTxtAttr() const;
SwTxtNode * GetTxtNode() const; // returns 0 if not in document (undo)
@@ -153,7 +151,8 @@ protected:
SwFmtMeta * GetFmtMeta() const { return m_pFmt; }
void SetFmtMeta( SwFmtMeta * const i_pFmt ) { m_pFmt = i_pFmt; };
- void NotifyChangeTxtNode();
+ void NotifyChangeTxtNodeImpl();
+ void NotifyChangeTxtNode(SwTxtNode *const pTxtNode);
::com::sun::star::uno::WeakReference<
::com::sun::star::rdf::XMetadatable> const& GetXMeta() const
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index f24dce137463..d549368d90f2 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -33,7 +33,6 @@
#include "swtypes.hxx"
-//#include "numrule.hxx"
class SwTxtNode;
class SwRegHistory; // steht im RolBck.hxx
@@ -44,9 +43,16 @@ class SfxPoolItem;
class SfxItemSet;
class SwDoc;
+typedef enum {
+ COPY = true,
+ NEW = false,
+} CopyOrNew_t;
+
+// if COPY then pTxtNode must be given!
SW_DLLPRIVATE SwTxtAttr *
MakeTxtAttr( SwDoc & rDoc, SfxPoolItem & rNew,
- xub_StrLen nStt, xub_StrLen nEnd );
+ xub_StrLen const nStt, xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy = NEW, SwTxtNode *const pTxtNode = 0);
SW_DLLPRIVATE SwTxtAttr *
MakeTxtAttr( SwDoc & rDoc, const SfxItemSet & rSet,
xub_StrLen nStt, xub_StrLen nEnd );
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 1f417052638d..f09494d3d454 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -228,6 +228,8 @@ namespace nsSetAttrMode
// functionality will be disabled)
/// force hint expand (only matters for hints with CH_TXTATR)
const SetAttrMode SETATTR_FORCEHINTEXPAND= 0x0080;
+ /// the inserted item is a copy -- intended for use in ndtxt.cxx
+ const SetAttrMode SETATTR_IS_COPY = 0x0100;
}
//Umrechnung Twip<-> 1/100 mm fuer UNO
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index f074a8696fdf..a8b4fbb2211f 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -34,6 +34,11 @@
class SwTxtNode; // fuer SwTxtFld
class SwCharFmt;
+namespace sw {
+ class MetaFieldManager;
+}
+
+
// ATT_CHARFMT *********************************************
class SwTxtCharFmt : public SwTxtAttrEnd
@@ -61,7 +66,7 @@ public:
class SwTxtAttrNesting : public SwTxtAttrEnd
{
-public:
+protected:
SwTxtAttrNesting( SfxPoolItem & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
virtual ~SwTxtAttrNesting();
@@ -70,16 +75,20 @@ public:
class SwTxtMeta : public SwTxtAttrNesting
{
private:
- SwTxtNode * m_pTxtNode;
-
-public:
SwTxtMeta( SwFmtMeta & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
+
+public:
+ static SwTxtMeta * CreateTxtMeta(
+ ::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode *const i_pTargetTxtNode,
+ SwFmtMeta & i_rAttr,
+ xub_StrLen const i_nStart, xub_StrLen const i_nEnd,
+ bool const i_bIsCopy);
+
virtual ~SwTxtMeta();
void ChgTxtNode(SwTxtNode * const pNode);
- SwTxtNode * GetTxtNode() const { return m_pTxtNode; }
-
};
diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx
index 75a5305041f0..d5deb2830eac 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -41,7 +41,7 @@ class SwTxtRefMark : public SwTxtAttrEnd
public:
SwTxtRefMark( SwFmtRefMark& rAttr,
- xub_StrLen nStart, xub_StrLen * pEnd = 0 );
+ xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual xub_StrLen * GetEnd(); // SwTxtAttr
inline const xub_StrLen * GetEnd() const { return m_pEnd; }
diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx
index efa88329c73b..311432d9287b 100644
--- a/sw/inc/txttxmrk.hxx
+++ b/sw/inc/txttxmrk.hxx
@@ -41,7 +41,8 @@ class SwTxtTOXMark : public SwTxtAttrEnd
xub_StrLen * m_pEnd; // 0 if SwTOXMark without AlternativeText
public:
- SwTxtTOXMark( SwTOXMark& rAttr, xub_StrLen nStart, xub_StrLen * pEnd = 0 );
+ SwTxtTOXMark( SwTOXMark& rAttr,
+ xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual ~SwTxtTOXMark();
virtual xub_StrLen *GetEnd(); // SwTxtAttr
diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx
index d6ada94d5396..908c48aac4ac 100644
--- a/sw/inc/unotext.hxx
+++ b/sw/inc/unotext.hxx
@@ -291,6 +291,12 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
+ // XTextCopy
+ virtual void SAL_CALL copyText(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextCopy >& xSource )
+ throw (::com::sun::star::uno::RuntimeException);
+
// XTextRangeCompare
sal_Int16 SAL_CALL compareRegionStarts(
const ::com::sun::star::uno::Reference<
@@ -334,12 +340,6 @@ public:
::com::sun::star::text::XTextContent>& xPredecessor)
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
-
- // XTextCopy
- virtual void SAL_CALL copyText(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextCopy >& xSource )
- throw (::com::sun::star::uno::RuntimeException);
};
#endif // SW_UNOTEXT_HXX
diff --git a/sw/qa/complex/accessibility/makefile.mk b/sw/qa/complex/accessibility/makefile.mk
new file mode 100644
index 000000000000..06e7c6a70408
--- /dev/null
+++ b/sw/qa/complex/accessibility/makefile.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = sw
+TARGET = qa_complex_accessibility
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/accessibility
+JAVATESTFILES = AccessibleRelationSet.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/qa/complex/checkColor/makefile.mk b/sw/qa/complex/checkColor/makefile.mk
new file mode 100644
index 000000000000..e5b368083ada
--- /dev/null
+++ b/sw/qa/complex/checkColor/makefile.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = sw
+TARGET = qa_complex_checkColor
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/checkColor
+JAVATESTFILES = CheckChangeColor.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/qa/complex/writer/TestDocument.java b/sw/qa/complex/writer/TestDocument.java
index 25a11338ae5c..088c9aede3d6 100644
--- a/sw/qa/complex/writer/TestDocument.java
+++ b/sw/qa/complex/writer/TestDocument.java
@@ -29,10 +29,11 @@ package complex.writer;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
+import org.openoffice.test.Argument;
final class TestDocument {
public static String getUrl(String name) {
- return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
+ return OfficeFileUrl.getAbsolute(new File(Argument.get("tdoc"), name));
}
private TestDocument() {}
diff --git a/sw/qa/unoapi/makefile.mk b/sw/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..f5102c2c9c84
--- /dev/null
+++ b/sw/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sw
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sw/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b7106ade751c..63aae63019d3 100644..100755
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -973,7 +973,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
{
// Cursor als Kopie vom akt. und in den Ring aufnehmen
// Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
// wenn schon ausserhalb vom Bodytext, suche von der Position,
// ansonsten beginne mit der 1. GrundSection
@@ -1004,8 +1004,8 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
+ pSav.release();
- delete pSav;
if( !( FND_IN_SELALL & eFndRngs ))
{
// es sollte nur einer gesucht werden, also fuege in dazu
@@ -1031,7 +1031,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else if( FND_IN_SELALL & eFndRngs )
{
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ ::std::auto_ptr< SwCursor> pSav( Create( this ) ); // save the current cursor
const SwNode* pSttNd = ( FND_IN_BODYONLY & eFndRngs )
? rNds.GetEndOfContent().StartOfSectionNode()
@@ -1058,10 +1058,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
- // es wurde ein- bis mehrmals gefunden. Das steht alles
- // im neuen Crsr-Ring. Darum hebe erstmal den alten Ring auf
- delete pSav;
-
+ pSav.release();
while( GetNext() != this )
delete GetNext();
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 98179bd1d8ea..d5e7354df745 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1312,6 +1312,17 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
+ // --> OD #i115719#
+ // <title> and <description> attributes are lost when calling <DelFrms()>.
+ // Thus, keep them and restore them after the calling <MakeFrms()>
+ const bool bIsSwFlyFrmFmtInstance( dynamic_cast<SwFlyFrmFmt*>(pOldFmt) != 0 );
+ const String sTitle( bIsSwFlyFrmFmtInstance
+ ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjTitle()
+ : String() );
+ const String sDescription( bIsSwFlyFrmFmtInstance
+ ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjDescription()
+ : String() );
+ // <--
pOldFmt->DelFrms();
pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
@@ -1449,6 +1460,13 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Nun nur noch die Flys erzeugen lassen. Das ueberlassen
//wir vorhanden Methoden (insb. fuer InCntFlys etwas aufwendig).
pNewFmt->MakeFrms();
+ // --> OD #i115719#
+ if ( bIsSwFlyFrmFmtInstance )
+ {
+ static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjTitle( sTitle );
+ static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjDescription( sDescription );
+ }
+ // <--
}
break;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 647acfe9d9a4..3d4a21584f9a 100644..100755
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -336,7 +336,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
READ( aFont, SvxFontItem , rVersions.nFontVersion)
if( rStream.GetStreamCharSet() == aFont.GetCharSet() )
- aFont.GetCharSet() = ::gsl_getSystemTextEncoding();
+ aFont.SetCharSet(::gsl_getSystemTextEncoding());
READ( aHeight, SvxFontHeightItem , rVersions.nFontHeightVersion)
READ( aWeight, SvxWeightItem , rVersions.nWeightVersion)
@@ -424,7 +424,7 @@ sal_Bool SwBoxAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
READ( aFont, SvxFontItem , 0)
if( rStream.GetStreamCharSet() == aFont.GetCharSet() )
- aFont.GetCharSet() = ::gsl_getSystemTextEncoding();
+ aFont.SetCharSet(::gsl_getSystemTextEncoding());
READ( aHeight, SvxFontHeightItem , 1)
READ( aWeight, SvxWeightItem , 2)
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index dad951e3848a..d018b0731e43 100644..100755
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -157,6 +157,10 @@ sal_Bool SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
+ return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
SwPaM* pPam = &rCrsr;
if( pPam->GetPoint()->nContent.GetIndex() != nPos )
{
@@ -204,14 +208,26 @@ sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
pPam->SetMark();
pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
- xub_StrLen( nPos + rTxt.Len() ));
+ xub_StrLen( nPos + nSourceLength ));
pDoc->ReplaceRange( *pPam, rTxt, false );
pPam->Exchange();
pPam->DeleteMark();
}
}
else
- pDoc->Overwrite( *pPam, rTxt );
+ {
+ if( nSourceLength != rTxt.Len() )
+ {
+ pPam->SetMark();
+ pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
+ xub_StrLen( nPos + nSourceLength ));
+ pDoc->ReplaceRange( *pPam, rTxt, false );
+ pPam->Exchange();
+ pPam->DeleteMark();
+ }
+ else
+ pDoc->Overwrite( *pPam, rTxt );
+ }
// pDoc->SetRedlineMode_intern( eOld );
if( bUndoIdInitialized )
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 828adb14ff10..0f9113445646 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1542,6 +1542,9 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
aFmt.SetBulletFont( pBullFnt );
aFmt.SetBulletChar( cBullChar );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
aFmt.SetFirstLineOffset( lBullFirstLineOffset );
aFmt.SetAbsLSpace( nAbsPos );
if( !aFmt.GetCharFmt() )
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index d52d3a70f4b5..d90b57b13b50 100644..100755
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -68,6 +68,7 @@ public:
virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd );
virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt );
virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt );
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& );
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index a83fe42c265d..9e482a63f4b3 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -84,7 +84,6 @@ sal_uInt16 SwLineInfo::NumberOfTabStops() const
/*************************************************************************
* SwTxtFormatter::NewTabPortion()
*************************************************************************/
-
SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) const
{
SwTabPortion *pTabPor = 0;
@@ -216,63 +215,74 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
cFill = 0;
eAdj = SVX_TAB_ADJUST_LEFT;
}
- // --> OD 2008-02-07 #newlistlevelattrs#
- long nForced = 0;
- if ( !bTabsRelativeToIndent )
+
+ // --> OD #i115705# - correction and refactoring:
+ // overrule determined next tab stop position in order to apply
+ // a tab stop at the left margin under the following conditions:
+ // - the new tab portion is inside the hanging indent
+ // - a tab stop at the left margin is allowed
+ // - the determined next tab stop is a default tab stop position OR
+ // the determined next tab stop is beyond the left margin
{
- if ( bRTL )
+ long nLeftMarginTabPos = 0;
{
- Point aPoint( Left(), 0 );
- pFrm->SwitchLTRtoRTL( aPoint );
- nForced = pFrm->Frm().Right() - aPoint.X();
+ if ( !bTabsRelativeToIndent )
+ {
+ if ( bRTL )
+ {
+ Point aPoint( Left(), 0 );
+ pFrm->SwitchLTRtoRTL( aPoint );
+ nLeftMarginTabPos = pFrm->Frm().Right() - aPoint.X();
+ }
+ else
+ {
+ nLeftMarginTabPos = Left() - pFrm->Frm().Left();
+ }
+ }
+ if( pCurr->HasForcedLeftMargin() )
+ {
+ SwLinePortion* pPor = pCurr->GetPortion();
+ while( pPor && !pPor->IsFlyPortion() )
+ {
+ pPor = pPor->GetPortion();
+ }
+ if ( pPor )
+ {
+ nLeftMarginTabPos += pPor->Width();
+ }
+ }
}
- else
+ const bool bNewTabPortionInsideHangingIndent =
+ bRTL ? nCurrentAbsPos > nTabLeft - nLeftMarginTabPos
+ : nCurrentAbsPos < nTabLeft + nLeftMarginTabPos;
+ if ( bNewTabPortionInsideHangingIndent )
{
- nForced = Left() - pFrm->Frm().Left();
+ // If the paragraph is not inside a list having a list tab stop following
+ // the list label or no further tab stop found in such a paragraph or
+ // the next tab stop position does not equal the list tab stop,
+ // a tab stop at the left margin can be applied. If this condition is
+ // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
+ const bool bTabAtLeftMarginAllowed =
+ ( !aLineInf.IsListTabStopIncluded() ||
+ !pTabStop ||
+ nNextPos != aLineInf.GetListTabStopPosition() ) ||
+ // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
+ pFrm->GetTxtNode()->getIDocumentSettingAccess()->
+ get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
+ if ( bTabAtLeftMarginAllowed )
+ {
+ if ( !pTabStop || eAdj == SVX_TAB_ADJUST_DEFAULT ||
+ ( nNextPos > nLeftMarginTabPos ) )
+ {
+ eAdj = SVX_TAB_ADJUST_DEFAULT;
+ cFill = 0;
+ nNextPos = nLeftMarginTabPos;
+ }
+ }
}
}
- if( pCurr->HasForcedLeftMargin() )
- {
- SwLinePortion* pPor = pCurr->GetPortion();
- while( pPor && !pPor->IsFlyPortion() )
- pPor = pPor->GetPortion();
- if( pPor )
- nForced += pPor->Width();
- }
-
// <--
- // --> OD 2009-04-03 #i100732#
- // correction of condition, when a tab stop at the left margin can
- // be applied:
- // If the paragraph is not inside a list having a list tab stop following
- // the list label or no further tab stop found in such a paragraph or
- // the next tab stop position does not equal the list tab stop,
- // a tab stop at the left margin can be applied. If this condition is
- // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
- const bool bTabAtLeftMargin =
- ( !aLineInf.IsListTabStopIncluded() ||
- !pTabStop ||
- nNextPos != aLineInf.GetListTabStopPosition() ) ||
- // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
- pFrm->GetTxtNode()->getIDocumentSettingAccess()->
- get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
- if ( bTabAtLeftMargin &&
- // <--
- ( ( bRTL && nCurrentAbsPos > nTabLeft - nForced ) ||
- ( !bRTL && nCurrentAbsPos < nTabLeft + nForced ) ) &&
- // --> OD 2009-07-21 #i103685#
- // adjust condition:
- // - back to pre OOo 3.0 condition, if tab stops are relative to indent
- // - further checks needed, if tab stops are not relative to indent
- ( nNextPos > 0 &&
- ( bTabsRelativeToIndent ||
- ( !pTabStop || nNextPos > nForced ) ) ) )
- // <--
- {
- eAdj = SVX_TAB_ADJUST_DEFAULT;
- cFill = 0;
- nNextPos = nForced;
- }
+
nNextPos += bRTL ? nLinePos - nTabLeft : nTabLeft - nLinePos;
ASSERT( nNextPos >= 0, "GetTabStop: Don't go back!" );
nNewTabPos = KSHORT(nNextPos);
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 979a810b018b..ba2c3fce60c6 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -77,7 +77,7 @@ SfxPoolItem* SwFmtRefMark::Clone( SfxItemPool* ) const
// Attribut fuer Inhalts-/Positions-Referenzen im Text
SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr,
- xub_StrLen nStartPos, xub_StrLen* pEnd )
+ xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
: SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
, m_pTxtNode( 0 )
, m_pEnd( 0 )
diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx
index 8c64e4b2bd29..8b7e54813171 100644
--- a/sw/source/core/txtnode/atrtox.cxx
+++ b/sw/source/core/txtnode/atrtox.cxx
@@ -36,7 +36,7 @@
#include <ndtxt.hxx>
SwTxtTOXMark::SwTxtTOXMark( SwTOXMark& rAttr,
- xub_StrLen nStartPos, xub_StrLen* pEnd )
+ xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
: SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
, m_pTxtNode( 0 )
, m_pEnd( 0 )
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 236a0bab3d72..bf4116cc91f9 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -613,6 +613,7 @@ SwFmtMeta::~SwFmtMeta()
{
if (m_pMeta && (m_pMeta->GetFmtMeta() == this))
{
+ NotifyChangeTxtNode(0);
m_pMeta->SetFmtMeta(0);
}
}
@@ -633,16 +634,24 @@ SfxPoolItem * SwFmtMeta::Clone( SfxItemPool * /*pPool*/ ) const
void SwFmtMeta::SetTxtAttr(SwTxtMeta * const i_pTxtAttr)
{
- ASSERT(!(m_pTxtAttr && i_pTxtAttr),
+ OSL_ENSURE(!(m_pTxtAttr && i_pTxtAttr),
"SwFmtMeta::SetTxtAttr: already has text attribute?");
- ASSERT( m_pTxtAttr || i_pTxtAttr ,
+ OSL_ENSURE( m_pTxtAttr || i_pTxtAttr ,
"SwFmtMeta::SetTxtAttr: no attribute to remove?");
m_pTxtAttr = i_pTxtAttr;
- ASSERT(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
// the sw::Meta must be able to find the current text attribute!
- if (i_pTxtAttr && m_pMeta)
+ if (m_pMeta)
{
- m_pMeta->SetFmtMeta(this);
+ if (i_pTxtAttr)
+ {
+ m_pMeta->SetFmtMeta(this);
+ }
+ else if (m_pMeta->GetFmtMeta() == this)
+ { // text attribute gone => de-register from text node!
+ NotifyChangeTxtNode(0);
+ m_pMeta->SetFmtMeta(0);
+ }
}
}
@@ -650,36 +659,22 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
{
// N.B.: do not reset m_pTxtAttr here: see call in nodes.cxx,
// where the hint is not deleted!
- ASSERT(m_pMeta, "NotifyRemoval: no meta ?");
- if (m_pMeta)
- {
- if (!pTxtNode)
- {
- SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
- &static_cast<SwModify&>(*m_pMeta) ); // cast to base class!
- m_pMeta->Modify(&aMsgHint, &aMsgHint);
- }
- else
- { // do not call Modify, that would call SwXMeta::Modify!
- m_pMeta->NotifyChangeTxtNode();
- }
+ OSL_ENSURE(m_pMeta, "SwFmtMeta::NotifyChangeTxtNode: no Meta?");
+ if (m_pMeta && (m_pMeta->GetFmtMeta() == this))
+ { // do not call Modify, that would call SwXMeta::Modify!
+ m_pMeta->NotifyChangeTxtNode(pTxtNode);
}
}
-// UGLY: this really awful method fixes up an inconsistent state,
-// and if it is not called when copying, total chaos will undoubtedly ensue
-void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
+// this SwFmtMeta has been cloned and points at the same sw::Meta as the source
+// this method copies the sw::Meta
+void SwFmtMeta::DoCopy(::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode & i_rTargetTxtNode)
{
- ASSERT(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
if (m_pMeta)
{
const ::boost::shared_ptr< ::sw::Meta> pOriginal( m_pMeta );
- // UGLY: original sw::Meta now points at _this_ due to being already
- // inserted via MakeTxtAttr! so fix it up to point at the original item
- // (maybe would be better to tell MakeTxtAttr that it creates a copy?)
- pOriginal->SetFmtMeta(&rOriginalMeta);
- // force pOriginal to register in original text node!
- pOriginal->NotifyChangeTxtNode();
if (RES_TXTATR_META == Which())
{
m_pMeta.reset( new ::sw::Meta(this) );
@@ -688,14 +683,13 @@ void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
{
::sw::MetaField *const pMetaField(
static_cast< ::sw::MetaField* >(pOriginal.get()));
- SwDoc * const pTargetDoc( GetTxtAttr()->GetTxtNode()->GetDoc() );
- m_pMeta = pTargetDoc->GetMetaFieldManager().makeMetaField( this,
+ m_pMeta = i_rTargetDocManager.makeMetaField( this,
pMetaField->m_nNumberFormat, pMetaField->IsFixedLanguage() );
}
+ // Meta must have a text node before calling RegisterAsCopyOf
+ m_pMeta->NotifyChangeTxtNode(& i_rTargetTxtNode);
// this cannot be done in Clone: a Clone is not necessarily a copy!
m_pMeta->RegisterAsCopyOf(*pOriginal);
- // force copy Meta to register in target text node!
- m_pMeta->NotifyChangeTxtNode();
}
}
@@ -724,27 +718,36 @@ SwTxtMeta * Meta::GetTxtAttr() const
SwTxtNode * Meta::GetTxtNode() const
{
- SwTxtMeta * const pTxtAttr( GetTxtAttr() );
- return (pTxtAttr) ? pTxtAttr->GetTxtNode() : 0;
+ return m_pTxtNode;
}
-void Meta::NotifyChangeTxtNode()
+void Meta::NotifyChangeTxtNodeImpl()
{
- SwTxtNode * const pTxtNode( GetTxtNode() );
- if (pTxtNode && (GetRegisteredIn() != pTxtNode))
+ if (m_pTxtNode && (GetRegisteredIn() != m_pTxtNode))
{
- pTxtNode->Add(this);
+ m_pTxtNode->Add(this);
}
- else if (!pTxtNode && GetRegisteredIn())
+ else if (!m_pTxtNode && GetRegisteredIn())
{
const_cast<SwModify *>(GetRegisteredIn())->Remove(this);
}
}
+void Meta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
+{
+ m_pTxtNode = pTxtNode;
+ NotifyChangeTxtNodeImpl();
+ if (!pTxtNode) // text node gone? invalidate UNO object!
+ {
+ SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
+ &static_cast<SwModify&>(*this) ); // cast to base class!
+ this->Modify(&aMsgHint, &aMsgHint);
+ }
+}
+
// SwClient
void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
- NotifyChangeTxtNode();
SwModify::Modify(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
@@ -752,7 +755,7 @@ void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
}
-// sw::Metadatable
+// sfx2::Metadatable
::sfx2::IXmlIdRegistry& Meta::GetRegistry()
{
SwTxtNode * const pTxtNode( GetTxtNode() );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 9a2767977d84..fa7b72271826 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1435,15 +1435,10 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
}
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- ASSERT(pNewHt, "copying META should not fail! cannot call DoCopy");
- ASSERT(pDest && (CH_TXTATR_INWORD ==
+ OSL_ENSURE(pNewHt, "copying Meta should not fail!");
+ OSL_ENSURE(pDest && (CH_TXTATR_INWORD ==
pDest->GetTxt().GetChar(*pNewHt->GetStart())),
"missing CH_TXTATR?");
- if (pNewHt)
- {
- SwFmtMeta & rMeta(static_cast<SwFmtMeta&>(pNewHt->GetAttr()));
- rMeta.DoCopy( const_cast<SwFmtMeta&>(pHt->GetMeta()) );
- }
break;
}
}
@@ -1484,7 +1479,8 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
{
// attribute in the area => copy
SwTxtAttr *const pNewHt = pDest->InsertItem(
- pHt->GetAttr(), nOldPos, nOldPos );
+ pHt->GetAttr(), nOldPos, nOldPos,
+ nsSetAttrMode::SETATTR_IS_COPY);
if ( pNewHt )
{
lcl_CopyHint( nWhich, pHt, pNewHt,
@@ -1495,7 +1491,8 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
: 0 == pOtherDoc->GetRefMark(
pHt->GetRefMark().GetRefName() ) )
{
- pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos );
+ pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos,
+ nsSetAttrMode::SETATTR_IS_COPY);
}
}
}
@@ -1718,9 +1715,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if( pDest == this )
{
- // die Daten kopieren
+ // copy the hint here, but insert it later
pNewHt = MakeTxtAttr( *GetDoc(), pHt->GetAttr(),
- nAttrStt, nAttrEnd );
+ nAttrStt, nAttrEnd, COPY, pDest );
lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest);
aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
@@ -1728,7 +1725,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
else
{
pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars,
- nAttrEnd - nDeletedDummyChars, nsSetAttrMode::SETATTR_NOTXTATRCHR );
+ nAttrEnd - nDeletedDummyChars,
+ nsSetAttrMode::SETATTR_NOTXTATRCHR
+ | nsSetAttrMode::SETATTR_IS_COPY);
if (pNewHt)
{
lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
@@ -2208,7 +2207,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
{
const bool bSuccess( pDest->InsertHint( pNewHt,
nsSetAttrMode::SETATTR_NOTXTATRCHR
- | nsSetAttrMode::SETATTR_DONTREPLACE ) );
+ | nsSetAttrMode::SETATTR_DONTREPLACE
+ | nsSetAttrMode::SETATTR_IS_COPY) );
if (bSuccess)
{
lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index d0be32e61953..4d0dd116e5cd 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -996,7 +996,8 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr )
// create new text attribute
SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
- xub_StrLen nStt, xub_StrLen nEnd )
+ xub_StrLen const nStt, xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy, SwTxtNode *const pTxtNode)
{
if ( isCHRATR(rAttr.Which()) )
{
@@ -1077,7 +1078,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
break;
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- pNew = new SwTxtMeta( static_cast<SwFmtMeta&>(rNew), nStt, nEnd );
+ pNew = SwTxtMeta::CreateTxtMeta( rDoc.GetMetaFieldManager(), pTxtNode,
+ static_cast<SwFmtMeta&>(rNew), nStt, nEnd, bIsCopy );
break;
default:
ASSERT(RES_TXTATR_AUTOFMT == rNew.Which(), "unknown attribute");
@@ -1211,7 +1213,8 @@ SwTxtNode::InsertItem( SfxPoolItem& rAttr,
ASSERT( !isCHRATR(rAttr.Which()), "AUTOSTYLES - "
"SwTxtNode::InsertItem should not be called with character attributes");
- SwTxtAttr* const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd );
+ SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd,
+ (nMode & nsSetAttrMode::SETATTR_IS_COPY) ? COPY : NEW, this );
if ( pNew )
{
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index f6dcfc520eae..90b5b984a8d1 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -308,10 +308,25 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
* class SwTxtMeta
*************************************************************************/
+SwTxtMeta *
+SwTxtMeta::CreateTxtMeta(
+ ::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode *const i_pTargetTxtNode,
+ SwFmtMeta & i_rAttr,
+ xub_StrLen const i_nStart, xub_StrLen const i_nEnd, bool const i_bIsCopy)
+{
+ if (COPY == i_bIsCopy)
+ { // i_rAttr is already cloned, now call DoCopy to copy the sw::Meta
+ OSL_ENSURE(i_pTargetTxtNode, "cannot copy Meta without target node");
+ i_rAttr.DoCopy(i_rTargetDocManager, *i_pTargetTxtNode);
+ }
+ SwTxtMeta *const pTxtMeta(new SwTxtMeta(i_rAttr, i_nStart, i_nEnd));
+ return pTxtMeta;
+}
+
SwTxtMeta::SwTxtMeta( SwFmtMeta & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd )
: SwTxtAttrNesting( i_rAttr, i_nStart, i_nEnd )
- , m_pTxtNode( 0 )
{
i_rAttr.SetTxtAttr( this );
SetHasDummyChar(true);
@@ -328,7 +343,6 @@ SwTxtMeta::~SwTxtMeta()
void SwTxtMeta::ChgTxtNode(SwTxtNode * const pNode)
{
- m_pTxtNode = pNode; // before Notify!
SwFmtMeta & rFmtMeta( static_cast<SwFmtMeta &>(GetAttr()) );
if (rFmtMeta.GetTxtAttr() == this)
{
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 4b99670b865c..b3d93e8eb0a7 100644..100755
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -966,11 +966,11 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
if (pFont)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet( pFont->GetCharSet() );
aSet.Put( aFontItem );
}
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 1bb59d0eee65..90d5dac1c315 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -886,7 +886,7 @@ bool SwXMeta::SetContentRange(
SwTxtMeta const * const pTxtAttr( pMeta->GetTxtAttr() );
if (pTxtAttr)
{
- rpNode = pTxtAttr->GetTxtNode();
+ rpNode = pMeta->GetTxtNode();
if (rpNode)
{
// rStart points at the first position _within_ the meta!
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 875d0e23235d..323eedffc9b0 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1857,32 +1857,6 @@ static bool lcl_SimilarPosition( const sal_Int32 nPos1, const sal_Int32 nPos2 )
return abs( nPos1 - nPos2 ) < COL_POS_FUZZY;
}
-void SwXText::copyText(
- const uno::Reference< text::XTextCopy >& xSource )
- throw ( uno::RuntimeException )
-{
- uno::Reference< lang::XUnoTunnel > xTTunnel( xSource, uno::UNO_QUERY_THROW );
- SwXText* pText = 0;
- pText = reinterpret_cast< SwXText* >(
- sal::static_int_cast< sal_IntPtr >( xTTunnel->getSomething( SwXText::getUnoTunnelId()) ));
-
- uno::Reference< text::XText > xText( xSource, uno::UNO_QUERY_THROW );
- uno::Reference< text::XTextCursor > xCursor = xText->createTextCursor( );
- xCursor->gotoEnd( sal_True );
-
- uno::Reference< lang::XUnoTunnel > xTunnel( xCursor, uno::UNO_QUERY_THROW );
-
- OTextCursorHelper* pCursor = 0;
- pCursor = reinterpret_cast< OTextCursorHelper* >(
- sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
- if ( pCursor )
- {
- SwNodeIndex rNdIndex( *GetStartNode( ), 1 );
- SwPosition rPos( rNdIndex );
- m_pImpl->m_pDoc->CopyRange( *pCursor->GetPaM( ), rPos, false );
- }
-}
-
void SwXText::Impl::ConvertCell(
const bool bFirstCell,
const uno::Sequence< uno::Reference< text::XTextRange > > & rCell,
@@ -2387,6 +2361,35 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return xRet;
}
+
+void SAL_CALL
+SwXText::copyText(
+ const uno::Reference< text::XTextCopy >& xSource )
+throw (uno::RuntimeException)
+{
+ vos::OGuard g(Application::GetSolarMutex());
+
+ uno::Reference< text::XText > const xText(xSource, uno::UNO_QUERY_THROW);
+ uno::Reference< text::XTextCursor > const xCursor =
+ xText->createTextCursor();
+ xCursor->gotoEnd( sal_True );
+
+ uno::Reference< lang::XUnoTunnel > const xCursorTunnel(xCursor,
+ uno::UNO_QUERY_THROW);
+
+ OTextCursorHelper *const pCursor =
+ ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xCursorTunnel);
+ if (!pCursor)
+ {
+ throw uno::RuntimeException();
+ }
+
+ SwNodeIndex rNdIndex( *GetStartNode( ), 1 );
+ SwPosition rPos( rNdIndex );
+ m_pImpl->m_pDoc->CopyRange( *pCursor->GetPaM(), rPos, false );
+}
+
+
/******************************************************************
* SwXBodyText
******************************************************************/
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 357a7aff1e57..74d400a17796 100644..100755
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -118,6 +118,11 @@ RtfSdrExport& RtfExport::SdrExporter() const
return *m_pSdrExport;
}
+bool RtfExport::HackIsWW8OrHigher() const
+{
+ return true;
+}
+
bool RtfExport::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich )
{
// FIXME is this actually true for rtf? - this is copied from DOCX
@@ -480,6 +485,10 @@ void RtfExport::WritePageDescTable()
}
Strm() << '}' << sNewLine;
bOutPageDescs = sal_False;
+
+ // reset table infos, otherwise the depth of the cells will be incorrect,
+ // in case the page style (header or footer) had tables
+ mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
}
void RtfExport::ExportDocument_Impl()
@@ -1243,16 +1252,19 @@ void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_
class SwRTFWriter : public Writer
{
- public:
+ bool m_bOutOutlineOnly;
+ public:
SwRTFWriter( const String& rFilterName, const String& rBaseURL );
virtual ~SwRTFWriter();
virtual sal_uLong WriteStream();
};
-SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL )
+SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL )
{
OSL_TRACE("%s", OSL_THIS_FUNC);
SetBaseURL( rBaseURL );
+ // export outline nodes, only (send outline to clipboard/presentation)
+ m_bOutOutlineOnly = 'O' == rFltName.GetChar( 0 );
}
SwRTFWriter::~SwRTFWriter()
@@ -1262,6 +1274,7 @@ sal_uLong SwRTFWriter::WriteStream()
{
OSL_TRACE("%s", OSL_THIS_FUNC);
RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this );
+ aExport.mbOutOutlineOnly = m_bOutOutlineOnly;
aExport.ExportDocument( true );
return 0;
}
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index e73cd9b822c5..a6f018cddb7e 100644..100755
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -82,7 +82,7 @@ public:
virtual RtfSdrExport& SdrExporter() const;
/// Hack, unfortunately necessary at some places for now.
- virtual bool HackIsWW8OrHigher() const { return false; }
+ virtual bool HackIsWW8OrHigher() const;
/// Guess the script (asian/western).
virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 7f5e0eaae54e..7f6fe64a5eea 100644..100755
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -107,6 +107,7 @@
#include <ndgrf.hxx>
#include <ndole.hxx>
+
#include <cstdio>
using namespace ::com::sun::star;
@@ -575,7 +576,7 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos )
characters.
*/
if ( !m_rExport.HackIsWW8OrHigher() )
- aFont.GetCharSet() = GetCharSet();
+ aFont.SetCharSet( GetCharSet() );
if ( rParentFont != aFont )
m_rExport.AttrOutput().OutputItem( aFont );
@@ -1650,12 +1651,13 @@ xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode&
{
// Get the bookmarks for the normal run
xub_StrLen nNextPos = aAttrIter->WhereNext();
-
- GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
-
xub_StrLen nNextBookmark = nNextPos;
- NearestBookmark( nNextPos, nAktPos, false );
+ if( nNextBookmark > nAktPos )//no need to search for bookmarks otherwise
+ {
+ GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos );
+ NearestBookmark( nNextBookmark, nAktPos, false );
+ }
return std::min( nNextPos, nNextBookmark );
}
@@ -1663,9 +1665,9 @@ void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos
{
xub_StrLen nNextPos;
- // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position
+ // go to next attribute if no bookmark is found and if the next attribute position if at the current position
bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
- if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() )
+ if( !bNextBookmark && nAktPos >= aAttrIter->WhereNext() )
aAttrIter->NextPos();
}
@@ -2837,8 +2839,12 @@ void MSWordExportBase::OutputContentNode( const SwCntntNode& rNode )
switch ( rNode.GetNodeType() )
{
case ND_TEXTNODE:
- OutputTextNode( *rNode.GetTxtNode() );
- break;
+ {
+ const SwTxtNode& rTextNode = *rNode.GetTxtNode();
+ if( !mbOutOutlineOnly || rTextNode.IsOutline() )
+ OutputTextNode( rTextNode );
+ }
+ break;
case ND_GRFNODE:
OutputGrfNode( *rNode.GetGrfNode() );
break;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c40ce759b3f2..3ec0aeea4d0c 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3389,6 +3389,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
pStyles( NULL ),
bHasHdr(false), bHasFtr(false), bSubstituteBullets(true),
mbExportModeRTF( false ),
+ mbOutOutlineOnly( false ),
pDoc( pDocument ),
pCurPam( pCurrentPam ),
pOrigPam( pOriginalPam )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 6350fb9f5512..129822af0640 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -554,6 +554,7 @@ public:
sal_uInt8 bSubstituteBullets : 1; // true: SubstituteBullet() gets called
bool mbExportModeRTF;
+ bool mbOutOutlineOnly; // export outline nodes, only (send outline to clipboard/presentation)
SwDoc *pDoc;
SwPaM *pCurPam, *pOrigPam;
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index fcaf4e07a293..0fe904e8a092 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -79,6 +79,8 @@
#include "docsh.hxx"
#include <cstdio>
+#include <stdio.h>
+
using namespace ::com::sun::star;
using namespace nsFieldFlags;
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c2e9c8789d55..8bd86b4bbe05 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2573,7 +2573,10 @@ void WW8TabDesc::CreateSwTable()
else
{
if (nPreferredWidth)
- nLeft = pIo->maSectionManager.GetTextAreaWidth() - nPreferredWidth - nOrgDxaLeft;
+ {
+ nLeft = pIo->maSectionManager.GetTextAreaWidth();
+ nLeft = nLeft - nPreferredWidth - nOrgDxaLeft;
+ }
else
nLeft = -GetMinLeft();
}
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 21c9a3b93c75..75251c8c1531 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -70,21 +70,22 @@ using ::com::sun::star::beans::XPropertySetInfo;
SwDoc* lcl_GetDocViaTunnel( Reference<XTextCursor> & rCursor )
{
Reference<XUnoTunnel> xTunnel( rCursor, UNO_QUERY);
- DBG_ASSERT( xTunnel.is(), "missing XUnoTunnel for Cursor" );
- OTextCursorHelper* pSwXCursor = reinterpret_cast< OTextCursorHelper * >(
- sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(OTextCursorHelper::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pSwXCursor, "OTextCursorHelper missing" );
- return pSwXCursor->GetDoc();
+ OSL_ENSURE(xTunnel.is(), "missing XUnoTunnel for XTextCursor");
+ OTextCursorHelper *const pXCursor =
+ ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel);
+ OSL_ENSURE( pXCursor, "OTextCursorHelper missing" );
+ return (pXCursor) ? pXCursor->GetDoc() : 0;
}
SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> & rRange )
{
Reference<XUnoTunnel> xTunnel(rRange, UNO_QUERY);
- DBG_ASSERT(xTunnel.is(), "Can't tunnel XTextRange");
- SwXTextRange *pRange = reinterpret_cast< SwXTextRange *>(
- sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextRange::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pRange, "SwXTextRange missing" );
- return pRange->GetDoc();
+ OSL_ENSURE(xTunnel.is(), "missing XUnoTunnel for XTextRange");
+ SwXTextRange *const pXRange =
+ ::sw::UnoTunnelGetImplementation<SwXTextRange>(xTunnel);
+ // #i115174#: this may be a SvxUnoTextRange
+// OSL_ENSURE( pXRange, "SwXTextRange missing" );
+ return (pXRange) ? pXRange->GetDoc() : 0;
}
@@ -111,7 +112,7 @@ public:
void Set( SwNodeIndex& rIndex );
void SetAsNodeIndex( Reference<XTextRange> & rRange );
- void CopyPositionInto(SwPosition& rPos);
+ void CopyPositionInto(SwPosition& rPos, SwDoc & rDoc);
SwDoc* GetDoc();
sal_Bool IsValid();
@@ -154,6 +155,12 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
// XTextRange -> XTunnel -> SwXTextRange
SwDoc* pDoc = lcl_GetDocViaTunnel(rRange);
+ if (!pDoc)
+ {
+ OSL_TRACE("SetAsNodeIndex: no SwDoc");
+ return;
+ }
+
// SwXTextRange -> PaM
SwUnoInternalPaM aPaM(*pDoc);
#ifdef DBG_UTIL
@@ -166,14 +173,15 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
Set(aPaM.GetPoint()->nNode);
}
-void XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos)
+void
+XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos, SwDoc & rDoc)
{
DBG_ASSERT(IsValid(), "Can't get Position");
// create PAM from start cursor (if no node index is present)
if (NULL == pIndex)
{
- SwUnoInternalPaM aUnoPaM(*GetDoc());
+ SwUnoInternalPaM aUnoPaM(rDoc);
#ifdef DBG_UTIL
sal_Bool bSuccess =
#endif
@@ -479,6 +487,13 @@ Reference<XTextCursor> XMLRedlineImportHelper::CreateRedlineTextSection(
// get document from old cursor (via tunnel)
SwDoc* pDoc = lcl_GetDocViaTunnel(xOldCursor);
+ if (!pDoc)
+ {
+ OSL_TRACE("XMLRedlineImportHelper::CreateRedlineTextSection: "
+ "no SwDoc => cannot create section.");
+ return 0;
+ }
+
// create text section for redline
SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool
(RES_POOLCOLL_STANDARD, false );
@@ -611,11 +626,18 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
// get the document (from one of the positions)
SwDoc* pDoc = pRedlineInfo->aAnchorStart.GetDoc();
+ if (!pDoc)
+ {
+ OSL_TRACE("XMLRedlineImportHelper::InsertIntoDocument: "
+ "no SwDoc => cannot insert redline.");
+ return;
+ }
+
// now create the PaM for the redline
SwPaM aPaM(pDoc->GetNodes().GetEndOfContent());
- pRedlineInfo->aAnchorStart.CopyPositionInto(*aPaM.GetPoint());
+ pRedlineInfo->aAnchorStart.CopyPositionInto(*aPaM.GetPoint(), *pDoc);
aPaM.SetMark();
- pRedlineInfo->aAnchorEnd.CopyPositionInto(*aPaM.GetPoint());
+ pRedlineInfo->aAnchorEnd.CopyPositionInto(*aPaM.GetPoint(), *pDoc);
// collapse PaM if (start == end)
if (*aPaM.GetPoint() == *aPaM.GetMark())
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 012f08ff9684..2b3b4b345dbc 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -698,23 +698,28 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0;
switch( rEvHint.GetEventId() )
{
-/* MA 07. Mar. 96: UpdateInputFlds() nur noch bei Dokument neu.
- (Und bei Einfuegen Textbaust.)
- case SFX_EVENT_OPENDOC:
- // dann am aktuellen Dokument die Input-Fedler updaten
- if( pWrtSh )
- pWrtSh->UpdateInputFlds();
+ case SFX_EVENT_LOADFINISHED:
+ OSL_ASSERT(!pWrtSh);
+ // if it is a new document created from a template,
+ // update fixed fields
+ if (pDocSh->GetMedium())
+ {
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
+ pTemplateItem, SfxBoolItem,
+ SID_TEMPLATE, sal_False);
+ if (pTemplateItem && pTemplateItem->GetValue())
+ {
+ pDocSh->GetDoc()->SetFixFields(false, 0);
+ }
+ }
break;
-*/
case SFX_EVENT_CREATEDOC:
- // alle FIX-Date/Time Felder auf akt. setzen
if( pWrtSh )
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
sal_Bool bUpdateFields = sal_True;
if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
bUpdateFields = sal_False;
- pWrtSh->SetFixFields();
if(bUpdateFields)
{
pWrtSh->UpdateInputFlds();
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index f5e79b9da72f..4359ca16f9d9 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -209,7 +209,12 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
return;
// Weitergabe an die CORE
- const sal_Bool bReadonly = pCurrView->GetDocShell()->IsReadOnly();
+ sal_Bool bReadonly;
+ const SwDocShell* pDocSh = pCurrView->GetDocShell();
+ if (pDocSh)
+ bReadonly = pDocSh->IsReadOnly();
+ else //Use existing option if DocShell missing
+ bReadonly = pSh->GetViewOptions()->IsReadonly();
SwViewOption* pViewOpt;
if(!bViewOnly)
pViewOpt = new SwViewOption( *pPref );
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index e64ec62f6c3a..99ba59d9d852 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1321,7 +1321,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
aAtHorzPosFT.Enable( bEnable );
aAtHorzPosED.Enable( bEnable );
- bEnable = nV == text::VertOrientation::NONE && !bFormat;
+ bEnable = nV == text::VertOrientation::NONE;
if ( !bEnable )
{
aAtVertPosED.SetValue( 0, FUNIT_TWIP );
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index a21d8920c78d..98e40aa4f9aa 100644..100755
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -575,8 +575,8 @@ TabPage TP_TOX_ENTRY
};
Window WIN_TOKEN
{
- Pos = MAP_APPFONT ( 70, 16 ) ;
- Size = MAP_APPFONT ( 136, 12 ) ;
+ Pos = MAP_APPFONT ( 70, 15 ) ;
+ Size = MAP_APPFONT ( 136, 14 ) ;
ImageButton WIN_LEFT_SCROLL
{
HelpID = "sw:ImageButton:TP_TOX_ENTRY:WIN_LEFT_SCROLL";
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index 98280db3f63e..ae84d4b1872f 100644..100755
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -560,11 +560,11 @@ void SwHHCWrapper::ReplaceUnit(
if (pTargetFont && pNewUnitLanguage)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
- aFontItem.GetFamilyName() = pTargetFont->GetName();
- aFontItem.GetFamily() = pTargetFont->GetFamily();
- aFontItem.GetStyleName() = pTargetFont->GetStyleName();
- aFontItem.GetPitch() = pTargetFont->GetPitch();
- aFontItem.GetCharSet() = pTargetFont->GetCharSet();
+ aFontItem.SetFamilyName( pTargetFont->GetName());
+ aFontItem.SetFamily( pTargetFont->GetFamily());
+ aFontItem.SetStyleName( pTargetFont->GetStyleName());
+ aFontItem.SetPitch( pTargetFont->GetPitch());
+ aFontItem.SetCharSet( pTargetFont->GetCharSet() );
aSet.Put( aFontItem );
}
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 6ed0e3050f26..d4c309cf2a2d 100644..100755
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -1161,10 +1161,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
{
bFontChanged = sal_True;
SvxFontItem aNewFontItem( aFont );
- aNewFontItem.GetFamilyName() = aNewFont.GetName();
- aNewFontItem.GetFamily() = aNewFont.GetFamily();
- aNewFontItem.GetPitch() = aNewFont.GetPitch();
- aNewFontItem.GetCharSet() = aNewFont.GetCharSet();
+ aNewFontItem.SetFamilyName( aNewFont.GetName());
+ aNewFontItem.SetFamily( aNewFont.GetFamily());
+ aNewFontItem.SetPitch( aNewFont.GetPitch());
+ aNewFontItem.SetCharSet( aNewFont.GetCharSet() );
SfxItemSet aRestoreSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT,
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 45eab49d553d..9fe0b570cc6f 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1111,12 +1111,18 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
if(!bModifyTable && !bProp )
{
-// Tabellenbreite bleibt, Differenz wird mit der/den
-// naechsten Zellen ausgeglichen
+// the table width is constant, the difference is balanced with the other columns
+ sal_uInt16 nLoopCount = 0;
while( nDiff )
{
if( ++nAktPos == nNoOfVisibleCols)
+ {
nAktPos = 0;
+ ++nLoopCount;
+ //#i101353# in small tables it might not be possible to balance column width
+ if( nLoopCount > 1 )
+ break;
+ }
if( nDiff < 0 )
{
SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff);
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 35f3c0e8e172..7b2409152372 100644..100755
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -4123,6 +4123,8 @@ SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewO
SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl()
{
m_rShell.ApplyViewOptions( m_aOldViewOptions );
+ //#i115062# invalidate meta character slot
+ m_rShell.GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
}
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 788fd4cce9cb..b895fd418170 100644..100755
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -421,8 +421,8 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
rSh.EnterStdMode();
rSh.GotoMark(pMark);
+ return sal_True;
}
- return sal_True;
}
// IndexMark, Index, TextField, Draw, Section, Footnote, Paragraph
//
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index d88ecdf6be73..7ad513ed479e 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -809,8 +809,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
&aContentToolBox, SW_RES(NF_PAGE ));
pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
- pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
pEdit->SetAccessibleName(pEdit->GetQuickHelpText());
+ pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+ pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+
bPageCtrlsVisible = sal_True;
// Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SHOW_ROOT);
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 2d0bcc433be1..465277890a28 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1307,6 +1307,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// <--
aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFmt);
}
@@ -1370,6 +1373,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
aFmt.SetBulletChar( numfunc::GetBulletChar(nLvl) );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
// --> OD 2009-08-26 #i95907#
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index c3bef67c8c12..2426a20c595f 100644..100755
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 4b482e373d3f..ba12b6c0274a 100644..100755
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -143,8 +143,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 69b65cfd3e59..bb58c81f7d81 100644..100755
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 69b65cfd3e59..bb58c81f7d81 100644..100755
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index fb10ca615b50..3243d6b1646b 100644..100755
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -198,8 +198,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index ae0df22748fe..3a31ab392010 100644..100755
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -196,8 +196,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>