summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-07-14 19:09:11 +0000
committerArmin Le Grand <alg@apache.org>2014-07-14 19:09:11 +0000
commit3c1d4742e649fe9c8aed8c2817fe3e1f3364f298 (patch)
treee0c6e02c89aa9227726c9469da1001b3e29c41df /sw/source
parentc5c31e2aeaedbdf76e1f38d3c385e34f5ed875ca (diff)
Resync to trunk, windows non-pro build aoo/aw080
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/acccell.cxx33
-rw-r--r--sw/source/core/access/acccell.hxx8
-rw-r--r--sw/source/core/access/accframebase.cxx2
-rw-r--r--sw/source/core/access/accframebase.hxx2
-rw-r--r--sw/source/core/access/accmap.cxx17
-rw-r--r--sw/source/core/access/accpage.cxx2
-rw-r--r--sw/source/core/access/accpage.hxx2
-rw-r--r--sw/source/core/access/accpara.cxx10
-rw-r--r--sw/source/core/access/accpara.hxx2
-rw-r--r--sw/source/core/attr/cellatr.cxx6
-rw-r--r--sw/source/core/attr/format.cxx63
-rw-r--r--sw/source/core/attr/hints.cxx16
-rw-r--r--sw/source/core/attr/swatrset.cxx1
-rw-r--r--sw/source/core/bastyp/init.cxx7
-rw-r--r--sw/source/core/bastyp/swrect.cxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx2
-rw-r--r--sw/source/core/crsr/findtxt.cxx2
-rw-r--r--sw/source/core/crsr/trvltbl.cxx2
-rw-r--r--sw/source/core/crsr/viscrs.cxx16
-rw-r--r--sw/source/core/doc/doc.cxx65
-rw-r--r--sw/source/core/doc/docbm.cxx54
-rw-r--r--sw/source/core/doc/docdde.cxx12
-rw-r--r--sw/source/core/doc/docdesc.cxx77
-rw-r--r--sw/source/core/doc/docdraw.cxx52
-rw-r--r--sw/source/core/doc/docedt.cxx6
-rw-r--r--sw/source/core/doc/docfld.cxx2
-rw-r--r--sw/source/core/doc/docfly.cxx22
-rw-r--r--sw/source/core/doc/docfmt.cxx191
-rw-r--r--sw/source/core/doc/docglbl.cxx3
-rw-r--r--sw/source/core/doc/doclay.cxx10
-rw-r--r--sw/source/core/doc/docnew.cxx35
-rw-r--r--sw/source/core/doc/docnum.cxx8
-rw-r--r--sw/source/core/doc/docredln.cxx21
-rw-r--r--sw/source/core/doc/doctxm.cxx53
-rw-r--r--sw/source/core/doc/fmtcol.cxx55
-rw-r--r--sw/source/core/doc/notxtfrm.cxx62
-rw-r--r--sw/source/core/doc/poolfmt.cxx4
-rw-r--r--sw/source/core/doc/visiturl.cxx12
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx1
-rw-r--r--sw/source/core/docnode/node.cxx8
-rw-r--r--sw/source/core/docnode/section.cxx2
-rw-r--r--sw/source/core/draw/dcontact.cxx6
-rw-r--r--sw/source/core/draw/dpage.cxx17
-rw-r--r--sw/source/core/draw/drawdoc.cxx46
-rw-r--r--sw/source/core/edit/edfcol.cxx2
-rw-r--r--sw/source/core/edit/edlingu.cxx2
-rw-r--r--sw/source/core/fields/authfld.cxx2
-rw-r--r--sw/source/core/frmedt/feshview.cxx5
-rw-r--r--sw/source/core/graphic/ndgrf.cxx725
-rw-r--r--sw/source/core/inc/MarkManager.hxx5
-rw-r--r--sw/source/core/inc/anchoredobjectposition.hxx4
-rw-r--r--sw/source/core/inc/frame.hxx19
-rw-r--r--sw/source/core/inc/frmtool.hxx2
-rw-r--r--sw/source/core/inc/pagefrm.hxx2
-rw-r--r--sw/source/core/inc/rolbck.hxx8
-rw-r--r--sw/source/core/inc/rootfrm.hxx4
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx2
-rw-r--r--sw/source/core/layout/atrfrm.cxx58
-rw-r--r--sw/source/core/layout/findfrm.cxx13
-rw-r--r--sw/source/core/layout/fly.cxx44
-rw-r--r--sw/source/core/layout/flycnt.cxx2
-rw-r--r--sw/source/core/layout/flylay.cxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx28
-rw-r--r--sw/source/core/layout/newfrm.cxx6
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.hxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx230
-rw-r--r--sw/source/core/layout/tabfrm.cxx6
-rw-r--r--sw/source/core/layout/trvlfrm.cxx894
-rw-r--r--sw/source/core/layout/wsfrm.cxx4
-rw-r--r--sw/source/core/ole/ndole.cxx2
-rw-r--r--sw/source/core/table/swnewtable.cxx2
-rw-r--r--sw/source/core/text/atrstck.cxx2
-rw-r--r--sw/source/core/text/guess.cxx2
-rw-r--r--sw/source/core/text/inftxt.cxx8
-rw-r--r--sw/source/core/text/itratr.cxx2
-rw-r--r--sw/source/core/text/itrform2.cxx2
-rw-r--r--sw/source/core/text/itrform2.hxx2
-rw-r--r--sw/source/core/text/porfld.cxx4
-rw-r--r--sw/source/core/text/pormulti.cxx2
-rw-r--r--sw/source/core/text/txtdrop.cxx2
-rw-r--r--sw/source/core/text/txtfly.cxx2
-rw-r--r--sw/source/core/text/txtfrm.cxx6
-rw-r--r--sw/source/core/tox/tox.cxx84
-rw-r--r--sw/source/core/txtnode/atrfld.cxx142
-rw-r--r--sw/source/core/txtnode/fntcache.cxx6
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx113
-rw-r--r--sw/source/core/txtnode/thints.cxx48
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx18
-rw-r--r--sw/source/core/txtnode/txtedt.cxx17
-rw-r--r--sw/source/core/undo/docundo.cxx9
-rw-r--r--sw/source/core/undo/rolbck.cxx91
-rw-r--r--sw/source/core/undo/unattr.cxx11
-rw-r--r--sw/source/core/undo/unfmco.cxx13
-rw-r--r--sw/source/core/undo/untbl.cxx2
-rw-r--r--sw/source/core/unocore/XMLRangeHelper.cxx2
-rw-r--r--sw/source/core/unocore/swunohelper.cxx41
-rw-r--r--sw/source/core/unocore/unochart.cxx8
-rw-r--r--sw/source/core/unocore/unodraw.cxx6
-rw-r--r--sw/source/core/unocore/unofield.cxx191
-rw-r--r--sw/source/core/unocore/unoframe.cxx275
-rw-r--r--sw/source/core/unocore/unomap.cxx241
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx281
-rw-r--r--sw/source/core/unocore/unoprnms.cxx107
-rw-r--r--sw/source/core/unocore/unosett.cxx21
-rw-r--r--sw/source/core/unocore/unostyle.cxx2100
-rw-r--r--sw/source/core/unocore/unotext.cxx2
-rw-r--r--sw/source/core/view/vdraw.cxx13
-rw-r--r--sw/source/core/view/viewimp.cxx7
-rw-r--r--sw/source/core/view/viewsh.cxx5
-rw-r--r--sw/source/core/view/vnew.cxx4
-rw-r--r--sw/source/core/view/vprint.cxx9
-rw-r--r--sw/source/filter/ascii/parasc.cxx2
-rw-r--r--sw/source/filter/basflt/fltini.cxx2
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/filter/html/htmldraw.cxx3
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/wrthtml.cxx6
-rw-r--r--sw/source/filter/inc/msfilter.hxx8
-rw-r--r--sw/source/filter/inc/wwstyles.hxx4
-rw-r--r--sw/source/filter/rtf/rtffly.cxx17
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx22
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
-rw-r--r--sw/source/filter/ww8/dump/msvbasic.cxx2
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.cxx12
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.hxx8
-rw-r--r--sw/source/filter/ww8/dump/ww8struc.hxx2
-rw-r--r--sw/source/filter/ww8/needed_cast.hxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx22
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx2
-rw-r--r--sw/source/filter/ww8/staticassert.hxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx4
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx6
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx25
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx11
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx22
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx17
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx15
-rw-r--r--sw/source/filter/ww8/ww8graf.hxx4
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx267
-rw-r--r--sw/source/filter/ww8/ww8par.hxx43
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx53
-rw-r--r--sw/source/filter/ww8/ww8par2.hxx66
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx136
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx146
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx94
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx12
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx12
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx15
-rw-r--r--sw/source/filter/xml/swxml.cxx35
-rw-r--r--sw/source/filter/xml/xmlexp.cxx15
-rw-r--r--sw/source/filter/xml/xmlimp.cxx12
-rw-r--r--sw/source/filter/xml/xmlitmap.hxx4
-rw-r--r--sw/source/filter/xml/xmltbli.cxx2
-rw-r--r--sw/source/filter/xml/xmltexte.cxx32
-rw-r--r--sw/source/ui/app/docsh.cxx387
-rw-r--r--sw/source/ui/app/docsh2.cxx138
-rw-r--r--sw/source/ui/app/docshdrw.cxx86
-rw-r--r--sw/source/ui/app/docshini.cxx196
-rw-r--r--sw/source/ui/app/docst.cxx151
-rw-r--r--sw/source/ui/app/docstyle.cxx69
-rw-r--r--sw/source/ui/chrdlg/paradlg.src24
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx178
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx2
-rw-r--r--sw/source/ui/dbui/maildispatcher.cxx4
-rw-r--r--sw/source/ui/dbui/swdbtoolsclient.cxx2
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx3
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx2
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx12
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx5
-rw-r--r--sw/source/ui/docvw/edtwin.cxx2
-rw-r--r--sw/source/ui/envelp/labimg.cxx6
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx337
-rw-r--r--sw/source/ui/fmtui/tmpdlg.src45
-rw-r--r--sw/source/ui/frmdlg/colex.cxx85
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx1
-rw-r--r--sw/source/ui/frmdlg/frmpage.src40
-rw-r--r--sw/source/ui/inc/tablemgr.hxx2
-rw-r--r--sw/source/ui/inc/uitool.hxx2
-rw-r--r--sw/source/ui/lingu/olmenu.cxx2
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx8
-rw-r--r--sw/source/ui/misc/glossary.cxx5
-rw-r--r--sw/source/ui/shells/basesh.cxx241
-rw-r--r--sw/source/ui/shells/drwbassh.cxx8
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx2
-rw-r--r--sw/source/ui/shells/frmsh.cxx10
-rw-r--r--sw/source/ui/shells/grfsh.cxx65
-rw-r--r--sw/source/ui/shells/grfshex.cxx8
-rw-r--r--sw/source/ui/shells/textsh1.cxx74
-rw-r--r--sw/source/ui/sidebar/WrapPropertyPanel.hxx2
-rw-r--r--sw/source/ui/uiview/pview.cxx2
-rw-r--r--sw/source/ui/uiview/view.cxx7
-rw-r--r--sw/source/ui/uiview/view2.cxx2
-rw-r--r--sw/source/ui/uiview/viewport.cxx4
-rw-r--r--sw/source/ui/uiview/viewstat.cxx17
-rw-r--r--sw/source/ui/uno/unodefaults.cxx4
-rw-r--r--sw/source/ui/uno/unodispatch.cxx2
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx6
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx54
-rw-r--r--sw/source/ui/utlui/content.cxx24
-rw-r--r--sw/source/ui/utlui/navipi.cxx1
-rw-r--r--sw/source/ui/utlui/uitool.cxx38
-rw-r--r--sw/source/ui/wrtsh/select.cxx2
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx5
209 files changed, 5852 insertions, 4713 deletions
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index d6ba535503b5..105aeb7b6933 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -115,17 +115,21 @@ SwAccessibleCell::SwAccessibleCell( SwAccessibleMap *pInitMap,
: SwAccessibleContext( pInitMap, AccessibleRole::TABLE_CELL, pCellFrm )
, aSelectionHelper( *this )
, bIsSelected( sal_False )
+ , m_xTableReference( NULL )
+ , m_pAccTable( NULL )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ vos::OGuard aGuard( Application::GetSolarMutex() );
OUString sBoxName( pCellFrm->GetTabBox()->GetName() );
SetName( sBoxName );
bIsSelected = IsSelected();
- //Need not assign the pointer of accessible table object to m_pAccTable,
- //for it already done in SwAccessibleCell::GetTable(); Former codes:
- //m_pAccTable= GetTable();
- GetTable();
+ m_xTableReference = getAccessibleParent();
+#if OSL_DEBUG_LEVEL > 1
+ uno::Reference< XAccessibleContext > xContextTable( m_xTableReference, uno::UNO_QUERY );
+ OSL_ASSERT( xContextTable.is() && xContextTable->getAccessibleRole() == AccessibleRole::TABLE );
+#endif
+ m_pAccTable = static_cast< SwAccessibleTable * >( m_xTableReference.get() );
}
sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
@@ -140,7 +144,7 @@ sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
if( bNew )
{
// remember that object as the one that has the caret. This is
- // neccessary to notify that object if the cursor leaves it.
+ // necessary to notify that object if the cursor leaves it.
::vos::ORef < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -557,20 +561,3 @@ void SwAccessibleCell::deselectAccessibleChild(
aSelectionHelper.deselectAccessibleChild(nSelectedChildIndex);
}
-SwAccessibleTable *SwAccessibleCell::GetTable()
-{
- if (!m_pAccTable)
- {
- if (!xTableReference.is())
- {
- xTableReference = getAccessibleParent();
- #ifdef OSL_DEBUG_LEVEL
- uno::Reference<XAccessibleContext> xContextTable(xTableReference, uno::UNO_QUERY);
- OSL_ASSERT(xContextTable.is() && xContextTable->getAccessibleRole() == AccessibleRole::TABLE);
- #endif
- //SwAccessibleTable aTable = *(static_cast<SwAccessibleTable *>(xTable.get()));
- }
- m_pAccTable = static_cast<SwAccessibleTable *>(xTableReference.get());
- }
- return m_pAccTable;
-}
diff --git a/sw/source/core/access/acccell.hxx b/sw/source/core/access/acccell.hxx
index 50152d2b5fcc..5c31b338c487 100644
--- a/sw/source/core/access/acccell.hxx
+++ b/sw/source/core/access/acccell.hxx
@@ -47,6 +47,9 @@ class SwAccessibleCell : public SwAccessibleContext,
SwAccessibleSelectionHelper aSelectionHelper;
sal_Bool bIsSelected; // protected by base class mutex
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xTableReference;
+ SwAccessibleTable *m_pAccTable;
+
sal_Bool IsSelected();
sal_Bool _InvalidateMyCursorPos();
@@ -55,7 +58,7 @@ class SwAccessibleCell : public SwAccessibleContext,
protected:
// Set states for getAccessibleStateSet.
- // This drived class additionaly sets SELECTABLE(1) and SELECTED(+)
+ // This drived class additionally sets SELECTABLE(1) and SELECTED(+)
virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet );
virtual void _InvalidateCursorPos();
@@ -171,9 +174,6 @@ public:
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException );
- SwAccessibleTable *GetTable();
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTableReference;
- SwAccessibleTable *m_pAccTable;
};
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index bac5215b51e2..8d512fce7d2c 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -177,7 +177,7 @@ void SwAccessibleFrameBase::_InvalidateCursorPos()
if( bNewSelected )
{
// remember that object as the one that has the caret. This is
- // neccessary to notify that object if the cursor leaves it.
+ // necessary to notify that object if the cursor leaves it.
::vos::ORef < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx
index be882c005495..fd3630bf0119 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -43,7 +43,7 @@ class SwAccessibleFrameBase : public SwAccessibleContext,
protected:
// Set states for getAccessibleStateSet.
- // This drived class additionaly sets SELECTABLE(1), SELECTED(+),
+ // This drived class additionally sets SELECTABLE(1), SELECTED(+),
// FOCUSABLE(1) and FOCUSED(+)
virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet );
SwFlyFrm* getFlyFrm() const;
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index a038ba43edb7..f4c34746de34 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -19,19 +19,15 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <vos/ref.hxx>
#include <cppuhelper/weakref.hxx>
#include <vcl/window.hxx>
#include <svx/svdmodel.hxx>
#include <svx/unomod.hxx>
#include <tools/debug.hxx>
-
#include <map>
#include <list>
#include <vector>
@@ -61,15 +57,9 @@
#include <IDocumentDrawModelAccess.hxx>
#include <svx/ShapeTypeHandler.hxx>
#include <vcl/svapp.hxx>
-#ifndef _SVX_ACCESSIBILITY_SHAPE_TYPE_HANDLER_HXX
#include <svx/ShapeTypeHandler.hxx>
-#endif
-#ifndef _SVX_ACCESSIBILITY_SVX_SHAPE_TYPES_HXX
#include <svx/SvxShapeTypes.hxx>
-#endif
-#ifndef _SVDPAGE_HXX
#include <svx/svdpage.hxx>
-#endif
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -85,6 +75,7 @@
#include <prevwpage.hxx>
#include <svx/fmmodel.hxx>
#include <switerator.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -679,7 +670,7 @@ class SwAccPreviewData
rectangle; needed to determine the visible part of the logic page rectangle.
@param _rPrevwWinSize
- input paramter - constant reference to the preview window size in TWIP;
+ input parameter - constant reference to the preview window size in TWIP;
needed to determine the visible part of the logic page rectangle
*/
void AdjustLogicPgRectToVisibleArea( SwRect& _iorLogicPgSwRect,
@@ -1062,7 +1053,7 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
break;
case SwAccessibleEvent_Impl::DISPOSE:
// DISPOSE events overwrite all others. They are not stored
- // but executed immediatly to avoid broadcasting of
+ // but executed immediately to avoid broadcasting of
// defunctional objects. So what needs to be done here is to
// remove all events for the frame in question.
bAppendEvent = sal_False;
@@ -2018,7 +2009,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
// focused state then. Sending the focus changes event
// after that seems to be strange. However, we cannot
// send a focus event fo the new context now, because
- // noone except us knows it. In any case, we remeber
+ // no one except us knows it. In any case, we remember
// the new context as the one that has the focus
// currently.
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index 912bfb45f1a0..69cf8008e991 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -90,7 +90,7 @@ void SwAccessiblePage::_InvalidateCursorPos()
if( bNewSelected )
{
// remember that object as the one that has the caret. This is
- // neccessary to notify that object if the cursor leaves it.
+ // necessary to notify that object if the cursor leaves it.
::vos::ORef < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
diff --git a/sw/source/core/access/accpage.hxx b/sw/source/core/access/accpage.hxx
index c4845ba57c2a..39ed1493cc0c 100644
--- a/sw/source/core/access/accpage.hxx
+++ b/sw/source/core/access/accpage.hxx
@@ -49,7 +49,7 @@ protected:
SwRect GetBounds( /* const SwFrm *pFrm =0 */ );
// Set states for getAccessibleStateSet.
- // This drived class additionaly sets
+ // This drived class additionally sets
// FOCUSABLE(1) and FOCUSED(+)
virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet );
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index fea6b93e1716..2edba5f6530d 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -502,7 +502,7 @@ void SwAccessibleParagraph::_InvalidateCursorPos()
if( -1 != nNew )
{
// remember that object as the one that has the caret. This is
- // neccessary to notify that object if the cursor leaves it.
+ // necessary to notify that object if the cursor leaves it.
::vos::ORef < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -845,7 +845,7 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary(
rBound.endPos = nEndPos;
}
}
- // add the " " into the word boundry
+ // add the " " into the word boundary
else
{
rBound = pBreakIt->xBreak->getWordBoundary(rText, nPos, aLocale, nWordType, sal_True );
@@ -1208,7 +1208,7 @@ bool lcl_GetBackgroundColor( Color & rColor,
SwRect aDummyRect;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
if ( pFrm &&
pFrm->GetBackgroundBrush( aFillAttributes, pBackgrdBrush, pSectionTOXColor, aDummyRect, false ) )
@@ -1916,7 +1916,7 @@ uno::Sequence<PropertyValue> SwAccessibleParagraph::getCharacterAttributes(
for( i = 0; i < nLength; i++ )
pIndices[i] = i;
sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) );
- // create sorted sequences accoring to index array
+ // create sorted sequences according to index array
uno::Sequence<PropertyValue> aNewValues( nLength );
PropertyValue* pNewValues = aNewValues.getArray();
for( i = 0; i < nLength; i++ )
@@ -3243,7 +3243,7 @@ sal_Bool SwAccessibleParagraph::setAttributes(
pIndices[i] = i;
sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) );
- // create sorted sequences accoring to index array
+ // create sorted sequences according to index array
uno::Sequence< ::rtl::OUString > aNames( nLength );
::rtl::OUString* pNames = aNames.getArray();
uno::Sequence< uno::Any > aValues( nLength );
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index fcafae708531..24026e01ad73 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -202,7 +202,7 @@ protected:
/// remove the current portion data
void ClearPortionData();
- /// get portion data; update if necesary
+ /// get portion data; update if necessary
SwAccessiblePortionData& GetPortionData()
throw( com::sun::star::uno::RuntimeException )
{
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index 958954331282..9acb0b7e5445 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -194,8 +194,10 @@ void SwTblBoxFormula::ChangeState( const SfxPoolItem* pItem )
{
// und dann in der externen Darstellung
aCopy.PtrToBoxNm( &pTblNd->GetTable() );
- pUpdtFld->pHistory->Add( &aCopy, &aCopy,
- pNd->FindTableBoxStartNode()->GetIndex() );
+ pUpdtFld->pHistory->Add(
+ &aCopy,
+ &aCopy,
+ pNd->FindTableBoxStartNode()->GetIndex());
}
}
else
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 42708db95cbf..80219bcf8735 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -30,8 +30,12 @@
#include <paratr.hxx> // fuer SwParaFmt - SwHyphenBug
#include <swcache.hxx>
#include <fmtcolfunc.hxx>
+
//UUUU
-#include <unobrushitemhelper.hxx>
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
+#include <svx/unobrushitemhelper.hxx>
+#include <svx/xdef.hxx>
+#include <frmatr.hxx>
/*************************************************************************
|* SwFmt::SwFmt
@@ -434,7 +438,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich, sal_Bool bInParents ) const
{
- if(RES_BACKGROUND == nWhich && RES_FLYFRMFMT == Which())
+ if(RES_BACKGROUND == nWhich && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()))
{
//UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
@@ -443,7 +447,7 @@ const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich, sal_Bool bInParents ) c
// fill the local static SvxBrushItem from the current ItemSet so that
// the fill attributes [XATTR_FILL_FIRST .. XATTR_FILL_LAST] are used
// as good as possible to create a fallback representation and return that
- aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, bInParents);
+ aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, RES_BACKGROUND, bInParents);
return aSvxBrushItem;
}
@@ -454,11 +458,11 @@ const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich, sal_Bool bInParents ) c
SfxItemState SwFmt::GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent, const SfxPoolItem **ppItem ) const
{
- if(RES_BACKGROUND == nWhich && RES_FLYFRMFMT == Which())
+ if(RES_BACKGROUND == nWhich && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()))
{
//UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
- const FillAttributesPtr aFill = getFillAttributes();
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFill = getSdrAllFillAttributesHelper();
// check if the new fill attributes are used
if(aFill.get() && aFill->isUsed())
@@ -468,15 +472,17 @@ SfxItemState SwFmt::GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent, con
// to and return as state that it is set
static SvxBrushItem aSvxBrushItem(RES_BACKGROUND);
- aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, bSrchInParent);
- *ppItem = &aSvxBrushItem;
+ aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, RES_BACKGROUND, bSrchInParent);
+ if( ppItem )
+ *ppItem = &aSvxBrushItem;
return SFX_ITEM_SET;
}
// if not, reset pointer and return SFX_ITEM_DEFAULT to signal that
// the item is not set
- *ppItem = 0;
+ if( ppItem )
+ *ppItem = NULL;
return SFX_ITEM_DEFAULT;
}
@@ -496,7 +502,7 @@ sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
sal_Bool bRet = sal_False;
//UUUU
- if(RES_BACKGROUND == rAttr.Which() && RES_FLYFRMFMT == Which())
+ if(RES_BACKGROUND == rAttr.Which() && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()))
{
//UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
@@ -544,12 +550,10 @@ sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
{
if( 0 != ( bRet = (0 != aSet.Put( rAttr ))) )
aSet.SetModifyAtAttr( this );
- // --> OD 2006-11-22 #i71574#
if ( nFmtWhich == RES_TXTFMTCOLL && rAttr.Which() == RES_PARATR_NUMRULE )
{
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this );
}
- // <--
}
else
{
@@ -586,16 +590,27 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
sal_Bool bRet = sal_False;
- //UUUU
- if(RES_FLYFRMFMT == Which())
+ //UUUU Use local copy to be able to apply needed changes, e.g. call
+ // CheckForUniqueItemForLineFillNameOrIndex which is needed for NameOrIndex stuff
+ SfxItemSet aTempSet(rSet);
+
+ //UUUU Need to check for unique item for DrawingLayer items of type NameOrIndex
+ // and evtl. correct that item to ensure unique names for that type. This call may
+ // modify/correct entries inside of the given SfxItemSet
+ if(GetDoc())
+ {
+ GetDoc()->CheckForUniqueItemForLineFillNameOrIndex(aTempSet);
+ }
+
+ //UUUU FlyFrame PageStyle
+ if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())
{
const SfxPoolItem* pSource = 0;
- if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND, sal_False, &pSource))
+ if(SFX_ITEM_SET == aTempSet.GetItemState(RES_BACKGROUND, sal_False, &pSource))
{
//UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
- SfxItemSet aTempSet(rSet);
// copy all items to be set anyways to a local ItemSet with is also prepared for the new
// fill attribute ranges [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Add the attributes
@@ -639,20 +654,18 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
( RES_GRFFMTCOLL == nFmtWhich ||
RES_TXTFMTCOLL == nFmtWhich ) ) )
{
- if( 0 != ( bRet = (0 != aSet.Put( rSet ))) )
+ if( 0 != ( bRet = (0 != aSet.Put( aTempSet ))) )
aSet.SetModifyAtAttr( this );
- // --> OD 2006-11-22 #i71574#
if ( nFmtWhich == RES_TXTFMTCOLL )
{
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this );
}
- // <--
}
else
{
SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
aNew( *aSet.GetPool(), aSet.GetRanges() );
- bRet = 0 != aSet.Put_BC( rSet, &aOld, &aNew );
+ bRet = 0 != aSet.Put_BC( aTempSet, &aOld, &aNew );
if( bRet )
{
// einige Sonderbehandlungen fuer Attribute
@@ -830,7 +843,8 @@ IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() {
//UUUU
const SvxBrushItem& SwFmt::GetBackground(sal_Bool bInP) const
{
- if(RES_FLYFRMFMT == Which())
+ //UUUU FlyFrame PageStyle
+ if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())
{
//UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
@@ -839,7 +853,7 @@ const SvxBrushItem& SwFmt::GetBackground(sal_Bool bInP) const
// fill the local static SvxBrushItem from the current ItemSet so that
// the fill attributes [XATTR_FILL_FIRST .. XATTR_FILL_LAST] are used
// as good as possible to create a fallback representation and return that
- aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, bInP);
+ aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, RES_BACKGROUND, bInP);
return aSvxBrushItem;
}
@@ -848,12 +862,9 @@ const SvxBrushItem& SwFmt::GetBackground(sal_Bool bInP) const
}
//UUUU
-FillAttributesPtr SwFmt::getFillAttributes() const
+drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFmt::getSdrAllFillAttributesHelper() const
{
- // FALLBACKBREAKHERE return empty pointer
- OSL_ENSURE(false, "getFillAttributes() call only valid for RES_FLYFRMFMT currently (!)");
-
- return FillAttributesPtr();
+ return drawinglayer::attribute::SdrAllFillAttributesHelperPtr();
}
// eof
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index 6967e8ee6e32..2d460e2f97d2 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -64,12 +64,16 @@ SwDelTxt::SwDelTxt( xub_StrLen nS, xub_StrLen nL )
-SwUpdateAttr::SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, sal_uInt16 nW )
- : SwMsgPoolItem( RES_UPDATE_ATTR ),
- nStart( nS ),
- nEnd( nE ),
- nWhichAttr( nW )
-{}
+SwUpdateAttr::SwUpdateAttr(
+ xub_StrLen nS,
+ xub_StrLen nE,
+ sal_uInt16 nW)
+: SwMsgPoolItem(RES_UPDATE_ATTR),
+ nStart(nS),
+ nEnd(nE),
+ nWhichAttr(nW)
+{
+}
// SwRefMarkFldUpdate wird verschickt, wenn sich die ReferenzMarkierungen
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 6586d8a36873..6f478f264b9e 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -45,6 +45,7 @@
#include <svx/svdpool.hxx>
#include <svx/sxenditm.hxx>
#include <editeng/editeng.hxx>
+#include <editeng/editeng.hxx>
SwAttrPool::SwAttrPool( SwDoc* pD )
: SfxItemPool( String::CreateFromAscii(
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 066d0e8d0581..c6d7c710f0bc 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -65,6 +65,7 @@
#ifndef _SVX_DIALOGS_HRC
#include <svx/dialogs.hrc>
#endif
+#include <svx/xdef.hxx>
#include <editeng/swafopt.hxx>
#include <editeng/svxacorr.hxx>
#include <unotools/charclass.hxx>
@@ -181,6 +182,10 @@ sal_uInt16 __FAR_DATA aTxtNodeSetRange[] = {
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
// <--
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
+
+ //UUUU FillAttribute support (paragraph FillStyle)
+ XATTR_FILL_FIRST, XATTR_FILL_LAST,
+
0
};
@@ -235,7 +240,7 @@ sal_uInt16 __FAR_DATA aFrmFmtSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
- //UUUU FillAttribute support
+ //UUUU FillAttribute support (TextFrame, OLE, Writer GraphicObject)
XATTR_FILL_FIRST, XATTR_FILL_LAST,
0
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 785d2def1728..5d8ad8997330 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -244,7 +244,7 @@ void SwRect::Justify()
}
-// Similiar to the inline methods, but we need the function pointers
+// Similar to the inline methods, but we need the function pointers
void SwRect::_Width( const long nNew ) { m_Size.setWidth(nNew); }
void SwRect::_Height( const long nNew ) { m_Size.setHeight(nNew); }
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index cbf51e9cd46d..96298c3ad0ff 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3269,7 +3269,7 @@ bool lcl_PosOk(const SwPosition & aPos)
/**
Checks if a PaM is valid. For a PaM to be valid its point must be
- valid. Additionaly if the PaM has a mark this has to be valid, too.
+ valid. Additionally if the PaM has a mark this has to be valid, too.
@param aPam the PaM to check
*/
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 34f06860285b..9a0eece804cc 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -723,7 +723,7 @@ sal_Bool SwCrsrShell::MoveFldType(
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
(SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
- pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() );
+ pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(), pDoc->IsClipBoard() );
pTxtFld->ChgTxtNode( pTNd );
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index f4db117d9bd4..3324462736cf 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -283,7 +283,7 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
nStart = rCntntIdx.GetIndex();
/* #i80135# */
- // if there are SwPostItFields inside our current node text, we split the text into seperate pieces
+ // if there are SwPostItFields inside our current node text, we split the text into separate pieces
// and search for text inside the pieces as well as inside the fields
const SwpHints *pHts = ((SwTxtNode*)pNode)->GetpSwpHints();
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 055ec1fcce71..8934deedc682 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -296,7 +296,7 @@ sal_Bool SwCrsrShell::SelTblBox()
// if we're in a table, create a table cursor, and select the cell
// that the current cursor's point resides in
- // search for start node of our table box. If not found, exit realy
+ // search for start node of our table box. If not found, exit really
const SwStartNode* pStartNode =
pCurCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode();
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 97e3e62d464d..6825e0619c5e 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -815,13 +815,15 @@ void SwShellCrsr::SetMark()
void SwShellCrsr::FillRects()
{
// die neuen Rechtecke berechnen
- if( HasMark() &&
- GetPoint()->nNode.GetNode().IsCntntNode() &&
- GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) &&
- (GetMark()->nNode == GetPoint()->nNode ||
- (GetMark()->nNode.GetNode().IsCntntNode() &&
- GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) ))
- GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() ); //swmod 071107//swmod 071225
+ if ( HasMark()
+ && GetPoint()->nNode.GetNode().IsCntntNode()
+ && GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() )
+ && ( GetMark()->nNode == GetPoint()->nNode
+ || ( GetMark()->nNode.GetNode().IsCntntNode()
+ && GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) ) )
+ {
+ GetShell()->GetLayout()->CalcFrmRects( *this );
+ }
}
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index aefd4a07c723..510a1194de8c 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -19,15 +19,12 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <doc.hxx>
#include <UndoManager.hxx>
#include <hintids.hxx>
-
#include <tools/shl.hxx>
#include <tools/globname.hxx>
#include <svx/svxids.hrc>
@@ -57,7 +54,6 @@
#include <editeng/pbinitem.hxx>
#include <unotools/charclass.hxx>
#include <unotools/localedatawrapper.hxx>
-
#include <swatrset.hxx>
#include <swmodule.hxx>
#include <fmtpdsc.hxx>
@@ -115,25 +111,16 @@
#include <shellres.hxx>
#include <txtfrm.hxx>
#include <attrhint.hxx>
-
#include <wdocsh.hxx> // SwWebDocShell
#include <prtopt.hxx> // SwPrintOptions
-
#include <vector>
#include <map>
-
#include <osl/diagnose.h>
#include <osl/interlck.h>
#include <vbahelper/vbaaccesshelper.hxx>
-
#include "switerator.hxx"
-
-/* @@@MAINTAINABILITY-HORROR@@@
- Probably unwanted dependency on SwDocShell
-*/
-// --> OD 2005-08-29 #125370#
#include <layouter.hxx>
-// <--
+#include <drawdoc.hxx>
#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
@@ -966,38 +953,42 @@ SwFlyFrmFmt* SwDoc::_InsNoTxtNode( const SwPosition& rPos, SwNoTxtNode* pNode,
return pFmt;
}
-SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg,
- const String& rGrfName,
- const String& rFltName,
- const Graphic* pGraphic,
- const SfxItemSet* pFlyAttrSet,
- const SfxItemSet* pGrfAttrSet,
- SwFrmFmt* pFrmFmt )
+
+SwFlyFrmFmt* SwDoc::Insert(
+ const SwPaM &rRg,
+ const String& rGrfName,
+ const String& rFltName,
+ const Graphic* pGraphic,
+ const SfxItemSet* pFlyAttrSet,
+ const SfxItemSet* pGrfAttrSet,
+ SwFrmFmt* pFrmFmt )
{
- if( !pFrmFmt )
+ if ( !pFrmFmt )
pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC );
SwGrfNode* pSwGrfNode = GetNodes().MakeGrfNode(
- SwNodeIndex( GetNodes().GetEndOfAutotext() ),
- rGrfName, rFltName, pGraphic,
- pDfltGrfFmtColl );
- SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode,
- pFlyAttrSet, pGrfAttrSet, pFrmFmt );
- pSwGrfNode->onGraphicChanged();
+ SwNodeIndex( GetNodes().GetEndOfAutotext() ),
+ rGrfName, rFltName, pGraphic,
+ pDfltGrfFmtColl );
+ SwFlyFrmFmt* pSwFlyFrmFmt =
+ _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode, pFlyAttrSet, pGrfAttrSet, pFrmFmt );
return pSwFlyFrmFmt;
}
-SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj,
- const SfxItemSet* pFlyAttrSet,
- const SfxItemSet* pGrfAttrSet,
- SwFrmFmt* pFrmFmt )
+
+
+SwFlyFrmFmt* SwDoc::Insert(
+ const SwPaM &rRg,
+ const GraphicObject& rGrfObj,
+ const SfxItemSet* pFlyAttrSet,
+ const SfxItemSet* pGrfAttrSet,
+ SwFrmFmt* pFrmFmt )
{
- if( !pFrmFmt )
+ if ( !pFrmFmt )
pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC );
SwGrfNode* pSwGrfNode = GetNodes().MakeGrfNode(
- SwNodeIndex( GetNodes().GetEndOfAutotext() ),
- rGrfObj, pDfltGrfFmtColl );
+ SwNodeIndex( GetNodes().GetEndOfAutotext() ),
+ rGrfObj, pDfltGrfFmtColl );
SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode,
- pFlyAttrSet, pGrfAttrSet, pFrmFmt );
- pSwGrfNode->onGraphicChanged();
+ pFlyAttrSet, pGrfAttrSet, pFrmFmt );
return pSwFlyFrmFmt;
}
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 95cc3e57f1c5..4ab36760aa36 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -358,7 +358,6 @@ namespace sw { namespace mark
, m_vBookmarks()
, m_vFieldmarks()
, m_vAnnotationMarks()
- , m_vCommonMarks()
, m_pDoc(&rDoc)
{ }
@@ -444,13 +443,11 @@ namespace sw { namespace mark
case IDocumentMarkAccess::BOOKMARK:
case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
- lcl_InsertMarkSorted(m_vCommonMarks, pMark);
// if(dynamic_cast<IBookmark*>)
lcl_InsertMarkSorted(m_vBookmarks, pMark);
break;
case IDocumentMarkAccess::TEXT_FIELDMARK:
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- lcl_InsertMarkSorted(m_vCommonMarks, pMark);
// if(dynamic_cast<IFieldmark*>
lcl_InsertMarkSorted(m_vFieldmarks, pMark);
break;
@@ -460,7 +457,6 @@ namespace sw { namespace mark
case IDocumentMarkAccess::NAVIGATOR_REMINDER:
case IDocumentMarkAccess::DDE_BOOKMARK:
case IDocumentMarkAccess::UNO_BOOKMARK:
- lcl_InsertMarkSorted(m_vCommonMarks, pMark);
// no special array for these
break;
}
@@ -830,16 +826,6 @@ namespace sw { namespace mark
{
OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Bookmark not found in Bookmark container.");
}
-
- ppBookmark = lcl_FindMark(m_vCommonMarks, *ppMark);
- if ( ppBookmark != m_vCommonMarks.end() )
- {
- m_vCommonMarks.erase(ppBookmark);
- }
- else
- {
- OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Bookmark not found in common mark container.");
- }
}
break;
@@ -862,15 +848,6 @@ namespace sw { namespace mark
pTextFieldmark->ReleaseDoc(m_pDoc);
}
- ppFieldmark = lcl_FindMark(m_vCommonMarks, *ppMark);
- if ( ppFieldmark != m_vCommonMarks.end() )
- {
- m_vCommonMarks.erase(ppFieldmark);
- }
- else
- {
- OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Fieldmark not found in common mark container.");
- }
}
break;
@@ -891,17 +868,7 @@ namespace sw { namespace mark
case IDocumentMarkAccess::NAVIGATOR_REMINDER:
case IDocumentMarkAccess::DDE_BOOKMARK:
case IDocumentMarkAccess::UNO_BOOKMARK:
- {
- IDocumentMarkAccess::iterator_t ppOtherMark = lcl_FindMark(m_vCommonMarks, *ppMark);
- if ( ppOtherMark != m_vCommonMarks.end() )
- {
- m_vCommonMarks.erase(ppOtherMark);
- }
- else
- {
- OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Navigator Reminder, DDE Mark or Uno Makr not found in common mark container.");
- }
- }
+ // no special marks container
break;
}
DdeBookmark* const pDdeBookmark = dynamic_cast<DdeBookmark*>(ppMark->get());
@@ -947,8 +914,6 @@ namespace sw { namespace mark
m_vFieldmarks.clear();
m_vBookmarks.clear();
- m_vCommonMarks.clear();
-
m_vAnnotationMarks.clear();
#ifdef DEBUG
@@ -1006,22 +971,6 @@ namespace sw { namespace mark
{ return dynamic_cast<IFieldmark*>(lcl_getMarkBefore(m_vFieldmarks, rPos)); }
- IDocumentMarkAccess::const_iterator_t MarkManager::getCommonMarksBegin() const
- {
- return m_vCommonMarks.begin();
- }
-
- IDocumentMarkAccess::const_iterator_t MarkManager::getCommonMarksEnd() const
- {
- return m_vCommonMarks.end();
- }
-
- sal_Int32 MarkManager::getCommonMarksCount() const
- {
- return m_vCommonMarks.size();
- }
-
-
IDocumentMarkAccess::const_iterator_t MarkManager::getAnnotationMarksBegin() const
{
return m_vAnnotationMarks.begin();
@@ -1072,7 +1021,6 @@ namespace sw { namespace mark
void MarkManager::sortSubsetMarks()
{
- sort(m_vCommonMarks.begin(), m_vCommonMarks.end(), &lcl_MarkOrderingByStart);
sort(m_vBookmarks.begin(), m_vBookmarks.end(), &lcl_MarkOrderingByStart);
sort(m_vFieldmarks.begin(), m_vFieldmarks.end(), &lcl_MarkOrderingByStart);
sort(m_vAnnotationMarks.begin(), m_vAnnotationMarks.end(), &lcl_MarkOrderingByStart);
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index fcab094a5a5a..85b81cb51eb1 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -62,8 +62,8 @@ namespace
{
//Iterating over all bookmarks, checking DdeBookmarks
const ::rtl::OUString sNameLc = bCaseSensitive ? rName : GetAppCharClass().lower(rName);
- for(IDocumentMarkAccess::const_iterator_t ppMark = rMarkAccess.getCommonMarksBegin();
- ppMark != rMarkAccess.getCommonMarksEnd();
+ for(IDocumentMarkAccess::const_iterator_t ppMark = rMarkAccess.getAllMarksBegin();
+ ppMark != rMarkAccess.getAllMarksEnd();
ppMark++)
{
if ( IDocumentMarkAccess::GetType( *(ppMark->get()) ) == IDocumentMarkAccess::DDE_BOOKMARK)
@@ -162,7 +162,7 @@ sal_Bool lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs )
bool SwDoc::GetData( const String& rItem, const String& rMimeType,
uno::Any & rValue ) const
{
- //search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
+ //search for bookmarks and sections case sensitive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true;
while( true )
{
@@ -201,7 +201,7 @@ bool SwDoc::GetData( const String& rItem, const String& rMimeType,
bool SwDoc::SetData( const String& rItem, const String& rMimeType,
const uno::Any & rValue )
{
- //search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
+ //search for bookmarks and sections case sensitive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true;
while( true )
{
@@ -240,7 +240,7 @@ bool SwDoc::SetData( const String& rItem, const String& rMimeType,
{
SwServerObject* pObj = NULL;
- //search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
+ //search for bookmarks and sections case sensitive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true;
while( true )
{
@@ -380,7 +380,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
return sal_False;
}
- //search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
+ //search for bookmarks and sections case sensitive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true;
while( true )
{
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index d6d915958339..50c859253b97 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -74,7 +72,7 @@
#include <SwUndoPageDesc.hxx>
#include <pagedeschint.hxx>
#include <tgrditem.hxx>
-#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using namespace com::sun::star;
@@ -154,37 +152,72 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
// funktioniert nicht richtig, wenn man unterschiedliche WhichRanges hat.
/////////////// !!!!!!!!!!!!!!!!
//Die interressanten Attribute uebernehmen.
- sal_uInt16 __READONLY_DATA aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
- RES_BACKGROUND, RES_SHADOW,
- RES_COL, RES_COL,
- RES_FRAMEDIR, RES_FRAMEDIR,
- RES_TEXTGRID, RES_TEXTGRID,
- // --> FME 2005-04-18 #i45539#
- RES_HEADER_FOOTER_EAT_SPACING,
- RES_HEADER_FOOTER_EAT_SPACING,
- // <--
- RES_UNKNOWNATR_CONTAINER,
- RES_UNKNOWNATR_CONTAINER,
- 0 };
+ sal_uInt16 __READONLY_DATA aIdArr[] = {
+ RES_FRM_SIZE, RES_UL_SPACE, // [83..86
+ RES_BACKGROUND, RES_SHADOW, // [99..101
+ RES_COL, RES_COL, // [103
+ RES_TEXTGRID, RES_TEXTGRID, // [109
+ RES_FRAMEDIR, RES_FRAMEDIR, // [114
+ RES_HEADER_FOOTER_EAT_SPACING, RES_HEADER_FOOTER_EAT_SPACING, // [115
+ RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, // [143
+
+ //UUUU take over DrawingLayer FillStyles
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014
+
+ 0};
const SfxPoolItem* pItem;
for( sal_uInt16 n = 0; aIdArr[ n ]; n += 2 )
{
for( sal_uInt16 nId = aIdArr[ n ]; nId <= aIdArr[ n+1]; ++nId )
{
- // --> FME 2005-04-18 #i45539#
// bPage == true:
// All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
// bPage == false:
// All in aIdArr except from RES_COL and RES_PAPER_BIN:
- // <--
- if( ( bPage && RES_HEADER_FOOTER_EAT_SPACING != nId ) ||
- ( !bPage && RES_COL != nId && RES_PAPER_BIN != nId ))
+ bool bExecuteId(true);
+
+ if(bPage)
+ {
+ // When Page
+ switch(nId)
+ {
+ // All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
+ case RES_HEADER_FOOTER_EAT_SPACING:
+ //UUUU take out SvxBrushItem; it's the result of the fallback
+ // at SwFmt::GetItemState and not really in state SFX_ITEM_SET
+ case RES_BACKGROUND:
+ bExecuteId = false;
+ break;
+ default:
+ break;
+ }
+ }
+ else
{
- if( SFX_ITEM_SET == rSource.GetItemState( nId, sal_False, &pItem ))
- rDest.SetFmtAttr( *pItem );
+ // When not Page
+ switch(nId)
+ {
+ // When not Page: All in aIdArr except from RES_COL and RES_PAPER_BIN:
+ case RES_COL:
+ case RES_PAPER_BIN:
+ bExecuteId = false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if(bExecuteId)
+ {
+ if(SFX_ITEM_SET == rSource.GetItemState(nId,sal_False,&pItem))
+ {
+ rDest.SetFmtAttr(*pItem);
+ }
else
- rDest.ResetFmtAttr( nId );
+ {
+ rDest.ResetFmtAttr(nId);
+ }
}
}
}
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 9965e5e80e25..2d173bbc7221 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -604,42 +604,13 @@ void SwDoc::InitDrawModel()
if ( pDrawModel )
ReleaseDrawModel();
-//UUUU
-// //DrawPool und EditEnginePool anlegen, diese gehoeren uns und werden
-// //dem Drawing nur mitgegeben. Im ReleaseDrawModel werden die Pools wieder
-// //zerstoert.
-// // 17.2.99: for Bug 73110 - for loading the drawing items. This must
-// // be loaded without RefCounts!
-// SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
-// // #75371# change DefaultItems for the SdrEdgeObj distance items
-// // to TWIPS.
-// if(pSdrPool)
-// {
-// const long nDefEdgeDist = ((500 * 72) / 127); // 1/100th mm in twips
-// pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
-// pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
-// pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
-// pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));
-//
-// // #i33700#
-// // Set shadow distance defaults as PoolDefaultItems. Details see bug.
-// pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
-// pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
-// }
-// SfxItemPool *pEEgPool = EditEngine::CreatePool( sal_False );
-// pSdrPool->SetSecondaryPool( pEEgPool );
-// if ( !GetAttrPool().GetFrozenIdRanges () )
-// GetAttrPool().FreezeIdRanges();
-// else
-// pSdrPool->FreezeIdRanges();
-
// SJ: #95129# set FontHeight pool defaults without changing static SdrEngineDefaults
GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create DrawDocument" );
//Das SdrModel gehoert dem Dokument, wir haben immer zwei Layer und eine
//Seite.
- pDrawModel = new SwDrawDocument( this );
+ pDrawModel = new SwDrawModel( this );
pDrawModel->EnableUndo( GetIDocumentUndoRedo().DoesUndo() );
@@ -852,27 +823,14 @@ void SwDoc::ReleaseDrawModel()
if ( pDrawModel )
{
//!!Den code im sw3io fuer Einfuegen Dokument mitpflegen!!
-
delete pDrawModel; pDrawModel = 0;
-//UUUU
-// SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();
-//
-// ASSERT( pSdrPool, "missing Pool" );
-// SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
-// ASSERT( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
-// pSdrPool->Delete(); //Erst die Items vernichten lassen,
-// //dann erst die Verkettung loesen
-// GetAttrPool().SetSecondaryPool( 0 ); //Der ist ein muss!
-// pSdrPool->SetSecondaryPool( 0 ); //Der ist sicherer
-// SfxItemPool::Free(pSdrPool);
-// SfxItemPool::Free(pEEgPool);
}
}
/*************************************************************************/
-FmFormModel* SwDoc::_MakeDrawModel()
+SwDrawModel* SwDoc::_MakeDrawModel()
{
ASSERT( !pDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
@@ -1002,15 +960,15 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
/* TFFDI: The functions formerly declared 'inline'
*/
-const FmFormModel* SwDoc::GetDrawModel() const { return pDrawModel; }
-FmFormModel* SwDoc::GetDrawModel() { return pDrawModel; }
+const SwDrawModel* SwDoc::GetDrawModel() const { return pDrawModel; }
+SwDrawModel* SwDoc::GetDrawModel() { return pDrawModel; }
SdrLayerID SwDoc::GetHeavenId() const { return nHeaven; }
SdrLayerID SwDoc::GetHellId() const { return nHell; }
SdrLayerID SwDoc::GetControlsId() const { return nControls; }
SdrLayerID SwDoc::GetInvisibleHeavenId() const { return nInvisibleHeaven; }
SdrLayerID SwDoc::GetInvisibleHellId() const { return nInvisibleHell; }
SdrLayerID SwDoc::GetInvisibleControlsId() const { return nInvisibleControls; }
-FmFormModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
+SwDrawModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
// --> OD 2006-03-14 #i62875#
namespace docfunc
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index b3de17928223..b51541272df7 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -849,7 +849,11 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
? pNode->GetpSwpHints()->Count() : 0;
if( nOldAttrCnt != nNewAttrCnt )
{
- SwUpdateAttr aHint( 0, 0, 0 );
+ SwUpdateAttr aHint(
+ 0,
+ 0,
+ 0);
+
pNode->ModifyBroadcast( 0, &aHint, &ImpCheck);
}
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 0dde12813783..93c15dcf2a63 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -2002,7 +2002,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
}
if (bExpand)
- pTxtFld->ExpandAlways();
+ pTxtFld->ExpandTxtFld( true );
}
SetModified();
}
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index d400711548de..bd1d77eaf085 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -34,11 +32,14 @@
#include <svx/xlnstit.hxx>
#include <svx/xlnedit.hxx>
#include <svx/xflhtit.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/xlnstit.hxx>
+#include <svx/xlnedit.hxx>
+#include <svx/xflhtit.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <dcontact.hxx>
-
#include <ndgrf.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
@@ -66,15 +67,12 @@
#include <dflyobj.hxx>
#include <undoflystrattr.hxx>
#include <switerator.hxx>
-
-//UUUU
#include <svx/xbtmpit.hxx>
#include <svx/xflftrit.hxx>
-#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
extern sal_uInt16 GetHtmlMode( const SwDocShell* );
-
using namespace ::com::sun::star;
sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
@@ -438,7 +436,7 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc,
void SwDoc::CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet)
{
- SdrModel* pDrawModel = GetOrCreateDrawModel();
+ SwDrawModel* pDrawModel = GetOrCreateDrawModel();
SfxItemIter aIter(rSet);
for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem; pItem = aIter.NextItem())
@@ -505,13 +503,7 @@ sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
}
- //UUUU Need to check for unique item for DrawingLayer items of type NameOrIndex
- // and evtl. correct that item to ensure unique names for that type. This call may
- // modify/correct entries inside of the given SfxItemSet
- CheckForUniqueItemForLineFillNameOrIndex(rSet);
-
- bool const bRet =
- lcl_SetFlyFrmAttr(*this, &SwDoc::SetFlyFrmAnchor, rFlyFmt, rSet);
+ bool const bRet = lcl_SetFlyFrmAttr(*this, &SwDoc::SetFlyFrmAnchor, rFlyFmt, rSet);
if ( pSaveUndo.get() )
{
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index afd3b34827db..f6ba46ac7fe5 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -116,14 +116,10 @@ struct ParaRstFmt
const SfxItemSet* pDelSet;
sal_uInt16 nWhich;
bool bReset;
- // --> OD 2007-11-06 #i62575#
bool bResetListAttrs;
- // <--
bool bResetAll;
bool bInclRefToxMark;
- bool bKeepOutlineLevelAttr; //#outline level,add by zhaojianwei
-
ParaRstFmt( const SwPosition* pStt, const SwPosition* pEnd,
SwHistory* pHst, sal_uInt16 nWhch = 0, const SfxItemSet* pSet = 0 )
: pFmtColl(0),
@@ -132,14 +128,12 @@ struct ParaRstFmt
pEndNd(pEnd),
pDelSet(pSet),
nWhich(nWhch),
- // --> OD 2007-11-06 #i62675#
bReset( false ),
bResetListAttrs( false ),
- // <--
bResetAll( true ),
- bInclRefToxMark( false ),
- bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
- {}
+ bInclRefToxMark( false )
+ {
+ }
ParaRstFmt( SwHistory* pHst )
: pFmtColl(0),
@@ -148,14 +142,12 @@ struct ParaRstFmt
pEndNd(0),
pDelSet(0),
nWhich(0),
- // --> OD 2007-11-06 #i62675#
bReset( false ),
bResetListAttrs( false ),
- // <--
bResetAll( true ),
- bInclRefToxMark( false ),
- bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
- {}
+ bInclRefToxMark( false )
+ {
+ }
};
/* in pArgs steht die ChrFmtTablle vom Dokument
@@ -197,8 +189,8 @@ sal_Bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
{
- ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
- SwCntntNode* pNode = (SwCntntNode*)rpNd->GetCntntNode();
+ const ParaRstFmt* pPara = (ParaRstFmt*) pArgs;
+ SwCntntNode* pNode = (SwCntntNode*) rpNd->GetCntntNode();
if( pNode && pNode->HasSwAttrSet() )
{
const sal_Bool bLocked = pNode->IsModifyLocked();
@@ -206,31 +198,24 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
SwDoc* pDoc = pNode->GetDoc();
- // --> OD 2008-04-14 #refactorlists#
- // remove unused attribute RES_LR_SPACE
- // add list attributes
- SfxItemSet aSet( pDoc->GetAttrPool(),
- RES_PAGEDESC, RES_BREAK,
- RES_PARATR_NUMRULE, RES_PARATR_NUMRULE,
- RES_PARATR_OUTLINELEVEL,RES_PARATR_OUTLINELEVEL,//#outline level,removed by zhaojianwei
- RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
- 0 );
- const SfxItemSet* pSet = pNode->GetpSwAttrSet();
-
- // --> OD 2008-04-15 #refactorlists#
-// std::vector<sal_uInt16> aClearWhichIds;
+ SfxItemSet aSavedAttrsSet(
+ pDoc->GetAttrPool(),
+ RES_PAGEDESC, RES_BREAK,
+ RES_PARATR_NUMRULE, RES_PARATR_NUMRULE,
+ RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
+ 0 );
+ const SfxItemSet* pAttrSetOfNode = pNode->GetpSwAttrSet();
+
SvUShorts aClearWhichIds;
- // <--
- // --> OD 2008-04-15 #refactorlists#
// restoring all paragraph list attributes
{
SfxItemSet aListAttrSet( pDoc->GetAttrPool(),
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
0 );
- aListAttrSet.Set( *pSet );
+ aListAttrSet.Set( *pAttrSetOfNode );
if ( aListAttrSet.Count() )
{
- aSet.Put( aListAttrSet );
+ aSavedAttrsSet.Put( aListAttrSet );
SfxItemIter aIter( aListAttrSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
while( pItem )
@@ -240,94 +225,72 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
}
}
}
- // <--
const SfxPoolItem* pItem;
- // sal_uInt16 __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK, //#outline level,removed by zhaojianwei
- // RES_PARATR_NUMRULE };
- //for( sal_uInt16 n = 0; n < 3; ++n )
- sal_uInt16 __READONLY_DATA aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
- RES_PARATR_NUMRULE,
- RES_PARATR_OUTLINELEVEL };
- for( sal_uInt16 n = 0; n < 4; ++n ) //<-end,zhaojianwei
- {
- if( SFX_ITEM_SET == pSet->GetItemState( aSavIds[ n ], sal_False, &pItem ))
+ sal_uInt16 __READONLY_DATA aSavIds[3] =
+ { RES_PAGEDESC, RES_BREAK, RES_PARATR_NUMRULE };
+ for ( sal_uInt16 n = 0; n < 3; ++n )
+ {
+ if ( SFX_ITEM_SET == pAttrSetOfNode->GetItemState( aSavIds[n], sal_False, &pItem ) )
{
bool bSave = false;
- switch( aSavIds[ n ] )
+ switch (aSavIds[n])
{
- case RES_PAGEDESC:
- bSave = 0 != ((SwFmtPageDesc*)pItem)->GetPageDesc();
+ case RES_PAGEDESC:
+ bSave = 0 != ( (SwFmtPageDesc*) pItem )->GetPageDesc();
break;
- case RES_BREAK:
- bSave = SVX_BREAK_NONE != ((SvxFmtBreakItem*)pItem)->GetBreak();
+ case RES_BREAK:
+ bSave = SVX_BREAK_NONE != ( (SvxFmtBreakItem*) pItem )->GetBreak();
break;
- case RES_PARATR_NUMRULE:
- {
- bSave = 0 != ((SwNumRuleItem*)pItem)->GetValue().Len();
- }
+ case RES_PARATR_NUMRULE:
+ bSave = 0 != ( (SwNumRuleItem*) pItem )->GetValue().Len();
break;
- case RES_PARATR_OUTLINELEVEL: //#outline level,add by zhaojianwei
- {
- bSave = pPara && pPara->bKeepOutlineLevelAttr;
- }
- break; //<-end,zhaojianwei
}
- if( bSave )
+ if ( bSave )
{
- aSet.Put( *pItem );
- // --> OD 2008-04-15 #refactorlists#
-// aClearWhichIds.push_back( aSavIds[n] );
+ aSavedAttrsSet.Put( *pItem );
aClearWhichIds.Insert( aSavIds[n], aClearWhichIds.Count() );
}
}
}
- // --> OD 2008-04-14 #refactorlists#
// do not clear items directly from item set and only clear to be kept
// attributes, if no deletion item set is found.
-// pNode->ClearItemsFromAttrSet( aClearWhichIds );
const bool bKeepAttributes =
!pPara || !pPara->pDelSet || pPara->pDelSet->Count() == 0;
if ( bKeepAttributes )
{
pNode->ResetAttr( aClearWhichIds );
}
- // <--
if( !bLocked )
pNode->UnlockModify();
- if( pPara )
+ if ( pPara )
{
SwRegHistory aRegH( pNode, *pNode, pPara->pHistory );
- if( pPara->pDelSet && pPara->pDelSet->Count() )
+ if ( pPara->pDelSet && pPara->pDelSet->Count() )
{
- // --> OD 2008-04-15 #refactorlists#
ASSERT( !bKeepAttributes,
"<lcl_RstAttr(..)> - certain attributes are kept, but not needed. -> please inform OD" );
- // <--
SfxItemIter aIter( *pPara->pDelSet );
pItem = aIter.FirstItem();
- while( sal_True )
+ while ( sal_True )
{
- // --> OD 2008-04-14 #refactorlists#
- //
if ( ( pItem->Which() != RES_PAGEDESC &&
pItem->Which() != RES_BREAK &&
pItem->Which() != RES_PARATR_NUMRULE ) ||
- ( aSet.GetItemState( pItem->Which(), sal_False ) != SFX_ITEM_SET ) )
+ ( aSavedAttrsSet.GetItemState( pItem->Which(), sal_False ) != SFX_ITEM_SET ) )
{
pNode->ResetAttr( pItem->Which() );
}
- // <--
- if( aIter.IsAtEnd() )
+ if ( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
}
}
- else if( pPara->bResetAll )
+ else if ( pPara->bResetAll )
pNode->ResetAllAttr();
else
pNode->ResetAttr( RES_PARATR_BEGIN, POOLATTR_END - 1 );
@@ -335,22 +298,21 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
else
pNode->ResetAllAttr();
- // --> OD 2008-04-15 #refactorlists#
// only restore saved attributes, if needed
- if ( bKeepAttributes && aSet.Count() )
- // <--
+ if ( bKeepAttributes && aSavedAttrsSet.Count() )
{
pNode->LockModify();
- pNode->SetAttr( aSet );
+ pNode->SetAttr( aSavedAttrsSet );
- if( !bLocked )
+ if ( !bLocked )
pNode->UnlockModify();
}
}
return sal_True;
}
+
void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark )
{
SwHistory* pHst = 0;
@@ -590,7 +552,8 @@ static bool lcl_InsAttr(
|| isPARATR_LIST(nWhich)
|| isFRMATR(nWhich)
|| isGRFATR(nWhich)
- || isUNKNOWNATR(nWhich) )
+ || isUNKNOWNATR(nWhich)
+ || isDrawingLayerAttribute(nWhich) ) //UUUU
{
pOtherSet = &rChgSet;
bOtherAttr = true;
@@ -617,6 +580,10 @@ static bool lcl_InsAttr(
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
+
+ //UUUU FillAttribute support
+ XATTR_FILL_FIRST, XATTR_FILL_LAST,
+
0 );
pTmpCharItemSet->Put( rChgSet );
@@ -921,7 +888,14 @@ static bool lcl_InsAttr(
if( pOtherSet && pOtherSet->Count() )
{
SwRegHistory aRegH( pNode, *pNode, pHistory );
- bRet = pNode->SetAttr( *pOtherSet ) || bRet;
+
+ //UUUU Need to check for unique item for DrawingLayer items of type NameOrIndex
+ // and evtl. correct that item to ensure unique names for that type. This call may
+ // modify/correct entries inside of the given SfxItemSet
+ SfxItemSet aTempLocalCopy(*pOtherSet);
+
+ pDoc->CheckForUniqueItemForLineFillNameOrIndex(aTempLocalCopy);
+ bRet = pNode->SetAttr(aTempLocalCopy) || bRet;
}
DELETECHARSETS
@@ -1309,7 +1283,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
{
aCallMod.Add( pDfltGrfFmtColl );
}
- else if (isFRMATR(nWhich))
+ else if (isFRMATR(nWhich) || isDrawingLayerAttribute(nWhich) ) //UUUU
{
aCallMod.Add( pDfltGrfFmtColl );
aCallMod.Add( pDfltTxtFmtColl );
@@ -1734,23 +1708,17 @@ void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, sal_Bool bBroadcast )
sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
{
- // ParaSetFmtColl * pPara = (ParaSetFmtColl*)pArgs;
- SwCntntNode* pCNd = (SwCntntNode*)rpNode->GetTxtNode();
- if( pCNd )
+ SwCntntNode* pCNd = (SwCntntNode*) rpNode->GetTxtNode();
+ if ( pCNd )
{
- ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
+ ParaRstFmt* pPara = (ParaRstFmt*) pArgs;
- SwTxtFmtColl* pFmt = static_cast<SwTxtFmtColl*>(pPara->pFmtColl);
+ SwTxtFmtColl* pFmt = static_cast< SwTxtFmtColl* >( pPara->pFmtColl );
if ( pPara->bReset )
{
- if( pFmt->GetAttrOutlineLevel() == 0 && pPara )
- pPara->bKeepOutlineLevelAttr = true;
-
lcl_RstAttr( pCNd, pPara );
- // --> OD 2007-11-06 #i62675#
- // --> OD 2008-04-15 #refactorlists#
// check, if paragraph style has changed
if ( pPara->bResetListAttrs &&
pFmt != pCNd->GetFmtColl() &&
@@ -1778,7 +1746,6 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
if ( bChangeOfListStyleAtParagraph )
{
- // --> OD 2008-04-08 #refactorlists#
std::auto_ptr< SwRegHistory > pRegH;
if ( pPara->pHistory )
{
@@ -1794,9 +1761,7 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
pCNd->ResetAttr( RES_PARATR_LIST_ID );
}
- // <--
}
- // <--
}
// erst in die History aufnehmen, damit ggfs. alte Daten
@@ -1812,10 +1777,12 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
return sal_True;
}
-sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
- SwTxtFmtColl *pFmt,
- bool bReset,
- bool bResetListAttrs )
+
+sal_Bool SwDoc::SetTxtFmtColl(
+ const SwPaM &rRg,
+ SwTxtFmtColl *pFmt,
+ const bool bReset,
+ const bool bResetListAttrs )
{
SwDataChanged aTmp( rRg, 0 );
const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
@@ -1824,11 +1791,9 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
if (GetIDocumentUndoRedo().DoesUndo())
{
- // --> OD 2008-04-15 #refactorlists#
SwUndoFmtColl* pUndo = new SwUndoFmtColl( rRg, pFmt,
bReset,
bResetListAttrs );
- // <--
pHst = pUndo->GetHistory();
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
@@ -1836,17 +1801,18 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
ParaRstFmt aPara( pStt, pEnd, pHst );
aPara.pFmtColl = pFmt;
aPara.bReset = bReset;
- // --> OD 2007-11-06 #i62675#
aPara.bResetListAttrs = bResetListAttrs;
- // <--
GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1,
lcl_SetTxtFmtColl, &aPara );
- if( !aPara.nWhich )
+ if ( !aPara.nWhich )
bRet = sal_False; // keinen gueltigen Node gefunden
- if( bRet )
+ if ( bRet )
+ {
SetModified();
+ }
+
return bRet;
}
@@ -1942,11 +1908,9 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
pNewColl->CopyAttrs( rColl, sal_True );
// setze noch den Outline-Level
- //if( NO_NUMBERING != rColl.GetOutlineLevel() ) //#outline level,zhaojianwei
- // pNewColl->SetOutlineLevel( rColl.GetOutlineLevel() );
- if(rColl.IsAssignedToListLevelOfOutlineStyle())
- pNewColl->AssignToListLevelOfOutlineStyle(rColl.GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
- //<-end
+ if ( rColl.IsAssignedToListLevelOfOutlineStyle() )
+ pNewColl->AssignToListLevelOfOutlineStyle( rColl.GetAssignedOutlineStyleLevel() );
+
pNewColl->SetPoolFmtId( rColl.GetPoolFmtId() );
pNewColl->SetPoolHelpId( rColl.GetPoolHelpId() );
@@ -2099,11 +2063,8 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
rDestArr, pSrcColl->GetNextTxtFmtColl().GetName() ) );
// setze noch den Outline-Level
- //if( NO_NUMBERING != pSrcColl->GetOutlineLevel() ) //#outline level,zhaojianwei
- // pDstColl->SetOutlineLevel( pSrcColl->GetOutlineLevel() );
if(pSrcColl->IsAssignedToListLevelOfOutlineStyle())
- pDstColl->AssignToListLevelOfOutlineStyle(pSrcColl->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
- //<-end
+ pDstColl->AssignToListLevelOfOutlineStyle(pSrcColl->GetAssignedOutlineStyleLevel());
//FEATURE::CONDCOLL
if( RES_CONDTXTFMTCOLL == pSrc->Which() )
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 1d2cd54117b6..e7392512d3df 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -125,8 +125,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
{
// wenn keine OutlineNumerierung ist, dann benutze eigenes Array
// und sammel die Nodes zusammen.
- //if( NO_NUMBERING == pSplitColl->GetOutlineLevel() )//#outline level,zhaojianwei
- if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814
+ if( pSplitColl->GetAttrOutlineLevel() == 0 )
{
pOutlNds = new SwOutlineNodes( 8, 8 );
SwIterator<SwTxtNode,SwFmtColl> aIter( *pSplitColl );
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 436fb8046fe2..efecbce72822 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -45,7 +43,6 @@
#include <svx/fmpage.hxx>
#include <editeng/frmdiritem.hxx>
#include <svx/svdlegacy.hxx>
-
#include <swmodule.hxx>
#include <modcfg.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -97,15 +94,10 @@
#include <pagedesc.hxx>
#include <PostItMgr.hxx>
#include <comcore.hrc> // STR-ResId's
-
-// #i11176#
#include <unoframe.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-
-// --> OD 2004-07-26 #i32089#
#include <vector>
-// <--
+#include <drawdoc.hxx>
#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index ab3bd935203c..d0847fc2659d 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -119,6 +119,8 @@
#include <sfx2/Metadatable.hxx>
#include <fmtmeta.hxx> // MetaFieldManager
+//UUUU
+#include <svx/xfillit0.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::document;
@@ -303,6 +305,21 @@ SwDoc::SwDoc()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" );
+ //UUUU The DrawingLayer ItemPool which is used as 2nd pool for Writer documents' pool
+ // has a default for the XFillStyleItem of XFILL_SOLID and the color for it is the default
+ // fill color (blue7 or similar). This is a problem, in Writer we want the default fill
+ // style to be XFILL_NONE. This cannot simply be done by changing it in the 2nd pool at the
+ // pool defaults when the DrawingLayer ItemPool is used for Writer, that would lead to
+ // countless problems like DrawObjects initial fill and others.
+ // It is also hard to find all places where the initial ItemSets for Writer (including
+ // style hierarchies) are created and to always set (but only at the root) the FillStyle
+ // to NONE fixed; that will add that attribute to the file format. It will be hard to reset
+ // attribbute sets (which is done at import and using UI). Also not a good solution.
+ // Luckily Writer uses pDfltTxtFmtColl as default parent for all paragraphs and similar, thus
+ // it is possible to set this attribute here. It will be not reset when importing.
+ pDfltTxtFmtColl->SetFmtAttr(XFillStyleItem(XFILL_NONE));
+ pDfltFrmFmt->SetFmtAttr(XFillStyleItem(XFILL_NONE));
+
mbGlossDoc =
mbModified =
mbDtor =
@@ -752,27 +769,25 @@ SfxPrinter& SwDoc::CreatePrinter_() const
void SwDoc::SetDocShell( SwDocShell* pDSh )
{
- if( pDocShell != pDSh )
+ if(pDocShell != pDSh)
{
if (pDocShell)
{
pDocShell->SetUndoManager(0);
}
+
pDocShell = pDSh;
+
if (pDocShell)
{
pDocShell->SetUndoManager(& GetUndoManager());
}
- pLinkMgr->SetPersist( pDocShell );
- //JP 27.08.98: Bug 55570 - DocShell Pointer auch am DrawModel setzen
- if( pDrawModel )
- {
- ((SwDrawDocument*)pDrawModel)->SetObjectShell( pDocShell );
- pDrawModel->SetPersist( pDocShell );
- ASSERT( pDrawModel->GetPersist() == GetPersist(),
- "draw model's persist is out of sync" );
- }
+ pLinkMgr->SetPersist(pDocShell);
+
+ // set DocShell pointer also on DrawModel
+ InitDrawModelAndDocShell(pDocShell, GetDrawModel());
+ OSL_ENSURE(!pDrawModel || pDrawModel->GetPersist() == GetPersist(), "draw model's persist is out of sync");
}
}
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 55fe518ef346..a685be9c9fdf 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -334,7 +334,7 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
}
/* If moving of the outline levels is applicable, i.e. for all
- outline levels occuring in the document there has to be a valid
+ outline levels occurring in the document there has to be a valid
target outline level implied by aMoveArr. */
bool bMoveApplicable = true;
for (n = nSttPos; n < nEndPos; n++)
@@ -467,7 +467,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
// If the given range ends at an outlined text node we have to decide if it has to be a part of
// the moving range or not. Normally it will be a sub outline of our chapter
// and has to be moved, too. But if the chapter ends with a table(or a section end),
- // the next text node will be choosen and this could be the next outline of the same level.
+ // the next text node will be chosen and this could be the next outline of the same level.
// The criteria has to be the outline level: sub level => incorporate, same/higher level => no.
if( GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
{
@@ -492,8 +492,8 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
// The following code corrects the range to handle sections (start/end nodes)
// The range will be extended if the least node before the range is a start node
// which ends inside the range => The complete section will be moved.
- // The range will be shrinked if the last position is a start node.
- // The range will be shrinked if the last node is an end node which starts before the range.
+ // The range will be shrunk if the last position is a start node.
+ // The range will be shrunk if the last node is an end node which starts before the range.
aSttRg--;
while( aSttRg.GetNode().IsStartNode() )
{
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index fb3574317bcf..6a0f3924348a 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -3273,16 +3273,23 @@ void SwRedline::InvalidateRange() // das Layout anstossen
nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (sal_uInt16)nTmp;
}
- SwUpdateAttr aHt( 0, 0, RES_FMT_CHG );
SwNodes& rNds = GetDoc()->GetNodes();
- SwNode* pNd;
- for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
- if( ND_TEXTNODE == ( pNd = rNds[ n ] )->GetNodeType() )
+
+ for(sal_uLong n(nSttNd); n <= nEndNd; ++n)
+ {
+ SwNode* pNode = rNds[n];
+
+ if(pNode && ND_TEXTNODE == pNode->GetNodeType())
{
- aHt.nStart = n == nSttNd ? nSttCnt : 0;
- aHt.nEnd = n == nEndNd ? nEndCnt : ((SwTxtNode*)pNd)->GetTxt().Len();
- ((SwTxtNode*)pNd)->ModifyNotification( &aHt, &aHt );
+ SwTxtNode* pNd = static_cast< SwTxtNode* >(pNode);
+ SwUpdateAttr aHt(
+ n == nSttNd ? nSttCnt : 0,
+ n == nEndNd ? nEndCnt : pNd->GetTxt().Len(),
+ RES_FMT_CHG);
+
+ pNd->ModifyNotification(&aHt, &aHt);
}
+ }
}
/*************************************************************************
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 7da4265f1fb0..ab0e19a8ee80 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -546,7 +546,7 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
delete to. This is done by first searching forward from the
end of the TOX' section. If no content node is found behind
the TOX one is searched before it. If this is not
- successfull, too, insert new text node behind the end of
+ successful, too, insert new text node behind the end of
the TOX' section. The cursors from the TOX' section will be
moved to the content node found or the new text node. */
@@ -1532,24 +1532,24 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
TOX_OBJECTS != SwTOXBase::GetType() )
{
const SwTxtNode* pOutlNd = ::lcl_FindChapterNode( *pCNd,
- MAXLEVEL - 1 );
- if( pOutlNd )
+ MAXLEVEL - 1 );
+ if ( pOutlNd )
{
- //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nTmp < NO_NUMBERING )
- // nSetLevel = nTmp + 1;
- if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
- nSetLevel = pOutlNd->GetTxtColl()->GetAttrOutlineLevel() ;//<-end,zhaojianwei
+ if ( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() )
+ {
+ nSetLevel = pOutlNd->GetTxtColl()->GetAttrOutlineLevel();
+ }
}
}
- if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && ( !IsFromChapter() ||
- ::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
+ if ( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && ( !IsFromChapter() ||
+ ::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ) )
{
- SwTOXPara * pNew = new SwTOXPara( *pCNd, eMyType,
- ( USHRT_MAX != nSetLevel )
- ? static_cast<sal_uInt16>(nSetLevel)
- : FORM_ALPHA_DELIMITTER );
+ SwTOXPara * pNew =
+ new SwTOXPara(
+ *pCNd,
+ eMyType,
+ ( USHRT_MAX != nSetLevel ) ? static_cast< sal_uInt16 >( nSetLevel ) : FORM_ALPHA_DELIMITTER );
InsertSorted( pNew );
}
}
@@ -1581,30 +1581,27 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
SwNodeIndex aCntntIdx( *pTblNd, 1 );
SwCntntNode* pCNd;
- while( 0 != ( pCNd = rNds.GoNext( &aCntntIdx ) ) &&
- aCntntIdx.GetIndex() < pTblNd->EndOfSectionIndex() )
+ while (0 != ( pCNd = rNds.GoNext( &aCntntIdx ) ) &&
+ aCntntIdx.GetIndex() < pTblNd->EndOfSectionIndex())
{
- if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && (!IsFromChapter() ||
- ::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
+ if ( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() )
+ && ( !IsFromChapter()
+ || ::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ) )
{
SwTOXTable * pNew = new SwTOXTable( *pCNd );
- if( IsLevelFromChapter() && TOX_TABLES != SwTOXBase::GetType())
+ if ( IsLevelFromChapter() && TOX_TABLES != SwTOXBase::GetType() )
{
- const SwTxtNode* pOutlNd =
- ::lcl_FindChapterNode( *pCNd, MAXLEVEL - 1 );
- if( pOutlNd )
+ const SwTxtNode* pOutlNd = ::lcl_FindChapterNode( *pCNd, MAXLEVEL - 1 );
+ if ( pOutlNd )
{
- //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nTmp < NO_NUMBERING )
- // pNew->SetLevel( nTmp + 1 );
- if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
+ if ( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() )
{
const int nTmp = pOutlNd->GetTxtColl()->GetAttrOutlineLevel();
- pNew->SetLevel( static_cast<sal_uInt16>(nTmp) );//<-end ,zhaojianwei
+ pNew->SetLevel( static_cast< sal_uInt16 >( nTmp ) );
}
}
}
- InsertSorted(pNew);
+ InsertSorted( pNew );
break;
}
}
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 3f37cde57c76..a523b5614ed4 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -60,17 +60,14 @@ namespace TxtFmtCollFunc
return;
}
- // --> OD 2007-01-24 #i73790#
- // if ( pTxtFmtColl->AssignedToListLevelOfOutlineStyle() )
- if ( !pTxtFmtColl->StayAssignedToListLevelOfOutlineStyle() &&
- pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
- // <--
+ if ( !pTxtFmtColl->StayAssignedToListLevelOfOutlineStyle()
+ && pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
{
- if ( !pNewNumRuleItem )
+ if ( pNewNumRuleItem == NULL )
{
pTxtFmtColl->GetItemState( RES_PARATR_NUMRULE, sal_False, (const SfxPoolItem**)&pNewNumRuleItem );
}
- if ( pNewNumRuleItem )
+ if ( pNewNumRuleItem != NULL )
{
String sNumRuleName = pNewNumRuleItem->GetValue();
if ( sNumRuleName.Len() == 0 ||
@@ -82,7 +79,7 @@ namespace TxtFmtCollFunc
}
}
}
- // <--
+
SwNumRule* GetNumRule( SwTxtFmtColl& rTxtFmtColl )
{
@@ -207,7 +204,6 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_CHRATR_CTL_FONTSIZE:
aFontSizeArr[2] = (SvxFontHeightItem*)pNew;
break;
- // --> OD 2006-10-17 #i70223#
case RES_PARATR_NUMRULE:
{
if ( bAssignedToListLevelOfOutlineStyle )
@@ -215,17 +211,16 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pNewNumRuleItem = (SwNumRuleItem*)pNew;
}
}
+ break;
default:
break;
}
- // --> OD 2006-10-17 #i70223#
- if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
+ if ( bAssignedToListLevelOfOutlineStyle
+ && pNewNumRuleItem != NULL )
{
- TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle(
- this, pNewNumRuleItem );
+ TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this, pNewNumRuleItem );
}
- // <--
int bWeiter = sal_True;
@@ -411,28 +406,24 @@ sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
}
// <--
-// --> OD 2007-01-24 #i73790#
+
sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
{
const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
mbStayAssignedToListLevelOfOutlineStyle = true;
- // --> OD 2008-12-16 #i70748#
// Outline level is no longer a member, it is a attribute now.
// Thus, it needs to be restored, if the paragraph style is assigned
// to the outline style
const int nAssignedOutlineStyleLevel = IsAssignedToListLevelOfOutlineStyle()
? GetAssignedOutlineStyleLevel()
: -1;
- // <--
sal_uInt16 nRet = SwFmtColl::ResetAllFmtAttr();
- // --> OD 2008-12-16 #i70748#
if ( nAssignedOutlineStyleLevel != -1 )
{
AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
}
- // <--
mbStayAssignedToListLevelOfOutlineStyle = bOldState;
@@ -649,7 +640,9 @@ void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
aCondColls.Insert( pNew, n );
}
}
-//#outline level, zhaojianwei
+//FEATURE::CONDCOLL
+
+
void SwTxtFmtColl::SetAttrOutlineLevel( int nLevel)
{
ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
@@ -657,24 +650,26 @@ void SwTxtFmtColl::SetAttrOutlineLevel( int nLevel)
static_cast<sal_uInt16>(nLevel) ) );
}
+
int SwTxtFmtColl::GetAttrOutlineLevel() const
{
- return ((const SfxUInt16Item &)GetFmtAttr(RES_PARATR_OUTLINELEVEL)).GetValue();
+ return ( (const SfxUInt16Item &) GetFmtAttr( RES_PARATR_OUTLINELEVEL ) ).GetValue();
}
+
int SwTxtFmtColl::GetAssignedOutlineStyleLevel() const
{
ASSERT( IsAssignedToListLevelOfOutlineStyle(),
- "<SwTxtFmtColl::GetAssignedOutlineStyleLevel()> - misuse of method");
+ "<SwTxtFmtColl::GetAssignedOutlineStyleLevel()> - misuse of method" );
return GetAttrOutlineLevel() - 1;
}
+
void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
{
mbAssignedToOutlineStyle = true;
- SetAttrOutlineLevel(nAssignedListLevel+1);
+ SetAttrOutlineLevel( nAssignedListLevel + 1 );
- // --> OD 2009-03-18 #i100277#
SwIterator<SwTxtFmtColl,SwFmtColl> aIter( *this );
SwTxtFmtColl* pDerivedTxtFmtColl = aIter.First();
while ( pDerivedTxtFmtColl != 0 )
@@ -694,14 +689,16 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
pDerivedTxtFmtColl = aIter.Next();
}
- // <--
}
-void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle()
+
+void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle(
+ const bool bResetOutlineLevel )
{
mbAssignedToOutlineStyle = false;
- ResetFmtAttr(RES_PARATR_OUTLINELEVEL);
+ if ( bResetOutlineLevel )
+ {
+ ResetFmtAttr( RES_PARATR_OUTLINELEVEL );
+ }
}
-//<-end,zhaojianwei
-//FEATURE::CONDCOLL
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 00632e02e93f..717e9f60f790 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -77,6 +77,8 @@
#include <drawinglayer/processor2d/processor2dtools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
+#include <vcl/pdfextoutdevdata.hxx>
+#include <svtools/filter.hxx>
using namespace com::sun::star;
@@ -236,7 +238,7 @@ void lcl_ClearArea( const SwFrm &rFrm,
const SvxBrushItem *pItem; const Color *pCol; SwRect aOrigRect;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
if ( rFrm.GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigRect, sal_False ) )
{
@@ -909,7 +911,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
{
//#i78025# charts own borders are not completely visible
//the above pixel correction is not correct - at least not for charts
- //so a different pixel correction is choosen here
+ //so a different pixel correction is chosen here
//this might be a good idea for all other OLE objects also,
//but as I cannot oversee the consequences I fix it only for charts for now
lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
@@ -1005,19 +1007,63 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
basegfx::tools::createScaleTranslateB2DHomMatrix(
aTargetRange.getRange(),
aTargetRange.getMinimum()));
- drawinglayer::primitive2d::Primitive2DSequence aContent;
+ drawinglayer::primitive2d::Primitive2DSequence aContent(1);
+ bool bDone(false);
+
+ // #i125171# The mechanism to get lossless jpegs into pdf is based on having the original
+ // file data (not the bitmap data) at the Graphic in the GfxLink (which has *nothing* to
+ // do with the graphic being linked). This works well for DrawingLayer GraphicObjects (linked
+ // and unlinked) but fails for linked Writer GraphicObjects. These have the URL in the
+ // GraphicObject, but no GfxLink with the original file data when it's a linked graphic.
+ // Since this blows up PDF size by a factor of 10 (the graphics get embedded as pixel maps
+ // then) it is okay to add this workarund: In the needed case, load the graphic in a way to
+ // get the GfxLink in the needed form and use that Graphic temporarily. Do this only when
+ // - we have PDF export
+ // - the GraphicObject is linked
+ // - the Graphic has no GfxLink
+ // - LosslessCompression is activated
+ // - it's indeed a jpeg graphic (could be checked by the url ending, but is more reliable to check later)
+ // In all other cases (normal repaint, print, etc...) use the available Graphic with the
+ // already loaded pixel graphic as before this change.
+ if(pOut->GetExtOutDevData() && rGrfObj.HasLink() && !rGrfObj.GetGraphic().IsLink())
+ {
+ const vcl::PDFExtOutDevData* pPDFExt = dynamic_cast< const vcl::PDFExtOutDevData* >(pOut->GetExtOutDevData());
+
+ if(pPDFExt && pPDFExt->GetIsLosslessCompression())
+ {
+ Graphic aTempGraphic;
+ INetURLObject aURL(rGrfObj.GetLink());
+
+ if(GRFILTER_OK == GraphicFilter::GetGraphicFilter()->ImportGraphic(aTempGraphic, aURL))
+ {
+ if(aTempGraphic.IsLink() && GFX_LINK_TYPE_NATIVE_JPG == aTempGraphic.GetLink().GetType())
+ {
+ aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
+ aTargetTransform,
+ aTempGraphic,
+ aGrfAttr);
+ bDone = true;
+ }
+ }
+ }
+ }
- aContent.realloc(1);
- aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
- aTargetTransform,
- rGrfObj.GetGraphic(),
- aGrfAttr);
+ if(!bDone)
+ {
+ aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
+ aTargetTransform,
+ rGrfObj.GetGraphic(),
+ aGrfAttr);
+ }
paintUsingPrimitivesHelper(
*pOut,
aContent,
aTargetRange,
aTargetRange);
+
+ // need to reset the timer manually (was in original paints at GraphicManager)
+ rGrfObj.restartSwapOutTimer();
}
}
else
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index b8028e3f38c7..21ab23623967 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -27,6 +27,7 @@
#include <hintids.hxx>
#include <i18npool/mslangid.hxx>
#include <unotools/localedatawrapper.hxx>
+#include <svx/xdef.hxx>
#include <editeng/paperinf.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/fontitem.hxx>
@@ -69,6 +70,8 @@
#include <GetMetricVal.hxx>
#include <numrule.hxx>
+//UUUU
+#include <svx/xfillit0.hxx>
using namespace ::com::sun::star;
@@ -402,6 +405,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
aSet.Put(aScriptSpace);
}
}
+
break;
case RES_POOLCOLL_TEXT: // Textkoerper
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 65314c6f3228..2aeec71876cb 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -83,12 +83,14 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
bUnLockView = !pESh->IsViewLocked();
pESh->LockView( sal_True );
}
- const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
+ const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid(false);
const SwTxtAttr* pAttr = pTxtAttr;
- SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
- *pAttr->End(),
- RES_FMT_CHG );
- ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
+ SwUpdateAttr aUpdateAttr(
+ *pAttr->GetStart(),
+ *pAttr->End(),
+ RES_FMT_CHG);
+
+ const_cast< SwTxtNode* >(pTxtNd)->ModifyNotification(&aUpdateAttr, &aUpdateAttr);
}
if( bAction )
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index aaf3785b8a33..424d3aaa3fea 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -282,7 +282,6 @@ Graphic SwNoTxtNode::GetGraphic() const
return aRet;
}
-// --> OD 2009-07-14 #i73249#
void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast )
{
// Title attribute of <SdrObject> replaces own AlternateText attribute
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index c128dd10f7b9..b174e82cb59c 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1117,7 +1117,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV
case RES_UPDATE_ATTR:
if( GetNodes().IsDocNodes() && IsTxtNode() )
{
- const sal_uInt16 nTmp = ((SwUpdateAttr*)pNewValue)->nWhichAttr;
+ const sal_uInt16 nTmp = ((SwUpdateAttr*)pNewValue)->getWhichAttr();
if ( RES_ATTRSET_CHG == nTmp )
{
// anybody wants to do some optimization here?
@@ -2090,6 +2090,12 @@ SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnly
return pNodes;
}
+//UUUU
+drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwCntntNode::getSdrAllFillAttributesHelper() const
+{
+ return drawinglayer::attribute::SdrAllFillAttributesHelperPtr();
+}
+
//FEATURE::CONDCOLL
// Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
// os: nur fuer ICC, da der zum optimieren zu dumm ist
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 5689afdefd6f..f1d282066605 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1260,7 +1260,7 @@ void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
// Der Return-Wert gibt an, was mit der Shell zu geschehen hat:
// 0 - Fehler, konnte DocShell nicht finden
// 1 - DocShell ist ein existieren Document
-// 2 - DocShell wurde neu angelegt, muss also wieder geschlossen werden ( will be assigned to xLockRef additionaly )
+// 2 - DocShell wurde neu angelegt, muss also wieder geschlossen werden ( will be assigned to xLockRef additionally )
int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
SfxObjectShellLock& xLockRef,
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index c9897b43892d..d8a4b8d9ab31 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include "hintids.hxx"
@@ -74,10 +72,10 @@
#include <svx/svdetc.hxx>
#include <switerator.hxx>
#include <algorithm>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
-
void setContextWritingMode( SdrObject* pObj, SwFrm* pAnchor )
{
if( pObj && pAnchor )
@@ -1214,7 +1212,7 @@ void SwDrawContact::HandleChanged(
SdrHintKind eHint)
{
// OD 2004-06-01 #i26791# - no event handling, if existing <ViewShell>
- // is in contruction
+ // is in construction
SwDoc* pDoc = GetFmt()->GetDoc();
if ( pDoc->GetCurrentViewShell() &&
pDoc->GetCurrentViewShell()->IsInConstructor() )
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 8ec1a493119d..976ae9fdce77 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <basic/basmgr.hxx>
@@ -32,9 +30,7 @@
#include <fmturl.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <shellres.hxx>
#include <viewimp.hxx>
#include <pagefrm.hxx>
@@ -46,21 +42,20 @@
#include <dpage.hxx>
#include <dcontact.hxx>
#include <dflyobj.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <usrfld.hxx>
#include <flyfrm.hxx>
#include <ndnotxt.hxx>
#include <grfatr.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <dview.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::frame;
-SwDPage::SwDPage(SwDrawDocument& rNewModel, bool bMasterPage) :
+SwDPage::SwDPage(SwDrawModel& rNewModel, bool bMasterPage) :
FmFormPage(rNewModel, 0, bMasterPage),
pGridLst( 0 ),
rDoc(rNewModel.GetDoc())
@@ -95,10 +90,10 @@ void SwDPage::copyDataFromSdrPage(const SdrPage& rSource)
SdrPage* SwDPage::CloneSdrPage(SdrModel* pTargetModel) const
{
- SwDrawDocument* pSwDrawDocument = static_cast< SwDrawDocument* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
- OSL_ENSURE(dynamic_cast< SwDrawDocument* >(pSwDrawDocument), "Wrong SdrModel type in SwDPage clone (!)");
+ SwDrawModel* pSwDrawModel = static_cast< SwDrawModel* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< SwDrawModel* >(pSwDrawModel), "Wrong SdrModel type in SwDPage clone (!)");
SwDPage* pClone = new SwDPage(
- *pSwDrawDocument,
+ *pSwDrawModel,
IsMasterPage());
OSL_ENSURE(pClone, "CloneSdrPage error (!)");
pClone->copyDataFromSdrPage(*this);
@@ -153,7 +148,7 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg )
const SdrPageGridFrameList* SwDPage::GetGridFrameList(
const SdrView& rSdrView, const Rectangle *pRect ) const
{
- ViewShell *pSh = ((SwDrawDocument&)getSdrModelFromSdrPage()).GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225
+ ViewShell *pSh = static_cast< SwDrawModel& >(getSdrModelFromSdrPage()).GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225
if ( pSh )
{
while ( pSh->Imp()->GetDrawView() != &rSdrView )
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 97be74795925..c32e0d7abbdd 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -62,37 +62,16 @@ const String GetPalettePath()
return aPathOpt.GetPalettePath();
}
-SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
- FmFormModel( ::GetPalettePath(), &pD->GetAttrPool(), pD->GetDocShell() ),
+SwDrawModel::SwDrawModel( SwDoc* pD )
+: FmFormModel( ::GetPalettePath(), &pD->GetAttrPool(), pD->GetDocShell() ),
pDoc( pD )
{
SetExchangeObjectUnit( MAP_TWIP );
SetSwapGraphics( true );
- SwDocShell* pDocSh = pDoc->GetDocShell();
- if ( pDocSh )
- {
- SetObjectShell( pDocSh );
- SvxColorTableItem* pColItem = ( SvxColorTableItem* )
- ( pDocSh->GetItem( SID_COLOR_TABLE ) );
- XColorListSharedPtr aXCol = pColItem ?
- pColItem->GetColorTable() :
- XColorList::GetStdColorList();
- SetColorTableAtSdrModel( aXCol );
-
- if ( !pColItem )
- pDocSh->PutItem( SvxColorTableItem( aXCol, SID_COLOR_TABLE ) );
-
- pDocSh->PutItem( SvxGradientListItem( GetGradientListFromSdrModel(), SID_GRADIENT_LIST ));
- pDocSh->PutItem( SvxHatchListItem( GetHatchListFromSdrModel(), SID_HATCH_LIST ) );
- pDocSh->PutItem( SvxBitmapListItem( GetBitmapListFromSdrModel(), SID_BITMAP_LIST ) );
- pDocSh->PutItem( SvxDashListItem( GetDashListFromSdrModel(), SID_DASH_LIST ) );
- pDocSh->PutItem( SvxLineEndListItem( GetLineEndListFromSdrModel(), SID_LINEEND_LIST ) );
- pDocSh->PutItem( SfxUInt16Item(SID_ATTR_LINEEND_WIDTH_DEFAULT, 111) );
- SetObjectShell( pDocSh );
- }
- else
- SetColorTableAtSdrModel( XColorList::GetStdColorList() );
+ // use common InitDrawModelAndDocShell which will set the associations as needed,
+ // including SvxColorTableItem with WhichID SID_COLOR_TABLE
+ InitDrawModelAndDocShell(pDoc ? pDoc->GetDocShell() : 0, this);
// copy all the default values to the SdrModel
SfxItemPool* pSdrPool = pD->GetAttrPool().GetSecondaryPool();
@@ -137,7 +116,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
\************************************************************************/
-SwDrawDocument::~SwDrawDocument()
+SwDrawModel::~SwDrawModel()
{
Broadcast(SdrBaseHint(HINT_MODELCLEARED));
@@ -155,7 +134,7 @@ SwDrawDocument::~SwDrawDocument()
\************************************************************************/
-SdrPage* SwDrawDocument::AllocPage(bool bMasterPage)
+SdrPage* SwDrawModel::AllocPage(bool bMasterPage)
{
SwDPage* pPage = new SwDPage(*this, 0 != bMasterPage);
pPage->SetName( String::CreateFromAscii(
@@ -164,7 +143,7 @@ SdrPage* SwDrawDocument::AllocPage(bool bMasterPage)
}
-SvStream* SwDrawDocument::GetDocumentStream( SdrDocumentStreamInfo& rInfo ) const
+SvStream* SwDrawModel::GetDocumentStream( SdrDocumentStreamInfo& rInfo ) const
{
SvStream* pRet = NULL;
uno::Reference < embed::XStorage > xRoot( pDoc->GetDocStorage() );
@@ -204,14 +183,14 @@ SvStream* SwDrawDocument::GetDocumentStream( SdrDocumentStreamInfo& rInfo ) cons
return pRet;
}
-SdrLayerID SwDrawDocument::GetControlExportLayerId( const SdrObject & ) const
+SdrLayerID SwDrawModel::GetControlExportLayerId( const SdrObject & ) const
{
//fuer Versionen < 5.0, es gab nur Hell und Heaven
return (SdrLayerID)pDoc->GetHeavenId();
}
// --> OD 2006-03-01 #b6382898#
-uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
+uno::Reference< uno::XInterface > SwDrawModel::createUnoModel()
{
uno::Reference< uno::XInterface > xModel;
@@ -225,14 +204,13 @@ uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
}
catch( uno::RuntimeException& )
{
- ASSERT( false,
- "<SwDrawDocument::createUnoModel()> - could *not* retrieve model at <SwDocShell>" );
+ ASSERT( false, "<SwDrawModel::createUnoModel()> - could *not* retrieve model at <SwDocShell>" );
}
return xModel;
}
-bool SwDrawDocument::IsWriter() const
+bool SwDrawModel::IsWriter() const
{
return true;
}
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 85af11af58af..df23a38a5eda 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -66,7 +66,7 @@ SwTxtFmtColl& SwEditShell::GetTxtFmtColl( sal_uInt16 nFmtColl) const
// --> OD 2007-11-06 #i62675#
void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
- bool bResetListAttrs )
+ const bool bResetListAttrs )
{
SwTxtFmtColl *pLocal = pFmt? pFmt: (*GetDoc()->GetTxtFmtColls())[0];
StartAllAction();
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index c390287e46b4..dfbad1422ffd 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1678,7 +1678,7 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar
SetCurrX( new SwPosition( *pCrsr->GetMark() ));
//if an error has been found go back to the text
- //preceeding the error
+ //preceding the error
if(xSpellRet.is())
{
*pCrsr->GetPoint() = aSaveStartPos;
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index bc63d52afb2e..593e53424548 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -352,7 +352,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
SwTOXSortTabBase* pOld = aSortArr[i];
if(*pOld == *pNew)
{
- //only the first occurence in the document
+ //only the first occurrence in the document
//has to be in the array
if(*pOld < *pNew)
DELETEZ(pNew);
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 3817c64a3a3c..f04b960fe632 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -19,15 +19,11 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <com/sun/star/embed/EmbedMisc.hpp>
-
#include "hintids.hxx"
-
#include <svx/sdrobjectfilter.hxx>
#include <svx/svditer.hxx>
#include <svx/svdobj.hxx>
@@ -88,6 +84,7 @@
#include <svx/fmmodel.hxx>
#include <svx/svdview.hxx>
#include <switerator.hxx>
+#include <drawdoc.hxx>
#include <svx/obj3d.hxx>
#define SCROLLVAL 75
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 05a50b7960f6..4cbee095f376 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <hintids.hxx>
@@ -60,96 +58,123 @@
#include <retrieveinputstreamconsumer.hxx>
#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
-
+#include <unotools/cacheoptions.hxx>
using namespace com::sun::star;
+#define SWAPGRAPHIC_TIMEOUT 5000
+
+// For comments see same method used in svx
+sal_uInt32 getCacheTimeInMs()
+{
+ static bool bSetAtAll(true);
+
+ if(bSetAtAll)
+ {
+ static bool bSetToPreferenceTime(true);
+
+ if(bSetToPreferenceTime)
+ {
+ const SvtCacheOptions aCacheOptions;
+ const sal_Int32 nSeconds(aCacheOptions.GetGraphicManagerObjectReleaseTime());
+
+ return nSeconds * 1000 / 12;
+ }
+ else
+ {
+ return SWAPGRAPHIC_TIMEOUT;
+ }
+ }
+
+ return 0;
+}
+
// --------------------
// SwGrfNode
// --------------------
SwGrfNode::SwGrfNode(
- const SwNodeIndex & rWhere,
- const String& rGrfName, const String& rFltName,
- const Graphic* pGraphic,
- SwGrfFmtColl *pGrfColl,
- SwAttrSet* pAutoAttr ) :
- SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- maGrfObj(),
- mpReplacementGraphic(0),
- // --> OD 2007-01-23 #i73788#
- mbLinkedInputStreamReady( false ),
- mbIsStreamReadOnly( sal_False )
- // <--
+ const SwNodeIndex & rWhere,
+ const String& rGrfName,
+ const String& rFltName,
+ const Graphic* pGraphic,
+ SwGrfFmtColl *pGrfColl,
+ SwAttrSet* pAutoAttr )
+ : SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
+ maGrfObj(),
+ mpReplacementGraphic( 0 ),
+ mbLinkedInputStreamReady( false ),
+ mbIsStreamReadOnly( sal_False )
{
- maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
- bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
- bFrameInPaint = bScaleImageMap = sal_False;
+ maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ), getCacheTimeInMs() );
+ bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf = bFrameInPaint = bScaleImageMap = sal_False;
bGrafikArrived = sal_True;
- ReRead(rGrfName,rFltName, pGraphic, 0, sal_False);
+ ReRead( rGrfName, rFltName, pGraphic, 0, sal_False );
}
-SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
- const GraphicObject& rGrfObj,
- SwGrfFmtColl *pGrfColl, SwAttrSet* pAutoAttr ) :
- SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- maGrfObj(rGrfObj),
- mpReplacementGraphic(0),
- // --> OD 2007-01-23 #i73788#
- mbLinkedInputStreamReady( false ),
- mbIsStreamReadOnly( sal_False )
- // <--
+SwGrfNode::SwGrfNode(
+ const SwNodeIndex & rWhere,
+ const GraphicObject& rGrfObj,
+ SwGrfFmtColl *pGrfColl,
+ SwAttrSet* pAutoAttr )
+ : SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
+ maGrfObj( rGrfObj ),
+ mpReplacementGraphic( 0 ),
+ mbLinkedInputStreamReady( false ),
+ mbIsStreamReadOnly( sal_False )
{
maGrfObj = rGrfObj;
- maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
- if( rGrfObj.HasUserData() && rGrfObj.IsSwappedOut() )
+ maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ), getCacheTimeInMs() );
+ if ( rGrfObj.HasUserData() && rGrfObj.IsSwappedOut() )
maGrfObj.SetSwapState();
- bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel= bLoadLowResGrf =
- bFrameInPaint = bScaleImageMap = sal_False;
+ bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf = bFrameInPaint = bScaleImageMap = sal_False;
bGrafikArrived = sal_True;
}
// Konstruktor fuer den SW/G-Reader. Dieser ctor wird verwendet,
// wenn eine gelinkte Grafik gelesen wird. Sie liest diese NICHT ein.
-
-SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
- const String& rGrfName, const String& rFltName,
- SwGrfFmtColl *pGrfColl,
- SwAttrSet* pAutoAttr ) :
- SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- maGrfObj(),
- mpReplacementGraphic(0),
- // --> OD 2007-01-23 #i73788#
- mbLinkedInputStreamReady( false ),
- mbIsStreamReadOnly( sal_False )
- // <--
+SwGrfNode::SwGrfNode(
+ const SwNodeIndex & rWhere,
+ const String& rGrfName,
+ const String& rFltName,
+ SwGrfFmtColl *pGrfColl,
+ SwAttrSet* pAutoAttr )
+ :
+ SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
+ maGrfObj(),
+ mpReplacementGraphic( 0 ),
+ mbLinkedInputStreamReady( false ),
+ mbIsStreamReadOnly( sal_False )
{
- maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+ maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ), getCacheTimeInMs() );
- Graphic aGrf; aGrf.SetDefaultType();
+ Graphic aGrf;
+ aGrf.SetDefaultType();
maGrfObj.SetGraphic( aGrf, rGrfName );
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
- bFrameInPaint = bScaleImageMap = sal_False;
+ bFrameInPaint = bScaleImageMap = sal_False;
bGrafikArrived = sal_True;
InsertLink( rGrfName, rFltName );
- if( IsLinkedFile() )
+ if ( IsLinkedFile() )
{
INetURLObject aUrl( rGrfName );
- if( INET_PROT_FILE == aUrl.GetProtocol() &&
- FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) ))
+ if ( INET_PROT_FILE == aUrl.GetProtocol() &&
+ FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) ) )
{
// File vorhanden, Verbindung herstellen ohne ein Update
- ((SwBaseLink*)&refLink)->Connect();
+ ( (SwBaseLink*) &refLink )->Connect();
}
}
}
sal_Bool SwGrfNode::ReRead(
- const String& rGrfName, const String& rFltName,
- const Graphic* pGraphic, const GraphicObject* pGrfObj,
+ const String& rGrfName,
+ const String& rFltName,
+ const Graphic* pGraphic,
+ const GraphicObject* pGrfObj,
sal_Bool bNewGrf )
{
sal_Bool bReadGrf = sal_False, bSetTwipSize = sal_True;
@@ -157,22 +182,22 @@ sal_Bool SwGrfNode::ReRead(
mpReplacementGraphic = 0;
ASSERT( pGraphic || pGrfObj || rGrfName.Len(),
- "GraphicNode without a name, Graphic or GraphicObject" );
+ "GraphicNode without a name, Graphic or GraphicObject" );
// ReadRead mit Namen
- if( refLink.Is() )
+ if ( refLink.Is() )
{
ASSERT( !bInSwapIn, "ReRead: stehe noch im SwapIn" );
- if( rGrfName.Len() )
+ if ( rGrfName.Len() )
{
// Besonderheit: steht im FltNamen DDE, handelt es sich um eine
// DDE-gelinkte Grafik
String sCmd( rGrfName );
- if( rFltName.Len() )
+ if ( rFltName.Len() )
{
sal_uInt16 nNewType;
- if( rFltName.EqualsAscii( "DDE" ))
+ if ( rFltName.EqualsAscii( "DDE" ) )
nNewType = OBJECT_CLIENT_DDE;
else
{
@@ -180,10 +205,10 @@ sal_Bool SwGrfNode::ReRead(
nNewType = OBJECT_CLIENT_GRF;
}
- if( nNewType != refLink->GetObjType() )
+ if ( nNewType != refLink->GetObjType() )
{
refLink->Disconnect();
- ((SwBaseLink*)&refLink)->SetObjType( nNewType );
+ ( (SwBaseLink*) &refLink )->SetObjType( nNewType );
}
}
@@ -195,16 +220,16 @@ sal_Bool SwGrfNode::ReRead(
refLink.Clear();
}
- if( pGraphic )
+ if ( pGraphic )
{
maGrfObj.SetGraphic( *pGraphic, rGrfName );
onGraphicChanged();
bReadGrf = sal_True;
}
- else if( pGrfObj )
+ else if ( pGrfObj )
{
maGrfObj = *pGrfObj;
- if( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
+ if ( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
maGrfObj.SetSwapState();
maGrfObj.SetLink( rGrfName );
onGraphicChanged();
@@ -215,112 +240,100 @@ sal_Bool SwGrfNode::ReRead(
// MIB 25.02.97: Daten der alten Grafik zuruecksetzen, damit
// die korrekte Ersatz-Darstellung erscheint, wenn die
// der neue Link nicht geladen werden konnte.
- Graphic aGrf; aGrf.SetDefaultType();
+ Graphic aGrf;
+ aGrf.SetDefaultType();
maGrfObj.SetGraphic( aGrf, rGrfName );
- if( refLink.Is() )
+ if ( refLink.Is() )
{
- if( getLayoutFrm( GetDoc()->GetCurrentLayout() ) )
+ if ( getLayoutFrm( GetDoc()->GetCurrentLayout() ) )
{
SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE );
ModifyNotification( &aMsgHint, &aMsgHint );
}
- // --> OD 2006-11-03 #i59688#
- // do not load linked graphic, if it isn't a new linked graphic.
-// else {
else if ( bNewGrf )
- // <--
{
//TODO refLink->setInputStream(getInputStream());
- ((SwBaseLink*)&refLink)->SwapIn();
+ ( (SwBaseLink*) &refLink )->SwapIn();
}
}
onGraphicChanged();
bSetTwipSize = sal_False;
}
}
- else if( pGraphic && !rGrfName.Len() )
+ else if ( pGraphic && !rGrfName.Len() )
{
// MIB 27.02.2001: Old stream must be deleted before the new one is set.
- if( HasStreamName() )
+ if ( HasEmbeddedStreamName() )
DelStreamName();
maGrfObj.SetGraphic( *pGraphic );
onGraphicChanged();
bReadGrf = sal_True;
}
- else if( pGrfObj && !rGrfName.Len() )
+ else if ( pGrfObj && !rGrfName.Len() )
{
// MIB 27.02.2001: Old stream must be deleted before the new one is set.
- if( HasStreamName() )
+ if ( HasEmbeddedStreamName() )
DelStreamName();
maGrfObj = *pGrfObj;
onGraphicChanged();
- if( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
+ if ( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
maGrfObj.SetSwapState();
bReadGrf = sal_True;
}
- // Import einer Grafik:
- // Ist die Grafik bereits geladen?
- else if( !bNewGrf && GRAPHIC_NONE != maGrfObj.GetType() )
+ else if ( !bNewGrf && GRAPHIC_NONE != maGrfObj.GetType() )
return sal_True;
else
{
- if( HasStreamName() )
+ if ( HasEmbeddedStreamName() )
DelStreamName();
// einen neuen Grafik-Link anlegen
InsertLink( rGrfName, rFltName );
- if( GetNodes().IsDocNodes() )
+ if ( GetNodes().IsDocNodes() )
{
- if( pGraphic )
+ if ( pGraphic )
{
maGrfObj.SetGraphic( *pGraphic, rGrfName );
onGraphicChanged();
bReadGrf = sal_True;
// Verbindung herstellen ohne ein Update; Grafik haben wir!
- ((SwBaseLink*)&refLink)->Connect();
+ ( (SwBaseLink*) &refLink )->Connect();
}
- else if( pGrfObj )
+ else if ( pGrfObj )
{
maGrfObj = *pGrfObj;
maGrfObj.SetLink( rGrfName );
onGraphicChanged();
bReadGrf = sal_True;
// Verbindung herstellen ohne ein Update; Grafik haben wir!
- ((SwBaseLink*)&refLink)->Connect();
+ ( (SwBaseLink*) &refLink )->Connect();
}
else
{
- // MIB 25.02.97: Daten der alten Grafik zuruecksetzen, damit
- // die korrekte Ersatz-Darstellung erscheint, wenn die
- // der neue Kink nicht geladen werden konnte.
- Graphic aGrf; aGrf.SetDefaultType();
+ Graphic aGrf;
+ aGrf.SetDefaultType();
maGrfObj.SetGraphic( aGrf, rGrfName );
onGraphicChanged();
- // --> OD 2006-11-03 #i59688#
- // do not load linked graphic, if it isn't a new linked graphic.
-// //TODO refLink->setInputStream(getInputStream());
-// ((SwBaseLink*)&refLink)->SwapIn();
if ( bNewGrf )
{
- ((SwBaseLink*)&refLink)->SwapIn();
+ ( (SwBaseLink*) &refLink )->SwapIn();
}
- // <--
}
}
}
// Bug 39281: Size nicht sofort loeschen - Events auf ImageMaps
// sollten nicht beim Austauschen nicht ins "leere greifen"
- if( bSetTwipSize )
+ if ( bSetTwipSize )
SetTwipSize( ::GetGraphicSizeTwip( maGrfObj.GetGraphic(), 0 ) );
// erzeuge noch einen Update auf die Frames
- if( bReadGrf && bNewGrf )
+ if ( bReadGrf && bNewGrf )
{
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
ModifyNotification( &aMsgHint, &aMsgHint );
@@ -329,18 +342,15 @@ sal_Bool SwGrfNode::ReRead(
return bReadGrf;
}
-
SwGrfNode::~SwGrfNode()
{
delete mpReplacementGraphic;
mpReplacementGraphic = 0;
- // --> OD 2007-03-30 #i73788#
mpThreadConsumer.reset();
- // <--
SwDoc* pDoc = GetDoc();
- if( refLink.Is() )
+ if ( refLink.Is() )
{
ASSERT( !bInSwapIn, "DTOR: stehe noch im SwapIn" );
pDoc->GetLinkManager().Remove( refLink );
@@ -348,7 +358,7 @@ SwGrfNode::~SwGrfNode()
}
else
{
- // --> OD 2005-01-19 #i40014# - A graphic node, which are in linked
+ // #i40014# - A graphic node, which are in linked
// section, whose link is another section is the document, doesn't
// have to remove the stream from the storage.
// Because it's hard to detect this case here and it would only fix
@@ -359,11 +369,10 @@ SwGrfNode::~SwGrfNode()
// inside one document have to be implemented.
// if( !pDoc->IsInDtor() && HasStreamName() )
// DelStreamName();
- // <--
}
//#39289# Die Frames muessen hier bereits geloescht weil der DTor der
//Frms die Grafik noch fuer StopAnimation braucht.
- if( GetDepends() )
+ if ( GetDepends() )
DelFrms();
}
@@ -373,29 +382,31 @@ void SwGrfNode::onGraphicChanged()
// try to access SwFlyFrmFmt; since title/desc/name are set there, there is no
// use to continue if it is not yet set. If not yet set, call onGraphicChanged()
// when it is set.
- SwFlyFrmFmt* pFlyFmt = dynamic_cast< SwFlyFrmFmt* >(GetFlyFmt());
+ SwFlyFrmFmt* pFlyFmt = dynamic_cast< SwFlyFrmFmt* >( GetFlyFmt() );
- if(pFlyFmt)
+ if ( pFlyFmt != NULL )
{
+ const bool bWasSwappedOut = ( GetGrfObj().IsSwappedOut() == sal_True );
+
String aName;
String aTitle;
String aDesc;
const SvgDataPtr& rSvgDataPtr = GetGrf().getSvgData();
- if(rSvgDataPtr.get())
+ if ( rSvgDataPtr.get() )
{
- const drawinglayer::primitive2d::Primitive2DSequence aSequence(rSvgDataPtr->getPrimitive2DSequence());
+ const drawinglayer::primitive2d::Primitive2DSequence aSequence( rSvgDataPtr->getPrimitive2DSequence() );
- if(aSequence.hasElements())
+ if ( aSequence.hasElements() )
{
drawinglayer::geometry::ViewInformation2D aViewInformation2D;
- drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor(aViewInformation2D);
+ drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor( aViewInformation2D );
- aProcessor.process(aSequence);
+ aProcessor.process( aSequence );
const drawinglayer::primitive2d::ObjectInfoPrimitive2D* pResult = aProcessor.getResult();
- if(pResult)
+ if ( pResult )
{
aName = pResult->getName();
aTitle = pResult->getTitle();
@@ -404,95 +415,99 @@ void SwGrfNode::onGraphicChanged()
}
}
- // do not use this currently; it seems that this name has to be unique in
- // the writer model and is already set to some default
- //if(aName.Len() && pFlyFmt)
- //{
- // pFlyFmt->SetName(aName);
- //}
+ if ( aTitle.Len() > 0 )
+ {
+ SetTitle( aTitle );
+ }
+ else if ( aName.Len() > 0 )
+ {
+ SetTitle( aName );
+ }
- if(aTitle.Len())
+ if ( aDesc.Len() > 0 )
{
- SetTitle(aTitle);
+ SetDescription( aDesc );
}
- if(aDesc.Len())
+ if ( bWasSwappedOut )
{
- SetDescription(aDesc);
+ SwapOut();
}
}
}
-void SwGrfNode::SetGraphic(const Graphic& rGraphic, const String& rLink)
+void SwGrfNode::SetGraphic(
+ const Graphic& rGraphic,
+ const String& rLink )
{
- maGrfObj.SetGraphic(rGraphic, rLink);
+ maGrfObj.SetGraphic( rGraphic, rLink );
onGraphicChanged();
}
const GraphicObject* SwGrfNode::GetReplacementGrfObj() const
{
- if(!mpReplacementGraphic)
+ if ( !mpReplacementGraphic )
{
const SvgDataPtr& rSvgDataPtr = GetGrfObj().GetGraphic().getSvgData();
- if(rSvgDataPtr.get())
+ if ( rSvgDataPtr.get() )
{
- const_cast< SwGrfNode* >(this)->mpReplacementGraphic = new GraphicObject(rSvgDataPtr->getReplacement());
+ const_cast< SwGrfNode* >( this )->mpReplacementGraphic = new GraphicObject( rSvgDataPtr->getReplacement() );
}
}
return mpReplacementGraphic;
}
-SwCntntNode *SwGrfNode::SplitCntntNode( const SwPosition & )
+SwCntntNode *SwGrfNode::SplitCntntNode(
+ const SwPosition & )
{
return this;
}
-
-SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
- const String& rGrfName,
- const String& rFltName,
- const Graphic* pGraphic,
- SwGrfFmtColl* pGrfColl,
- SwAttrSet* pAutoAttr,
- sal_Bool bDelayed )
+SwGrfNode * SwNodes::MakeGrfNode(
+ const SwNodeIndex & rWhere,
+ const String& rGrfName,
+ const String& rFltName,
+ const Graphic* pGraphic,
+ SwGrfFmtColl* pGrfColl,
+ SwAttrSet* pAutoAttr,
+ sal_Bool bDelayed )
{
ASSERT( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
SwGrfNode *pNode;
// Delayed erzeugen nur aus dem SW/G-Reader
- if( bDelayed )
+ if ( bDelayed )
pNode = new SwGrfNode( rWhere, rGrfName,
- rFltName, pGrfColl, pAutoAttr );
+ rFltName, pGrfColl, pAutoAttr );
else
pNode = new SwGrfNode( rWhere, rGrfName,
- rFltName, pGraphic, pGrfColl, pAutoAttr );
+ rFltName, pGraphic, pGrfColl, pAutoAttr );
return pNode;
}
-SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
- const GraphicObject& rGrfObj,
- SwGrfFmtColl* pGrfColl,
- SwAttrSet* pAutoAttr )
+SwGrfNode * SwNodes::MakeGrfNode(
+ const SwNodeIndex & rWhere,
+ const GraphicObject& rGrfObj,
+ SwGrfFmtColl* pGrfColl,
+ SwAttrSet* pAutoAttr )
{
ASSERT( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
return new SwGrfNode( rWhere, rGrfObj, pGrfColl, pAutoAttr );
}
-
Size SwGrfNode::GetTwipSize() const
{
return nGrfSize;
}
-
-
-sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
+sal_Bool SwGrfNode::ImportGraphic(
+ SvStream& rStrm )
{
Graphic aGraphic;
- const String aURL(maGrfObj.GetUserData());
+ const String aURL( maGrfObj.GetUserData() );
- if(!GraphicFilter::GetGraphicFilter()->ImportGraphic(aGraphic, aURL, rStrm))
+ if ( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, aURL, rStrm ) )
{
delete mpReplacementGraphic;
mpReplacementGraphic = 0;
@@ -511,25 +526,26 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
// 0 : nicht geladen
// 1 : Einlesen erfolgreich
-short SwGrfNode::SwapIn( sal_Bool bWaitForData )
+short SwGrfNode::SwapIn(
+ sal_Bool bWaitForData )
{
- if( bInSwapIn ) // nicht rekuriv!!
+ if ( bInSwapIn ) // nicht rekuriv!!
return !maGrfObj.IsSwappedOut();
short nRet = 0;
bInSwapIn = sal_True;
- SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
+ SwBaseLink* pLink = (SwBaseLink*) (::sfx2::SvBaseLink*) refLink;
- if( pLink )
+ if ( pLink )
{
- if( GRAPHIC_NONE == maGrfObj.GetType() ||
- GRAPHIC_DEFAULT == maGrfObj.GetType() )
+ if ( GRAPHIC_NONE == maGrfObj.GetType() ||
+ GRAPHIC_DEFAULT == maGrfObj.GetType() )
{
// noch nicht geladener Link
//TODO pLink->setInputStream(getInputStream());
- if( pLink->SwapIn( bWaitForData ) )
+ if ( pLink->SwapIn( bWaitForData ) )
nRet = -1;
- else if( GRAPHIC_DEFAULT == maGrfObj.GetType() )
+ else if ( GRAPHIC_DEFAULT == maGrfObj.GetType() )
{
// keine default Bitmap mehr, also neu Painten!
delete mpReplacementGraphic;
@@ -541,7 +557,8 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
ModifyNotification( &aMsgHint, &aMsgHint );
}
}
- else if( maGrfObj.IsSwappedOut() ) {
+ else if ( maGrfObj.IsSwappedOut() )
+ {
// nachzuladender Link
//TODO pLink->setInputStream(getInputStream());
nRet = pLink->SwapIn( bWaitForData ) ? 1 : 0;
@@ -549,24 +566,19 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
else
nRet = 1;
}
- else if( maGrfObj.IsSwappedOut() )
+ else if ( maGrfObj.IsSwappedOut() )
{
// Die Grafik ist im Storage oder im TempFile drin
- if( !HasStreamName() )
- nRet = (short)maGrfObj.SwapIn();
+ if ( !HasEmbeddedStreamName() )
+ nRet = (short) maGrfObj.SwapIn();
else
{
- // --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
- // --> OD, MAV 2005-08-17 #i53025# - needed correction of new
- // method <_GetStreamForEmbedGrf(..)>
-// bool bGraphic(false);
-// SvStream* pStrm = _GetStreamForEmbedGrf( bGraphic );
String aStrmName, aPicStgName;
_GetStreamStorageNames( aStrmName, aPicStgName );
- uno::Reference < embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
+ uno::Reference< embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
if ( pStrm )
{
@@ -574,18 +586,14 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
nRet = 1;
delete pStrm;
}
- // <--
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
ASSERT( false, "<SwGrfNode::SwapIn(..)> - unhandled exception!" );
- // <--
}
- // <--
}
- if( 1 == nRet )
+ if ( 1 == nRet )
{
SwMsgPoolItem aMsg( RES_GRAPHIC_SWAPIN );
ModifyNotification( &aMsg, &aMsg );
@@ -595,30 +603,30 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
nRet = 1;
DBG_ASSERTWARNING( nRet, "Grafik kann nicht eingeswapt werden" );
- if( nRet )
+ if ( nRet )
{
- if( !nGrfSize.Width() && !nGrfSize.Height() )
+ if ( !nGrfSize.Width() && !nGrfSize.Height() )
SetTwipSize( ::GetGraphicSizeTwip( maGrfObj.GetGraphic(), 0 ) );
}
bInSwapIn = sal_False;
return nRet;
}
-
short SwGrfNode::SwapOut()
{
- if( maGrfObj.GetType() != GRAPHIC_DEFAULT &&
- maGrfObj.GetType() != GRAPHIC_NONE &&
- !maGrfObj.IsSwappedOut() && !bInSwapIn )
+ if ( maGrfObj.GetType() != GRAPHIC_DEFAULT
+ && maGrfObj.GetType() != GRAPHIC_NONE
+ && !maGrfObj.IsSwappedOut()
+ && !bInSwapIn )
{
- if( !refLink.Is() )
+ if ( !refLink.Is() )
{
// Das Swapping brauchen wir nur fuer Embedded Pictures
// Die Grafik wird in eine TempFile geschrieben, wenn
// sie frisch eingefuegt war, d.h. wenn es noch keinen
// Streamnamen im Storage gibt.
- if( !HasStreamName() )
- if( !maGrfObj.SwapOut() )
+ if ( !HasEmbeddedStreamName() )
+ if ( !maGrfObj.SwapOut() )
return 0;
}
// Geschriebene Grafiken oder Links werden jetzt weggeschmissen
@@ -627,26 +635,27 @@ short SwGrfNode::SwapOut()
return 1;
}
-
-sal_Bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
-{
+sal_Bool SwGrfNode::GetFileFilterNms(
+ String* pFileNm,
+ String* pFilterNm ) const
+ {
sal_Bool bRet = sal_False;
- if( refLink.Is() && refLink->GetLinkManager() )
+ if ( refLink.Is() && refLink->GetLinkManager() )
{
sal_uInt16 nType = refLink->GetObjType();
- if( OBJECT_CLIENT_GRF == nType )
+ if ( OBJECT_CLIENT_GRF == nType )
bRet = refLink->GetLinkManager()->GetDisplayNames(
- refLink, 0, pFileNm, 0, pFilterNm );
- else if( OBJECT_CLIENT_DDE == nType && pFileNm && pFilterNm )
+ refLink, 0, pFileNm, 0, pFilterNm );
+ else if ( OBJECT_CLIENT_DDE == nType && pFileNm && pFilterNm )
{
String sApp, sTopic, sItem;
- if( refLink->GetLinkManager()->GetDisplayNames(
- refLink, &sApp, &sTopic, &sItem ) )
+ if ( refLink->GetLinkManager()->GetDisplayNames(
+ refLink, &sApp, &sTopic, &sItem ) )
{
( *pFileNm = sApp ) += sfx2::cTokenSeperator;
( *pFileNm += sTopic ) += sfx2::cTokenSeperator;
*pFileNm += sItem;
- pFilterNm->AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" ));
+ pFilterNm->AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" ) );
bRet = sal_True;
}
}
@@ -654,13 +663,12 @@ sal_Bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
return bRet;
}
-
// Eine Grafik Undo-faehig machen. Falls sie sich bereits in
// einem Storage befindet, muss sie geladen werden.
sal_Bool SwGrfNode::SavePersistentData()
{
- if( refLink.Is() )
+ if ( refLink.Is() )
{
ASSERT( !bInSwapIn, "SavePersistentData: stehe noch im SwapIn" );
GetDoc()->GetLinkManager().Remove( refLink );
@@ -668,10 +676,10 @@ sal_Bool SwGrfNode::SavePersistentData()
}
// Erst mal reinswappen, falls sie im Storage ist
- if( HasStreamName() && !SwapIn() )
+ if ( HasEmbeddedStreamName() && !SwapIn() )
return sal_False;
- // --> OD 2005-04-19 #i44367#
+ // #i44367#
// Do not delete graphic file in storage, because the graphic file could
// be referenced by other graphic nodes.
// Because it's hard to detect this case here and it would only fix
@@ -683,36 +691,35 @@ sal_Bool SwGrfNode::SavePersistentData()
// Important note: see also fix for #i40014#
// if( HasStreamName() )
// DelStreamName();
- // <--
// Und in TempFile rausswappen
return (sal_Bool) SwapOut();
}
-
sal_Bool SwGrfNode::RestorePersistentData()
{
- if( refLink.Is() )
+ if ( refLink.Is() )
{
IDocumentLinksAdministration* pIDLA = getIDocumentLinksAdministration();
refLink->SetVisible( pIDLA->IsVisibleLinks() );
pIDLA->GetLinkManager().InsertDDELink( refLink );
- if( getIDocumentLayoutAccess()->GetCurrentLayout() ) //swmod 080218
+ if ( getIDocumentLayoutAccess()->GetCurrentLayout() )
refLink->Update();
}
return sal_True;
}
-
-void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName )
+void SwGrfNode::InsertLink(
+ const String& rGrfName,
+ const String& rFltName )
{
refLink = new SwBaseLink( sfx2::LINKUPDATE_ONCALL, FORMAT_GDIMETAFILE, this );
IDocumentLinksAdministration* pIDLA = getIDocumentLinksAdministration();
- if( GetNodes().IsDocNodes() )
+ if ( GetNodes().IsDocNodes() )
{
refLink->SetVisible( pIDLA->IsVisibleLinks() );
- if( rFltName.EqualsAscii( "DDE" ))
+ if ( rFltName.EqualsAscii( "DDE" ) )
{
sal_uInt16 nTmp = 0;
String sApp, sTopic, sItem;
@@ -720,7 +727,7 @@ void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName )
sTopic = rGrfName.GetToken( 0, sfx2::cTokenSeperator, nTmp );
sItem = rGrfName.Copy( nTmp );
pIDLA->GetLinkManager().InsertDDELink( refLink,
- sApp, sTopic, sItem );
+ sApp, sTopic, sItem );
}
else
{
@@ -729,26 +736,24 @@ void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName )
refLink->SetContentType( SOT_FORMATSTR_ID_SVXB );
pIDLA->GetLinkManager().InsertFileLink( *refLink,
- OBJECT_CLIENT_GRF, rGrfName,
- (!bSync && rFltName.Len() ? &rFltName : 0) );
+ OBJECT_CLIENT_GRF, rGrfName,
+ ( !bSync && rFltName.Len() ? &rFltName : 0 ) );
}
}
maGrfObj.SetLink( rGrfName );
}
-
void SwGrfNode::ReleaseLink()
{
- if( refLink.Is() )
+ if ( refLink.Is() )
{
- // #15508# remember some stuff from the linked graphic
- const String aFileName(maGrfObj.GetLink());
- const Graphic aLocalGraphic(maGrfObj.GetGraphic());
- const bool bHasOriginalData(aLocalGraphic.IsLink());
+ const String aFileName( maGrfObj.GetLink() );
+ const Graphic aLocalGraphic( maGrfObj.GetGraphic() );
+ const bool bHasOriginalData( aLocalGraphic.IsLink() );
{
bInSwapIn = sal_True;
- SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
+ SwBaseLink* pLink = (SwBaseLink*) (::sfx2::SvBaseLink*) refLink;
//TODO pLink->setInputStream(getInputStream());
pLink->SwapIn( sal_True, sal_True );
bInSwapIn = sal_False;
@@ -766,14 +771,14 @@ void SwGrfNode::ReleaseLink()
// SvXMLGraphicHelper::ImplInsertGraphicURL which is used at export use that type
// and use the original graphic at export for the ODF, without evtl. recoding
// of trhe bitmap graphic data to something without loss (e.g. PNG) but bigger
- if(bHasOriginalData)
+ if ( bHasOriginalData )
{
// #15508# if we have the original data at the Graphic, let it survive
// by using that Graphic again, this time at a GraphicObject without link.
// This happens e.g. when inserting a linked graphic and breaking the link
- maGrfObj.SetGraphic(aLocalGraphic);
+ maGrfObj.SetGraphic( aLocalGraphic );
}
- else if(aFileName.Len())
+ else if ( aFileName.Len() )
{
// #15508# we have no original data, but a file name. This happens e.g.
// when inserting a linked graphic and save, reload document. Try to access
@@ -782,21 +787,21 @@ void SwGrfNode::ReleaseLink()
int nRes = GRFILTER_OK;
GraphicFilter* pFlt = GraphicFilter::GetGraphicFilter();
Graphic aNew;
- nRes = GraphicFilter::LoadGraphic( aFileName, String(), aNew, pFlt);
+ nRes = GraphicFilter::LoadGraphic( aFileName, String(), aNew, pFlt );
- if(GRFILTER_OK == nRes)
+ if ( GRFILTER_OK == nRes )
{
- maGrfObj.SetGraphic(aNew);
+ maGrfObj.SetGraphic( aNew );
}
}
}
}
-
-void SwGrfNode::SetTwipSize( const Size& rSz )
+void SwGrfNode::SetTwipSize(
+ const Size& rSz )
{
nGrfSize = rSz;
- if( IsScaleImageMap() && nGrfSize.Width() && nGrfSize.Height() )
+ if ( IsScaleImageMap() && nGrfSize.Width() && nGrfSize.Height() )
{
// Image-Map an Grafik-Groesse anpassen
ScaleImageMap();
@@ -808,13 +813,13 @@ void SwGrfNode::SetTwipSize( const Size& rSz )
void SwGrfNode::ScaleImageMap()
{
- if( !nGrfSize.Width() || !nGrfSize.Height() )
+ if ( !nGrfSize.Width() || !nGrfSize.Height() )
return;
// dann die Image-Map skalieren
SwFrmFmt* pFmt = GetFlyFmt();
- if( !pFmt )
+ if ( !pFmt )
return;
SwFmtURL aURL( pFmt->GetURL() );
@@ -828,62 +833,61 @@ void SwGrfNode::ScaleImageMap()
const SwFmtFrmSize& rFrmSize = pFmt->GetFrmSize();
const SvxBoxItem& rBox = pFmt->GetBox();
- if( !rFrmSize.GetWidthPercent() )
+ if ( !rFrmSize.GetWidthPercent() )
{
SwTwips nWidth = rFrmSize.GetWidth();
- nWidth -= rBox.CalcLineSpace(BOX_LINE_LEFT) +
- rBox.CalcLineSpace(BOX_LINE_RIGHT);
+ nWidth -= rBox.CalcLineSpace( BOX_LINE_LEFT ) +
+ rBox.CalcLineSpace( BOX_LINE_RIGHT );
ASSERT( nWidth>0, "Gibt es 0 twip breite Grafiken!?" );
- if( nGrfSize.Width() != nWidth )
+ if ( nGrfSize.Width() != nWidth )
{
aScaleX = Fraction( nGrfSize.Width(), nWidth );
bScale = sal_True;
}
}
- if( !rFrmSize.GetHeightPercent() )
+ if ( !rFrmSize.GetHeightPercent() )
{
SwTwips nHeight = rFrmSize.GetHeight();
- nHeight -= rBox.CalcLineSpace(BOX_LINE_TOP) +
- rBox.CalcLineSpace(BOX_LINE_BOTTOM);
+ nHeight -= rBox.CalcLineSpace( BOX_LINE_TOP ) +
+ rBox.CalcLineSpace( BOX_LINE_BOTTOM );
ASSERT( nHeight>0, "Gibt es 0 twip hohe Grafiken!?" );
- if( nGrfSize.Height() != nHeight )
+ if ( nGrfSize.Height() != nHeight )
{
aScaleY = Fraction( nGrfSize.Height(), nHeight );
bScale = sal_True;
}
}
- if( bScale )
+ if ( bScale )
{
aURL.GetMap()->Scale( aScaleX, aScaleY );
pFmt->SetFmtAttr( aURL );
}
}
-
void SwGrfNode::DelStreamName()
{
- if( HasStreamName() )
+ if ( HasEmbeddedStreamName() )
{
// Dann die Grafik im Storage loeschen
- uno::Reference < embed::XStorage > xDocStg = GetDoc()->GetDocStorage();
- if( xDocStg.is() )
+ uno::Reference< embed::XStorage > xDocStg = GetDoc()->GetDocStorage();
+ if ( xDocStg.is() )
{
try
{
String aPicStgName, aStrmName;
_GetStreamStorageNames( aStrmName, aPicStgName );
- uno::Reference < embed::XStorage > refPics = xDocStg;
+ uno::Reference< embed::XStorage > refPics = xDocStg;
if ( aPicStgName.Len() )
refPics = xDocStg->openStorageElement( aPicStgName, embed::ElementModes::READWRITE );
refPics->removeElement( aStrmName );
- uno::Reference < embed::XTransactedObject > xTrans( refPics, uno::UNO_QUERY );
+ uno::Reference< embed::XTransactedObject > xTrans( refPics, uno::UNO_QUERY );
if ( xTrans.is() )
xTrans->commit();
}
@@ -901,19 +905,20 @@ void SwGrfNode::DelStreamName()
/** helper method to get a substorage of the document storage for readonly access.
- OD, MAV 2005-08-17 #i53025#
- A substorage with the specified name will be opened readonly. If the provided
- name is empty the root storage will be returned.
-*/
-uno::Reference< embed::XStorage > SwGrfNode::_GetDocSubstorageOrRoot( const String& aStgName ) const
-{
- uno::Reference < embed::XStorage > refStor =
- const_cast<SwGrfNode*>(this)->GetDoc()->GetDocStorage();
+ #i53025#
+ A substorage with the specified name will be opened readonly. If the provided
+ name is empty the root storage will be returned.
+ */
+uno::Reference< embed::XStorage > SwGrfNode::_GetDocSubstorageOrRoot(
+ const String& aStgName ) const
+ {
+ uno::Reference< embed::XStorage > refStor =
+ const_cast< SwGrfNode* >( this )->GetDoc()->GetDocStorage();
ASSERT( refStor.is(), "Kein Storage am Doc" );
if ( aStgName.Len() )
{
- if( refStor.is() )
+ if ( refStor.is() )
return refStor->openStorageElement( aStgName, embed::ElementModes::READ );
}
@@ -922,29 +927,29 @@ uno::Reference< embed::XStorage > SwGrfNode::_GetDocSubstorageOrRoot( const Stri
/** helper method to determine stream for the embedded graphic.
- OD 2005-05-04 #i48434#
- Important note: caller of this method has to handle the thrown exceptions
- OD, MAV 2005-08-17 #i53025#
- Storage, which should contain the stream of the embedded graphic, is
- provided via parameter. Otherwise the returned stream will be closed
- after the the method returns, because its parent stream is closed and deleted.
- Proposed name of embedded graphic stream is also provided by parameter.
+ #i48434#
+ Important note: caller of this method has to handle the thrown exceptions
+ #i53025#
+ Storage, which should contain the stream of the embedded graphic, is
+ provided via parameter. Otherwise the returned stream will be closed
+ after the the method returns, because its parent stream is closed and deleted.
+ Proposed name of embedded graphic stream is also provided by parameter.
- @author OD
-*/
+ @author OD
+ */
SvStream* SwGrfNode::_GetStreamForEmbedGrf(
- const uno::Reference< embed::XStorage >& _refPics,
- String& _aStrmName ) const
-{
+ const uno::Reference< embed::XStorage >& _refPics,
+ String& _aStrmName ) const
+ {
SvStream* pStrm( 0L );
- if( _refPics.is() && _aStrmName.Len() )
+ if ( _refPics.is() && _aStrmName.Len() )
{
// If stream doesn't exist in the storage, try access the graphic file by
// re-generating its name.
// A save action can have changed the filename of the embedded graphic,
// because a changed unique ID of the graphic is calculated.
- // --> OD 2006-01-30 #b6364738#
+ // #b6364738#
// recursive calls of <GetUniqueID()> have to be avoided.
// Thus, use local static boolean to assure this.
static bool bInRegenerateStrmName( false );
@@ -963,13 +968,12 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
}
bInRegenerateStrmName = false;
}
- // <--
// assure that graphic file exist in the storage.
if ( _refPics->hasByName( _aStrmName ) &&
_refPics->isStreamElement( _aStrmName ) )
{
- uno::Reference < io::XStream > refStrm = _refPics->openStreamElement( _aStrmName, embed::ElementModes::READ );
+ uno::Reference< io::XStream > refStrm = _refPics->openStreamElement( _aStrmName, embed::ElementModes::READ );
pStrm = utl::UcbStreamHelper::CreateStream( refStrm );
}
else
@@ -982,104 +986,96 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
}
-// --> OD 2005-08-17 #i53025# - stream couldn't be in a 3.1 - 5.2 storage any more.
-// Thus, removing corresponding code.
-void SwGrfNode::_GetStreamStorageNames( String& rStrmName,
- String& rStorName ) const
-{
+void SwGrfNode::_GetStreamStorageNames(
+ String& rStrmName,
+ String& rStorName ) const
+ {
rStorName.Erase();
rStrmName.Erase();
String aUserData( maGrfObj.GetUserData() );
- if( !aUserData.Len() )
+ if ( !aUserData.Len() )
return;
String aProt( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.Package:" ) );
- if( 0 == aUserData.CompareTo( aProt, aProt.Len() ) )
+ if ( 0 == aUserData.CompareTo( aProt, aProt.Len() ) )
{
// 6.0 (XML) Package
xub_StrLen nPos = aUserData.Search( '/' );
- if( STRING_NOTFOUND == nPos )
+ if ( STRING_NOTFOUND == nPos )
{
rStrmName = aUserData.Copy( aProt.Len() );
}
else
{
xub_StrLen nPathStart = aProt.Len();
- if( 0 == aUserData.CompareToAscii( "./", 2 ) )
+ if ( 0 == aUserData.CompareToAscii( "./", 2 ) )
nPathStart += 2;
- rStorName = aUserData.Copy( nPathStart, nPos-nPathStart );
- rStrmName = aUserData.Copy( nPos+1 );
+ rStorName = aUserData.Copy( nPathStart, nPos - nPathStart );
+ rStrmName = aUserData.Copy( nPos + 1 );
}
}
else
{
ASSERT( false,
- "<SwGrfNode::_GetStreamStorageNames(..)> - unknown graphic URL type. Code for handling 3.1 - 5.2 storages has been deleted by issue i53025." );
+ "<SwGrfNode::_GetStreamStorageNames(..)> - unknown graphic URL type. Code for handling 3.1 - 5.2 storages has been deleted by issue i53025." );
}
ASSERT( STRING_NOTFOUND == rStrmName.Search( '/' ),
- "invalid graphic stream name" );
+ "invalid graphic stream name" );
}
-// <--
-SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
-{
+
+SwCntntNode* SwGrfNode::MakeCopy(
+ SwDoc* pDoc,
+ const SwNodeIndex& rIdx ) const
+ {
// kopiere die Formate in das andere Dokument:
SwGrfFmtColl* pColl = pDoc->CopyGrfColl( *GetGrfColl() );
Graphic aTmpGrf;
- SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
- if( !pLink && HasStreamName() )
+ SwBaseLink* pLink = (SwBaseLink*) (::sfx2::SvBaseLink*) refLink;
+ if ( !pLink && HasEmbeddedStreamName() )
{
- // --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
- // --> OD, MAV 2005-08-17 #i53025# - needed correction of new
- // method <_GetStreamForEmbedGrf(..)>
-// bool bGraphic(false);
-// SvStream* pStrm = _GetStreamForEmbedGrf( bGraphic );
String aStrmName, aPicStgName;
_GetStreamStorageNames( aStrmName, aPicStgName );
- uno::Reference < embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
+ uno::Reference< embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
if ( pStrm )
{
- const String aURL(maGrfObj.GetUserData());
- GraphicFilter::GetGraphicFilter()->ImportGraphic(aTmpGrf, aURL, *pStrm);
+ const String aURL( maGrfObj.GetUserData() );
+ GraphicFilter::GetGraphicFilter()->ImportGraphic( aTmpGrf, aURL, *pStrm );
delete pStrm;
}
- // <--
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
ASSERT( false, "<SwGrfNode::MakeCopy(..)> - unhandled exception!" );
- // <--
}
- // <--
}
else
{
- if( maGrfObj.IsSwappedOut() )
- const_cast<SwGrfNode*>(this)->SwapIn();
+ if ( maGrfObj.IsSwappedOut() )
+ const_cast< SwGrfNode* >( this )->SwapIn();
aTmpGrf = maGrfObj.GetGraphic();
}
const sfx2::LinkManager& rMgr = getIDocumentLinksAdministration()->GetLinkManager();
String sFile, sFilter;
- if( IsLinkedFile() )
+ if ( IsLinkedFile() )
rMgr.GetDisplayNames( refLink, 0, &sFile, 0, &sFilter );
- else if( IsLinkedDDE() )
+ else if ( IsLinkedDDE() )
{
String sTmp1, sTmp2;
rMgr.GetDisplayNames( refLink, &sTmp1, &sTmp2, &sFilter );
sfx2::MakeLnkName( sFile, &sTmp1, sTmp2, sFilter );
- sFilter.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" ));
+ sFilter.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" ) );
}
SwGrfNode* pGrfNd = pDoc->GetNodes().MakeGrfNode( rIdx, sFile, sFilter,
- &aTmpGrf, pColl,
- (SwAttrSet*)GetpSwAttrSet() );
+ &aTmpGrf, pColl,
+ (SwAttrSet*) GetpSwAttrSet() );
pGrfNd->SetTitle( GetTitle() );
pGrfNd->SetDescription( GetDescription() );
pGrfNd->SetContour( HasContour(), HasAutomaticContour() );
@@ -1093,19 +1089,19 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
// #101174#: Keep graphic while in swap in. That's at least important
// when breaking links, because in this situation a reschedule call and
// a DataChanged call lead to a paint of the graphic.
- if( pGrfObj->IsInSwapOut() && (IsSelected() || bInSwapIn) )
+ if ( pGrfObj->IsInSwapOut() && ( IsSelected() || bInSwapIn ) )
pRet = GRFMGR_AUTOSWAPSTREAM_NONE;
- else if( refLink.Is() )
+ else if ( refLink.Is() )
{
- if( pGrfObj->IsInSwapIn() )
+ if ( pGrfObj->IsInSwapIn() )
{
// then make it by your self
- if( !bInSwapIn )
+ if ( !bInSwapIn )
{
sal_Bool bIsModifyLocked = IsModifyLocked();
LockModify();
SwapIn( sal_False );
- if( !bIsModifyLocked )
+ if ( !bIsModifyLocked )
UnlockModify();
}
pRet = GRFMGR_AUTOSWAPSTREAM_NONE;
@@ -1117,22 +1113,17 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
{
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
- if( HasStreamName() )
+ if ( HasEmbeddedStreamName() )
{
- // --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
- // --> OD, MAV 2005-08-17 #i53025# - needed correction of new
- // method <_GetStreamForEmbedGrf(..)>
-// bool bGraphic(false);
-// SvStream* pStrm = _GetStreamForEmbedGrf( bGraphic );
String aStrmName, aPicStgName;
_GetStreamStorageNames( aStrmName, aPicStgName );
- uno::Reference < embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
+ uno::Reference< embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
if ( pStrm )
{
- if( pGrfObj->IsInSwapOut() )
+ if ( pGrfObj->IsInSwapOut() )
{
pRet = GRFMGR_AUTOSWAPSTREAM_LINK;
}
@@ -1143,39 +1134,35 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
}
delete pStrm;
}
- // <--
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
ASSERT( false, "<SwapGraphic> - unhandled exception!" );
- // <--
}
- // <--
}
}
- return (long)pRet;
+ return (long) pRet;
}
-
// alle QuickDraw-Bitmaps eines speziellen Docs loeschen
-void DelAllGrfCacheEntries( SwDoc* pDoc )
+void DelAllGrfCacheEntries(
+ SwDoc* pDoc )
{
- if( pDoc )
+ if ( pDoc )
{
// alle Graphic-Links mit dem Namen aus dem Cache loeschen
const sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager();
const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
SwGrfNode* pGrfNd;
String sFileNm;
- for( sal_uInt16 n = rLnks.Count(); n; )
+ for ( sal_uInt16 n = rLnks.Count(); n; )
{
- ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
- if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() &&
- rLnkMgr.GetDisplayNames( pLnk, 0, &sFileNm ) &&
- dynamic_cast< SwBaseLink* >(pLnk) && 0 != ( pGrfNd =
- ((SwBaseLink*)pLnk)->GetCntntNode()->GetGrfNode()) )
+ ::sfx2::SvBaseLink* pLnk = &( *rLnks[--n] );
+ if ( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType()
+ && rLnkMgr.GetDisplayNames( pLnk, 0, &sFileNm )
+ && 0 != dynamic_cast< SwBaseLink* >(pLnk)
+ && 0 != (pGrfNd = static_cast< SwBaseLink* >(pLnk)->GetCntntNode()->GetGrfNode()))
{
pGrfNd->ReleaseGraphicFromCache();
}
@@ -1184,42 +1171,55 @@ void DelAllGrfCacheEntries( SwDoc* pDoc )
}
// returns the with our graphic attributes filled Graphic-Attr-Structure
-GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
- const SwFrm* pFrm ) const
-{
+GraphicAttr& SwGrfNode::GetGraphicAttr(
+ GraphicAttr& rGA,
+ const SwFrm* pFrm ) const
+ {
const SwAttrSet& rSet = GetSwAttrSet();
- rGA.SetDrawMode( (GraphicDrawMode)rSet.GetDrawModeGrf().GetValue() );
+ rGA.SetDrawMode( (GraphicDrawMode) rSet.GetDrawModeGrf().GetValue() );
const SwMirrorGrf & rMirror = rSet.GetMirrorGrf();
sal_uLong nMirror = BMP_MIRROR_NONE;
- if( rMirror.IsGrfToggle() && pFrm && !pFrm->FindPageFrm()->OnRightPage() )
+ if ( rMirror.IsGrfToggle() && pFrm && !pFrm->FindPageFrm()->OnRightPage() )
{
- switch( rMirror.GetValue() )
+ switch (rMirror.GetValue())
{
- case RES_MIRROR_GRAPH_DONT: nMirror = BMP_MIRROR_HORZ; break;
- case RES_MIRROR_GRAPH_VERT: nMirror = BMP_MIRROR_NONE; break;
- case RES_MIRROR_GRAPH_HOR: nMirror = BMP_MIRROR_HORZ|BMP_MIRROR_VERT;
- break;
- default: nMirror = BMP_MIRROR_VERT; break;
+ case RES_MIRROR_GRAPH_DONT:
+ nMirror = BMP_MIRROR_HORZ;
+ break;
+ case RES_MIRROR_GRAPH_VERT:
+ nMirror = BMP_MIRROR_NONE;
+ break;
+ case RES_MIRROR_GRAPH_HOR:
+ nMirror = BMP_MIRROR_HORZ | BMP_MIRROR_VERT;
+ break;
+ default:
+ nMirror = BMP_MIRROR_VERT;
+ break;
}
}
else
- switch( rMirror.GetValue() )
+ switch (rMirror.GetValue())
{
- case RES_MIRROR_GRAPH_BOTH: nMirror = BMP_MIRROR_HORZ|BMP_MIRROR_VERT;
- break;
- case RES_MIRROR_GRAPH_VERT: nMirror = BMP_MIRROR_HORZ; break;
- case RES_MIRROR_GRAPH_HOR: nMirror = BMP_MIRROR_VERT; break;
+ case RES_MIRROR_GRAPH_BOTH:
+ nMirror = BMP_MIRROR_HORZ | BMP_MIRROR_VERT;
+ break;
+ case RES_MIRROR_GRAPH_VERT:
+ nMirror = BMP_MIRROR_HORZ;
+ break;
+ case RES_MIRROR_GRAPH_HOR:
+ nMirror = BMP_MIRROR_VERT;
+ break;
}
rGA.SetMirrorFlags( nMirror );
const SwCropGrf& rCrop = rSet.GetCropGrf();
rGA.SetCrop( TWIP_TO_MM100( rCrop.GetLeft() ),
- TWIP_TO_MM100( rCrop.GetTop() ),
- TWIP_TO_MM100( rCrop.GetRight() ),
- TWIP_TO_MM100( rCrop.GetBottom() ));
+ TWIP_TO_MM100( rCrop.GetTop() ),
+ TWIP_TO_MM100( rCrop.GetRight() ),
+ TWIP_TO_MM100( rCrop.GetBottom() ) );
const SwRotationGrf& rRotation = rSet.GetRotationGrf();
rGA.SetRotation( rRotation.GetValue() );
@@ -1234,7 +1234,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
const sal_uInt16 nTrans = rSet.GetTransparencyGrf().GetValue();
rGA.SetTransparency( (sal_uInt8) FRound(
- Min( nTrans, (sal_uInt16) 100 ) * 2.55 ) );
+ Min( nTrans, (sal_uInt16) 100 ) * 2.55 ) );
return rGA;
}
@@ -1242,35 +1242,34 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
sal_Bool SwGrfNode::IsTransparent() const
{
sal_Bool bRet = maGrfObj.IsTransparent();
- if( !bRet ) // ask the attribut
+ if ( !bRet ) // ask the attribut
bRet = 0 != GetSwAttrSet().GetTransparencyGrf().GetValue();
return bRet;
}
-
sal_Bool SwGrfNode::IsSelected() const
{
sal_Bool bRet = sal_False;
const SwEditShell* pESh = GetDoc()->GetEditShell();
- if( pESh )
+ if ( pESh )
{
const SwNode* pN = this;
const ViewShell* pV = pESh;
- do {
- if( dynamic_cast< const SwEditShell* >(pV) && pN == &((SwCrsrShell*)pV)
- ->GetCrsr()->GetPoint()->nNode.GetNode() )
+ do
+ {
+ if(dynamic_cast< const SwEditShell* >(pV)
+ && pN == &((SwCrsrShell*)pV)->GetCrsr()->GetPoint()->nNode.GetNode())
{
bRet = sal_True;
break;
}
}
- while( pESh != ( pV = (ViewShell*)pV->GetNext() ));
+ while (pESh != ( pV = (ViewShell*) pV->GetNext() ));
}
return bRet;
}
-// --> OD 2006-12-22 #i73788#
boost::weak_ptr< SwAsyncRetrieveInputStreamThreadConsumer > SwGrfNode::GetThreadConsumer()
{
return mpThreadConsumer;
@@ -1281,7 +1280,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream()
if ( !IsLinkedFile() )
{
ASSERT( false,
- "<SwGrfNode::TriggerAsyncLoad()> - Method is misused. Method call is only valid for graphic nodes, which refer a linked graphic file" );
+ "<SwGrfNode::TriggerAsyncLoad()> - Method is misused. Method call is only valid for graphic nodes, which refer a linked graphic file" );
return;
}
@@ -1302,7 +1301,7 @@ bool SwGrfNode::IsLinkedInputStreamReady() const
}
void SwGrfNode::ApplyInputStream(
- com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream,
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xInputStream,
const sal_Bool bIsStreamReadOnly )
{
if ( IsLinkedFile() )
@@ -1320,27 +1319,22 @@ void SwGrfNode::ApplyInputStream(
void SwGrfNode::UpdateLinkWithInputStream()
{
- // --> OD #i85105#
// do not work on link, if a <SwapIn> has been triggered.
if ( !bInSwapIn && IsLinkedFile() )
- // <--
{
GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly );
GetLink()->Update();
SwMsgPoolItem aMsgHint( RES_GRAPHIC_ARRIVED );
ModifyNotification( &aMsgHint, &aMsgHint );
- // --> OD 2008-06-18 #i88291#
mxInputStream.clear();
GetLink()->clearStreamToLoadFrom();
- // <--
mbLinkedInputStreamReady = false;
mpThreadConsumer.reset();
}
}
-// <--
-// --> OD 2008-07-21 #i90395#
+
bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
{
bool bRet = false;
@@ -1358,4 +1352,3 @@ bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
return bRet;
}
-// <--
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index 086ab323e698..7455b51db715 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -84,11 +84,6 @@ namespace sw { namespace mark
virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& rPos) const;
virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& rPos) const;
- // Marks exclusive annotation marks
- virtual const_iterator_t getCommonMarksBegin() const;
- virtual const_iterator_t getCommonMarksEnd() const;
- virtual sal_Int32 getCommonMarksCount() const;
-
// Annotation Marks
virtual const_iterator_t getAnnotationMarksBegin() const;
virtual const_iterator_t getAnnotationMarksEnd() const;
diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx
index c922b221d856..978c1e4cdc14 100644
--- a/sw/source/core/inc/anchoredobjectposition.hxx
+++ b/sw/source/core/inc/anchoredobjectposition.hxx
@@ -283,7 +283,7 @@ namespace objectpositioning
@author OD
@param _rPageAlignLayFrm
- input paramter - layout frame, which determines the 'page area'
+ input parameter - layout frame, which determines the 'page area'
the object has to be horizontal positioned in.
@param _nProposedRelPosX
@@ -332,7 +332,7 @@ namespace objectpositioning
is oriented at.
@param _rPageAlignLayFrm
- input paramter - layout frame, which determines the 'page area'
+ input parameter - layout frame, which determines the 'page area'
the object has to be horizontal positioned in.
@param _eRelOrient
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index f675a201591d..74f521917209 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -59,8 +59,6 @@ class SwFmt;
class SwPrintData;
class SwSortedObjs;
class SwAnchoredObject;
-//UUUU
-class FillAttributes;
//Jeder FrmTyp findet sich hier in einem Bit wieder.
//Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
@@ -142,6 +140,8 @@ typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, sal_Bool );
typedef long (*SwOperator)( long, long );
typedef void (SwFrm:: *SwFrmSet)( long, long );
+SwFrm* SaveCntnt( SwLayoutFrm*, SwFrm* pStart = NULL );
+
struct SwRectFnCollection
{
SwRectGet fnGetTop;
@@ -271,6 +271,12 @@ enum MakePageType
//typedef SdrObject* SdrObjectPtr;
//SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1);
+//UUUU
+namespace drawinglayer { namespace attribute {
+ class SdrAllFillAttributesHelper;
+ typedef boost::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr;
+}}
+
class SwFrm: public SwClient, public SfxBroadcaster
{
//Der verkappte Frm
@@ -279,8 +285,8 @@ class SwFrm: public SwClient, public SfxBroadcaster
friend class SwLooping; // LoopControlling (layouter.cxx)
//Hebt die Lower waehrend eines Spaltenumbaus auf.
- friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL );
- friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
+ friend SwFrm *SaveCntnt( SwLayoutFrm*, SwFrm* pStart );
+ friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
#if OSL_DEBUG_LEVEL > 1
//entfernt leere SwSectionFrms aus einer Kette
@@ -572,7 +578,7 @@ public:
void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
sal_Bool GetBackgroundBrush(
- boost::shared_ptr< FillAttributes >& rFillAttributes,
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
const SvxBrushItem*& rpBrush,
const Color*& rpColor,
SwRect &rOrigRect,
@@ -963,6 +969,9 @@ public:
bool KnowsFormat( const SwFmt& rFmt ) const;
void RegisterToFormat( SwFmt& rFmt );
void ValidateThisAndAllLowers( const sal_uInt16 nStage );
+
+ //UUUU
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
};
inline sal_Bool SwFrm::IsInDocBody() const
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 666b8081894c..0d49e79a9373 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -70,7 +70,7 @@ void MA_FASTCALL DrawGraphic(
const sal_uInt8 nGrfNum = GRFNUM_NO,
const sal_Bool bConsiderBackgroundTransparency = sal_False );
bool MA_FASTCALL DrawFillAttributes(
- const boost::shared_ptr< FillAttributes >& rFillAttributes,
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
const SwRect& rOriginalLayoutRect,
const SwRect& rPaintRect,
OutputDevice& rOut);
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 287670453e86..3b00e7148ab0 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -317,7 +317,7 @@ public:
@return reference to an instance of class Color
*/
- const Color& GetDrawBackgrdColor() const;
+ const Color GetDrawBackgrdColor() const;
/** paint margin area of a page
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index fdbd37979496..1ea5e095ff75 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -373,9 +373,11 @@ public:
bool TmpRollback( SwDoc* pDoc, sal_uInt16 nStart, bool ToFirst = true );
// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
- void Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
- sal_uLong nNodeIdx );
- // <--
+ void Add(
+ const SfxPoolItem* pOldValue,
+ const SfxPoolItem* pNewValue,
+ sal_uLong nNodeIdx);
+
void Add( SwTxtAttr* pTxtHt, sal_uLong nNodeIdx, bool bNewAttr = true );
void Add( SwFmtColl*, sal_uLong nNodeIdx, sal_uInt8 nWhichNd );
void Add( const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos );
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 073bc99a9d6b..07bddbd8b493 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -268,9 +268,7 @@ public:
// next page border
const SwPageFrm* GetPageAtPos( const Point& rPt, const Size* pSize = 0, bool bExtend = false ) const;
- void CalcFrmRects(
- SwShellCrsr&,
- const sal_Bool bIsTblSel );
+ void CalcFrmRects( SwShellCrsr& );
// Calculates the cells included from the current selection
// false: There was no result because of an invalid layout
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index bd989365512f..0f87e14cf27c 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -202,7 +202,7 @@ bool SwObjPosOscillationControl::OscillationDetected()
{
if ( *(pNewObjPos) == *(*aObjPosIter) )
{
- // position already occured -> oscillation
+ // position already occurred -> oscillation
bOscillationDetected = true;
delete pNewObjPos;
break;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 6bd42a366ff4..3b5cdbd087dd 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -109,7 +109,7 @@
#include <pagedeschint.hxx>
//UUUU
-#include <fillattributes.hxx>
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
#include <svx/xfillit0.hxx>
using namespace ::com::sun::star;
@@ -2496,23 +2496,6 @@ SwFrmFmt::SwFrmFmt(
maFillAttributes(),
pCaptionFmt(0)
{
- //UUUU
- if(RES_FLYFRMFMT == nFmtWhich)
- {
- // when its a SwFlyFrmFmt do not do this, this setting
- // will be derived from the parent style. In the future this
- // may be needed for more formats; all which use the
- // XATTR_FILL_FIRST, XATTR_FILL_LAST range as fill attributes
-#ifdef DBG_UTIL
- bool bBla = true; // allow setting a breakpoint here in debug mode
-#endif
- }
- else
- {
- // set FillStyle to none; this is necessary since the pool default is
- // to fill objects by color (blue8)
- SetFmtAttr(XFillStyleItem(XFILL_NONE));
- }
}
SwFrmFmt::SwFrmFmt(
@@ -2526,23 +2509,6 @@ SwFrmFmt::SwFrmFmt(
maFillAttributes(),
pCaptionFmt(0)
{
- //UUUU
- if(RES_FLYFRMFMT == nFmtWhich)
- {
- // when its a SwFlyFrmFmt do not do this, this setting
- // will be derived from the parent style. In the future this
- // may be needed for more formats; all which use the
- // XATTR_FILL_FIRST, XATTR_FILL_LAST range as fill attributes
-#ifdef DBG_UTIL
- bool bBla = true; // allow setting a breakpoint here in debug mode
-#endif
- }
- else
- {
- // set FillStyle to none; this is necessary since the pool default is
- // to fill objects by color (blue8)
- SetFmtAttr(XFillStyleItem(XFILL_NONE));
- }
}
void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
@@ -2560,7 +2526,7 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
RES_FOOTER, sal_False, (const SfxPoolItem**)&pF );
//UUUU reset fill information
- if(RES_FLYFRMFMT == Which() && maFillAttributes.get())
+ if(maFillAttributes.get() && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()))
{
SfxItemIter aIter(*((SwAttrSetChg*)pNew)->GetChgSet());
bool bReset(false);
@@ -2576,10 +2542,10 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
}
}
- else if(RES_FMT_CHG == nWhich) //UUUU
+ else if(RES_FMT_CHG == nWhich)
{
//UUUU reset fill information on format change (e.g. style changed)
- if(RES_FLYFRMFMT == Which() && maFillAttributes.get())
+ if(maFillAttributes.get() && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()))
{
maFillAttributes.reset();
}
@@ -3122,9 +3088,9 @@ const String SwFlyFrmFmt::GetObjDescription() const
sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
{
//UUUU
- if(RES_FLYFRMFMT == Which() && getFillAttributes())
+ if((RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) && getSdrAllFillAttributesHelper())
{
- return getFillAttributes()->isTransparent();
+ return getSdrAllFillAttributesHelper()->isTransparent();
}
/// NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT)
@@ -3166,9 +3132,9 @@ sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
sal_Bool SwFlyFrmFmt::IsBackgroundBrushInherited() const
{
//UUUU
- if(RES_FLYFRMFMT == Which() && getFillAttributes())
+ if((RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) && getSdrAllFillAttributesHelper())
{
- return !getFillAttributes()->isUsed();
+ return !getSdrAllFillAttributesHelper()->isUsed();
}
else if ( (GetBackground().GetColor() == COL_TRANSPARENT) &&
!(GetBackground().GetGraphicObject()) )
@@ -3410,20 +3376,20 @@ SwFrmFmt* SwFrmFmt::GetCaptionFmt() const
}
//UUUU
-FillAttributesPtr SwFrmFmt::getFillAttributes() const
+drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrmFmt::getSdrAllFillAttributesHelper() const
{
- if(RES_FLYFRMFMT == Which())
+ if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())
{
// create FillAttributes on demand
if(!maFillAttributes.get())
{
- const_cast< SwFrmFmt* >(this)->maFillAttributes.reset(new FillAttributes(GetAttrSet()));
+ const_cast< SwFrmFmt* >(this)->maFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(GetAttrSet()));
}
}
else
{
// FALLBACKBREAKHERE assert wrong usage
- OSL_ENSURE(false, "getFillAttributes() call only valid for RES_FLYFRMFMT currently (!)");
+ OSL_ENSURE(false, "getSdrAllFillAttributesHelper() call only valid for RES_FLYFRMFMT and RES_FRMFMT (!)");
}
return maFillAttributes;
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 175e6a9ba6b8..e213e1cca9cf 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -658,6 +658,19 @@ const SwAttrSet* SwFrm::GetAttrSet() const
return &((const SwLayoutFrm*)this)->GetFmt()->GetAttrSet();
}
+//UUUU
+drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrm::getSdrAllFillAttributesHelper() const
+{
+ if(IsCntntFrm())
+ {
+ return static_cast< const SwCntntFrm* >(this)->GetNode()->getSdrAllFillAttributesHelper();
+ }
+ else
+ {
+ return static_cast< const SwLayoutFrm* >(this)->GetFmt()->getSdrAllFillAttributesHelper();
+ }
+}
+
/*************************************************************************
|*
|* SwFrm::_FindNext(), _FindPrev(), InvalidateNextPos()
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 8881eb6c4990..8d8785448108 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include "hintids.hxx"
#include <svl/itemiter.hxx>
#include <svtools/imap.hxx>
@@ -86,10 +85,10 @@
#include <vcl/salbtype.hxx> // FRound
#include <svx/fmmodel.hxx>
#include "switerator.hxx"
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
-
/*************************************************************************
|*
|* SwFlyFrm::SwFlyFrm()
@@ -101,10 +100,7 @@ using namespace ::com::sun::star;
SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
SwLayoutFrm( pFmt, pSib ),
- // OD 2004-03-22 #i26791#
SwAnchoredObject(),
- // OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
-// aRelPos(),
pPrevLink( 0 ),
pNextLink( 0 ),
bInCnt( sal_False ),
@@ -117,20 +113,15 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
nType = FRMC_FLY;
bInvalid = bNotifyBack = sal_True;
- bLocked = bMinHeight =
- bHeightClipped = bWidthClipped = bFormatHeightOnly = sal_False;
+ bLocked = bMinHeight = bHeightClipped = bWidthClipped = bFormatHeightOnly = sal_False;
//Grosseneinstellung, Fixe groesse ist immer die Breite
const SwFmtFrmSize &rFrmSize = pFmt->GetFrmSize();
- sal_Bool bVert = sal_False;
- sal_uInt16 nDir =
- ((SvxFrameDirectionItem&)pFmt->GetFmtAttr( RES_FRAMEDIR )).GetValue();
+ sal_uInt16 nDir = ((SvxFrameDirectionItem&)pFmt->GetFmtAttr( RES_FRAMEDIR )).GetValue();
if( FRMDIR_ENVIRONMENT == nDir )
{
bDerivedVert = 1;
bDerivedR2L = 1;
- if( pAnch && pAnch->IsVertical() )
- bVert = sal_True;
}
else
{
@@ -163,7 +154,6 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
}
}
- bVert = bVertical;
bInvalidR2L = 0;
if( FRMDIR_HORI_RIGHT_TOP == nDir )
bRightToLeft = 1;
@@ -180,25 +170,20 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
else if ( rFrmSize.GetHeightSizeType() == ATT_FIX_SIZE )
bFixSize = sal_True;
- // OD 2004-02-12 #110582#-2 - insert columns, if necessary
+ // insert columns, if necessary
InsertColumns();
- //Erst das Init, dann den Inhalt, denn zum Inhalt koennen widerum
- //Objekte/Rahmen gehoeren die dann angemeldet werden.
+ // initialize before inserting content as the content might contain other objects which need to be registered
InitDrawObj( sal_False );
- // OD 2004-01-19 #110582#
Chain( pAnch );
- // OD 2004-01-19 #110582#
InsertCnt();
- //Und erstmal in den Wald stellen die Kiste, damit bei neuen Dokument nicht
- //unnoetig viel formatiert wird.
+ // apply dummy position which is far-away in order to avoid needless formattings
Frm().Pos().X() = Frm().Pos().Y() = WEIT_WECH;
}
-// OD 2004-01-19 #110582#
void SwFlyFrm::Chain( SwFrm* _pAnch )
{
// Connect to chain neighboors.
@@ -230,7 +215,6 @@ void SwFlyFrm::Chain( SwFrm* _pAnch )
}
}
-// OD 2004-01-19 #110582#
void SwFlyFrm::InsertCnt()
{
if ( !GetPrevLink() )
@@ -251,20 +235,17 @@ void SwFlyFrm::InsertCnt()
}
}
- // OD 2004-02-12 #110582#-2
- void SwFlyFrm::InsertColumns()
- {
- // --> OD 2009-08-12 #i97379#
+void SwFlyFrm::InsertColumns()
+{
// Check, if column are allowed.
// Columns are not allowed for fly frames, which represent graphics or embedded objects.
const SwFmtCntnt& rCntnt = GetFmt()->GetCntnt();
ASSERT( rCntnt.GetCntntIdx(), "<SwFlyFrm::InsertColumns()> - no content prepared." );
- SwNodeIndex aFirstCntnt( *(rCntnt.GetCntntIdx()), 1 );
+ SwNodeIndex aFirstCntnt( *( rCntnt.GetCntntIdx() ), 1 );
if ( aFirstCntnt.GetNode().IsNoTxtNode() )
{
return;
}
- // <--
const SwFmtCol &rCol = GetFmt()->GetCol();
if ( rCol.GetNumCols() > 1 )
@@ -278,7 +259,7 @@ void SwFlyFrm::InsertCnt()
//Old-Wert hereingereicht wird.
ChgColumns( aOld, rCol );
}
- }
+}
/*************************************************************************
|*
@@ -462,8 +443,7 @@ void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
if ( !pContact )
{
// --> OD 2005-08-08 #i52858# - method name changed
- pContact = new SwFlyDrawContact( (SwFlyFrmFmt*)GetFmt(),
- *pIDDMA->GetOrCreateDrawModel() );
+ pContact = new SwFlyDrawContact( (SwFlyFrmFmt*)GetFmt(), *pIDDMA->GetOrCreateDrawModel() );
// <--
}
ASSERT( pContact, "InitDrawObj failed" );
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index ae7c9dce15d3..089074261106 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -338,7 +338,7 @@ bool SwOszControl::ChkOsz()
{
if ( *(pNewObjPos) == *(*aObjPosIter) )
{
- // position already occured -> oscillation
+ // position already occurred -> oscillation
bOscillationDetected = true;
delete pNewObjPos;
break;
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 9cc7390f9855..f78b7faa56b6 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -1147,7 +1147,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
: pClipFrm->Frm();
// --> OD 2004-10-14 #i26945# - consider that a table, during
// its format, can exceed its upper printing area bottom.
- // Thus, enlarge the clip rectangle, if such a case occured
+ // Thus, enlarge the clip rectangle, if such a case occurred
if ( pFly->GetAnchorFrm()->IsInTab() )
{
const SwTabFrm* pTabFrm = const_cast<SwFlyFrm*>(pFly)
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 576876cd07fe..62bd0e592559 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/bigint.hxx>
#include <svx/svdmodel.hxx>
@@ -36,7 +35,6 @@
#include <sfx2/printer.hxx>
#include <editeng/lspcitem.hxx>
#include <svx/svdlegacy.hxx>
-
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
#include <fmthdft.hxx>
@@ -83,6 +81,8 @@
// <--
#include <svx/fmmodel.hxx>
#include <switerator.hxx>
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
+#include <drawdoc.hxx>
// ftnfrm.cxx:
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes );
@@ -229,9 +229,23 @@ SwFrmNotify::~SwFrmNotify()
(aPrt.*fnRect->fnGetHeight)()!=(pFrm->Prt().*fnRect->fnGetHeight)();
if ( bPrtWidth || bPrtHeight )
{
- const SvxGraphicPosition ePos = pFrm->GetAttrSet()->GetBackground().GetGraphicPos();
- if ( GPOS_NONE != ePos && GPOS_TILED != ePos )
- pFrm->SetCompletePaint();
+ //UUUU
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes(pFrm->getSdrAllFillAttributesHelper());
+
+ if(aFillAttributes.get() && aFillAttributes->isUsed())
+ {
+ //UUUU use SetCompletePaint if needed
+ if(aFillAttributes->needCompleteRepaint())
+ {
+ pFrm->SetCompletePaint();
+ }
+ }
+ else
+ {
+ const SvxGraphicPosition ePos = pFrm->GetAttrSet()->GetBackground().GetGraphicPos();
+ if(GPOS_NONE != ePos && GPOS_TILED != ePos)
+ pFrm->SetCompletePaint();
+ }
}
else
{
@@ -920,7 +934,7 @@ SwCntntNotify::~SwCntntNotify()
// The layout is calculated _before_ calling PrtOLENotify,
// and the OLE objects are not invalidated during import.
// Therefore I added the condition !IsUpdateExpFld,
- // have a look at the occurence of CalcLayout in
+ // have a look at the occurrence of CalcLayout in
// uiview/view.cxx.
if ( !pNd->IsOLESizeInvalid() &&
!pSh->GetDoc()->IsUpdateExpFld() )
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 3a0d5dd9454d..68d99da87b5e 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
#include <fmtfordr.hxx>
@@ -52,6 +51,7 @@
#include <hints.hxx>
#include <viewopt.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
SwLayVout *SwRootFrm::pVout = 0;
sal_Bool SwRootFrm::bInPaint = sal_False;
@@ -513,7 +513,7 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() ); //Fuer das Erzeugen der Flys durch MakeFrms() //swmod 071108//swmod 071225
bCallbackActionEnabled = sal_False; //vor Verlassen auf sal_True setzen!
- SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
if ( pMd )
{
pDrawPage = pMd->GetPage( 0 );
diff --git a/sw/source/core/layout/objectformatterlayfrm.hxx b/sw/source/core/layout/objectformatterlayfrm.hxx
index 66f13d449aae..6745b4244cff 100644
--- a/sw/source/core/layout/objectformatterlayfrm.hxx
+++ b/sw/source/core/layout/objectformatterlayfrm.hxx
@@ -50,7 +50,7 @@ class SwObjectFormatterLayFrm : public SwObjectFormatter
@author OD
@return boolean
- indicates, if format was successfull
+ indicates, if format was successful
*/
bool _AdditionalFormatObjsOnPage();
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 2224bd65d643..31f200b06d3c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -83,21 +81,18 @@
#include <svx/svdogrp.hxx>
#include <sortedobjs.hxx>
#include <EnhancedPDFExportHelper.hxx>
-// <--
-// --> OD #i76669#
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
-// <--
-
#include <ndole.hxx>
#include <svx/charthelper.hxx>
#include <PostItMgr.hxx>
#include <tools/color.hxx>
#include <vcl/svapp.hxx>
-
-//UUUU
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
#include <drawinglayer/processor2d/processor2dtools.hxx>
+#include <ndtxt.hxx>
+#include <drawdoc.hxx>
#define COL_NOTES_SIDEPANE RGB_COLORDATA(230,230,230)
#define COL_NOTES_SIDEPANE_BORDER RGB_COLORDATA(200,200,200)
@@ -310,8 +305,7 @@ void SwCalcPixStatics( OutputDevice *pOut )
//Zum Sichern der statics, damit das Paint (quasi) reentrant wird.
class SwSavePaintStatics
{
- sal_Bool bSFlyMetafile,
- bSPageOnly;
+ sal_Bool bSFlyMetafile; // not used: bSPageOnly;
ViewShell *pSGlobalShell;
OutputDevice *pSFlyMetafileOut;
SwFlyFrm *pSRetoucheFly,
@@ -1424,7 +1418,7 @@ void MA_FASTCALL lcl_ExtendLeftAndRight( SwRect& _rRect,
// if ( pFly->IsBackgroundTransparent() )
// {
// // Background <pFly> is transparent drawn. Thus normally, its region
-// // have not to be substracted from given region.
+// // have not to be subtracted from given region.
// // But, if method is called for a fly frame and
// // <pFly> is a direct lower of this fly frame and
// // <pFly> inherites its transparent background brush from its parent,
@@ -1641,7 +1635,7 @@ void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
} // end of method <lcl_DrawGraphic>
bool MA_FASTCALL DrawFillAttributes(
- const FillAttributesPtr& rFillAttributes,
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
const SwRect& rOriginalLayoutRect,
const SwRect& rPaintRect,
OutputDevice& rOut)
@@ -1651,7 +1645,7 @@ bool MA_FASTCALL DrawFillAttributes(
if(bUseNew && rFillAttributes.get() && rFillAttributes->isUsed())
{
- const basegfx::B2DRange aPaintRange(
+ basegfx::B2DRange aPaintRange(
rPaintRect.Left(),
rPaintRect.Top(),
rPaintRect.Right(),
@@ -1661,6 +1655,14 @@ bool MA_FASTCALL DrawFillAttributes(
!basegfx::fTools::equalZero(aPaintRange.getWidth()) &&
!basegfx::fTools::equalZero(aPaintRange.getHeight()))
{
+ //UUUU need to expand for correct AAed and non-AAed visualization as primitive; move
+ // bounds to half-(logical)pixel bounds and add a width/height of one pixel that is missing
+ // from SwRect/Rectangle integer handling
+ const basegfx::B2DVector aSingleUnit(rOut.GetInverseViewTransformation() * basegfx::B2DVector(0.5, 0.5));
+
+ aPaintRange.expand(aPaintRange.getMinimum() - (aSingleUnit * 0.5));
+ aPaintRange.expand(aPaintRange.getMaximum() + (aSingleUnit * 1.5));
+
const basegfx::B2DRange aDefineRange(
rOriginalLayoutRect.Left(),
rOriginalLayoutRect.Top(),
@@ -1984,7 +1986,7 @@ void MA_FASTCALL DrawGraphic(
{
if ( !bGrfIsTransparent )
{
- /// substract area of background graphic from draw area
+ /// subtract area of background graphic from draw area
/// OD 08.10.2002 #103898# - consider only that part of the
/// graphic area that is overlapping with draw area.
SwRect aTmpGrf = aGrf;
@@ -3005,7 +3007,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
/// OD 29.08.2002 #102450#
/// determine background color of page for <PaintLayer> method
/// calls, paint <hell> or <heaven>
- const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor();
+ const Color aPageBackgrdColor(pPage->GetDrawBackgrdColor());
pPage->PaintBaBo( aPaintRect, pPage, sal_True );
@@ -3421,7 +3423,7 @@ sal_Bool SwFlyFrm::IsBackgroundTransparent() const
SwRect aDummyRect;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
if ( GetBackgroundBrush( aFillAttributes, pBackgrdBrush, pSectionTOXColor, aDummyRect, false) )
{
@@ -3671,14 +3673,15 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
const SwFrmFmt* pSwFrmFmt = dynamic_cast< const SwFrmFmt* >(GetFmt());
- if(pSwFrmFmt && RES_FLYFRMFMT == pSwFrmFmt->Which())
+ if(pSwFrmFmt && (RES_FLYFRMFMT == pSwFrmFmt->Which() || RES_FRMFMT == pSwFrmFmt->Which()))
{
//UUUU check for transparency
- const FillAttributesPtr aFillAttributes(pSwFrmFmt->getFillAttributes());
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes(pSwFrmFmt->getSdrAllFillAttributesHelper());
- if(aFillAttributes.get())
+ // check if the new fill attributes are used
+ if(aFillAttributes.get() && aFillAttributes->isUsed())
{
- bPaintCompleteBack = aFillAttributes->isTransparent();
+ bPaintCompleteBack = true;
}
}
else
@@ -4105,7 +4108,7 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
// OD 30.09.2002 #103636# - no SwAlign of shadow rectangle
// no alignment necessary, because (1) <rRect> is already aligned
// and because (2) paint of border and background will occur later.
- // Thus, (1) assures that no conflicts with neighbour object will occure
+ // Thus, (1) assures that no conflicts with neighbour object will occur
// and (2) assures that border and background is not affected by the
// shadow paint.
/*
@@ -4130,7 +4133,7 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
void SwFrm::PaintBorderLine( const SwRect& rRect,
const SwRect& rOutRect,
- const SwPageFrm *pPage,
+ const SwPageFrm* /*pPage*/,
const Color *pColor ) const
{
if ( !rOutRect.IsOver( rRect ) )
@@ -4188,20 +4191,20 @@ void MA_FASTCALL lcl_SubTopBottom( SwRect& _iorRect,
( !bCnt || _rAttrs.GetTopLine( _rFrm ) )
)
{
- // substract distance between outer and inner line.
+ // subtract distance between outer and inner line.
SwTwips nDist = ::lcl_MinHeightDist( _rBox.GetTop()->GetDistance() );
// OD 19.05.2003 #109667# - non-overlapping border rectangles:
// adjust x-/y-position, if inner top line is a hair line (width = 1)
sal_Bool bIsInnerTopLineHairline = sal_False;
if ( !_bPrtOutputDev )
{
- // additionally substract width of top outer line
+ // additionally subtract width of top outer line
// --> left/right inner/outer line doesn't overlap top outer line.
nDist += ::lcl_AlignHeight( _rBox.GetTop()->GetOutWidth() );
}
else
{
- // OD 29.04.2003 #107169# - additionally substract width of top inner line
+ // OD 29.04.2003 #107169# - additionally subtract width of top inner line
// --> left/right inner/outer line doesn't overlap top inner line.
nDist += ::lcl_AlignHeight( _rBox.GetTop()->GetInWidth() );
bIsInnerTopLineHairline = _rBox.GetTop()->GetInWidth() == 1;
@@ -4238,20 +4241,20 @@ void MA_FASTCALL lcl_SubTopBottom( SwRect& _iorRect,
( !bCnt || _rAttrs.GetBottomLine( _rFrm ) )
)
{
- // substract distance between outer and inner line.
+ // subtract distance between outer and inner line.
SwTwips nDist = ::lcl_MinHeightDist( _rBox.GetBottom()->GetDistance() );
// OD 19.05.2003 #109667# - non-overlapping border rectangles:
// adjust x-/y-position, if inner bottom line is a hair line (width = 1)
sal_Bool bIsInnerBottomLineHairline = sal_False;
if ( !_bPrtOutputDev )
{
- // additionally substract width of bottom outer line
+ // additionally subtract width of bottom outer line
// --> left/right inner/outer line doesn't overlap bottom outer line.
nDist += ::lcl_AlignHeight( _rBox.GetBottom()->GetOutWidth() );
}
else
{
- // OD 29.04.2003 #107169# - additionally substract width of bottom inner line
+ // OD 29.04.2003 #107169# - additionally subtract width of bottom inner line
// --> left/right inner/outer line doesn't overlap bottom inner line.
nDist += ::lcl_AlignHeight( _rBox.GetBottom()->GetInWidth() );
bIsInnerBottomLineHairline = _rBox.GetBottom()->GetInWidth() == 1;
@@ -4357,7 +4360,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
// OD 06.05.2003 #107169# - adjustments for printer output device
if ( bPrtOutputDev )
{
- // substract width of outer top line.
+ // subtract width of outer top line.
if ( rBox.GetTop() && (!bCnt || _rAttrs.GetTopLine( _rFrm )) )
{
long nDist = ::lcl_AlignHeight( rBox.GetTop()->GetOutWidth() );
@@ -4388,7 +4391,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
}
}
}
- // substract width of outer bottom line.
+ // subtract width of outer bottom line.
if ( rBox.GetBottom() && (!bCnt || _rAttrs.GetBottomLine( _rFrm )) )
{
long nDist = ::lcl_AlignHeight( rBox.GetBottom()->GetOutWidth());
@@ -5391,48 +5394,26 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const
void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
ViewShell* _pViewShell ) const
{
- if ( _pViewShell->GetWin() &&
- !_pViewShell->GetViewOptions()->getBrowseMode() )
+ if ( _pViewShell->GetWin() && !_pViewShell->GetViewOptions()->getBrowseMode() )
{
- SwRect aPgPrtRect( Prt() );
- aPgPrtRect.Pos() += Frm().Pos();
- if ( !aPgPrtRect.IsInside( _rOutputRect ) )
+ //UUUU Simplified paint with DrawingLayer FillStyle
+ SwRect aPgRect = Frm();
+ aPgRect._Intersection( _rOutputRect );
+
+ if(!aPgRect.IsEmpty())
{
- SwRect aPgRect = Frm();
- aPgRect._Intersection( _rOutputRect );
- SwRegionRects aPgRegion( aPgRect );
- aPgRegion -= aPgPrtRect;
- const SwPageFrm* pPage = static_cast<const SwPageFrm*>(this);
- //if ( pPage->GetSortedObjs() )
- // ::lcl_SubtractFlys( this, pPage, aPgRect, aPgRegion );
- if ( aPgRegion.Count() )
+ OutputDevice *pOut = _pViewShell->GetOut();
+
+ if(pOut->GetFillColor() != aGlobalRetoucheColor)
{
- OutputDevice *pOut = _pViewShell->GetOut();
- if ( pOut->GetFillColor() != aGlobalRetoucheColor )
- pOut->SetFillColor( aGlobalRetoucheColor );
- for ( sal_uInt16 i = 0; i < aPgRegion.Count(); ++i )
- {
- if ( 1 < aPgRegion.Count() )
- {
- ::SwAlignRect( aPgRegion[i], pGlobalShell );
- if( !aPgRegion[i].HasArea() )
- continue;
- }
- pOut->DrawRect(aPgRegion[i].SVRect());
- }
+ pOut->SetFillColor(aGlobalRetoucheColor);
}
+
+ pOut->DrawRect(aPgRect.SVRect());
}
}
}
-// ----------------------------------------------------------------------
-//
-// const SwPageFrm::mnBorderPxWidth, const SwPageFrm::mnShadowPxWidth
-// SwPageFrm::GetBorderRect (..), SwPageFrm::GetRightShadowRect(..),
-// SwPageFrm::GetBottomShadowRect(..),
-// SwPageFrm::PaintBorderAndShadow(..),
-// SwPageFrm::GetBorderAndShadowBoundRect(..)
-//
// OD 12.02.2003 for #i9719# and #105645#
// ----------------------------------------------------------------------
@@ -5835,7 +5816,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
sal_Bool bLowMode = sal_True;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
sal_Bool bBack = GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, bLowerMode );
@@ -5868,14 +5849,14 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
pTmpBackBrush = new SvxBrushItem( Color( COL_WHITE ), RES_BACKGROUND );
//UUU
- aFillAttributes.reset(new FillAttributes(Color( COL_WHITE )));
+ aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(Color( COL_WHITE )));
}
else
{
pTmpBackBrush = new SvxBrushItem( aGlobalRetoucheColor, RES_BACKGROUND);
//UUU
- aFillAttributes.reset(new FillAttributes(aGlobalRetoucheColor));
+ aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aGlobalRetoucheColor));
}
pItem = pTmpBackBrush;
@@ -5926,7 +5907,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
pItem = pNewItem;
//UUUU
- aFillAttributes.reset(new FillAttributes(*pCol));
+ aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(*pCol));
}
//if ( pPage->GetSortedObjs() )
@@ -5942,9 +5923,29 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const sal_Bool bConsiderBackgroundTransparency = IsFlyFrm();
bool bDone(false);
- if(pOut && aFillAttributes.get() && aFillAttributes->isUsed())
+ // #i125189# We are also done when the new DrawingLayer FillAttributes are used
+ // or the FillStyle is set (different from XFILL_NONE)
+ if(pOut && aFillAttributes.get())
{
- bDone = DrawFillAttributes(aFillAttributes, aOrigBackRect, aRect, *pOut);
+ if(aFillAttributes->isUsed())
+ {
+ // check if really something is painted
+ bDone = DrawFillAttributes(aFillAttributes, aOrigBackRect, aRect, *pOut);
+ }
+
+ if(!bDone)
+ {
+ // if not, still a FillStyle could be set but the transparency is at 100%,
+ // thus need to check the model data itself for FillStyle (do not rely on
+ // SdrAllFillAttributesHelper since it already contains optimized information,
+ // e.g. transparency leads to no fill)
+ const XFillStyle eFillStyle(static_cast< const XFillStyleItem& >(GetAttrSet()->Get(XATTR_FILLSTYLE)).GetValue());
+
+ if(XFILL_NONE != eFillStyle)
+ {
+ bDone = true;
+ }
+ }
}
if(!bDone)
@@ -6510,31 +6511,39 @@ void SwLayoutFrm::RefreshExtraData( const SwRect &rRect ) const
@return Color
*/
-const Color& SwPageFrm::GetDrawBackgrdColor() const
+const Color SwPageFrm::GetDrawBackgrdColor() const
{
const SvxBrushItem* pBrushItem;
const Color* pDummyColor;
SwRect aDummyRect;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
if ( GetBackgroundBrush( aFillAttributes, pBrushItem, pDummyColor, aDummyRect, true) )
{
- const Graphic* pGraphic = pBrushItem->GetGraphic();
-
- if(pGraphic)
+ if(aFillAttributes.get() && aFillAttributes->isUsed()) //UUUU
{
- // #29105# when a graphic is set, it may be possible to calculate a single
- // color which looks good in all places of the graphic. Since it is
- // planned to have text edit on the overlay one day and the fallback
- // to aGlobalRetoucheColor returns something useful, just use that
- // for now.
+ // let SdrAllFillAttributesHelper do the average color calculation
+ return Color(aFillAttributes->getAverageColor(aGlobalRetoucheColor.getBColor()));
}
- else
+ else if(pBrushItem)
{
- // not a graphic, use (hopefully) initialized color
- return pBrushItem->GetColor();
+ const Graphic* pGraphic = pBrushItem->GetGraphic();
+
+ if(pGraphic)
+ {
+ // #29105# when a graphic is set, it may be possible to calculate a single
+ // color which looks good in all places of the graphic. Since it is
+ // planned to have text edit on the overlay one day and the fallback
+ // to aGlobalRetoucheColor returns something useful, just use that
+ // for now.
+ }
+ else
+ {
+ // not a graphic, use (hopefully) initialized color
+ return pBrushItem->GetColor();
+ }
}
}
@@ -6618,7 +6627,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
SwRect aRetouchePart( rRetouche );
if ( aRetouchePart.HasArea() )
{
- const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor();
+ const Color aPageBackgrdColor(pPage->GetDrawBackgrdColor());
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
// --> OD #i76669#
SwViewObjectContactRedirector aSwRedirector( *pSh );
@@ -6690,7 +6699,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
@return true, if a background brush for the frame is found
*/
sal_Bool SwFrm::GetBackgroundBrush(
- FillAttributesPtr& rFillAttributes,
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
const SvxBrushItem* & rpBrush,
const Color*& rpCol,
SwRect &rOrigRect,
@@ -6706,18 +6715,7 @@ sal_Bool SwFrm::GetBackgroundBrush(
return sal_False;
//UUUU
- const SwLayoutFrm* pSwLayoutFrm = dynamic_cast< const SwLayoutFrm* >(pFrm);
-
- if(pSwLayoutFrm)
- {
- const SwFrmFmt* pSwFrmFmt = dynamic_cast< const SwFrmFmt* >(pSwLayoutFrm->GetFmt());
-
- if(pSwFrmFmt && RES_FLYFRMFMT == pSwFrmFmt->Which())
- {
- rFillAttributes = pSwFrmFmt->getFillAttributes();
- }
- }
-
+ rFillAttributes = pFrm->getSdrAllFillAttributesHelper();
const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground();
if( pFrm->IsSctFrm() )
@@ -6756,13 +6754,41 @@ sal_Bool SwFrm::GetBackgroundBrush(
/// considered for fly frames
const sal_Bool bConsiderBackgroundTransparency = pFrm->IsFlyFrm();
+ // #i125189# Do not base the decision for using the parent's fill style for this
+ // frame when the new DrawingLayer FillAttributes are used on the SdrAllFillAttributesHelper
+ // information. There the data is already optimized to no fill in the case that the
+ // transparence is at 100% while no fill is the criteria for derivation
+ bool bNewDrawingLayerFillStyleIsUsedAndNotNoFill(false);
+
+ if(rFillAttributes.get())
+ {
+ // the new DrawingLayer FillStyle is used
+ if(rFillAttributes->isUsed())
+ {
+ // it's not XFILL_NONE
+ bNewDrawingLayerFillStyleIsUsedAndNotNoFill = true;
+ }
+ else
+ {
+ // maybe optimized already when 100% transparency is used somewhere, need to test
+ // XFillStyleItem directly from the model data
+ const XFillStyle eFillStyle(static_cast< const XFillStyleItem& >(pFrm->GetAttrSet()->Get(XATTR_FILLSTYLE)).GetValue());
+
+ if(XFILL_NONE != eFillStyle)
+ {
+ bNewDrawingLayerFillStyleIsUsedAndNotNoFill = true;
+ }
+ }
+ }
+
/// OD 20.08.2002 #99657#
/// add condition:
/// If <bConsiderBackgroundTransparency> is set - see above -,
/// return brush of frame <pFrm>, if its color is *not* "no fill"/"auto fill"
if (
- // done when FillAttributesare set
- (rFillAttributes.get() && rFillAttributes->isUsed()) ||
+ // #i125189# Done when the new DrawingLayer FillAttributes are used and
+ // not XFILL_NONE (see above)
+ bNewDrawingLayerFillStyleIsUsedAndNotNoFill ||
// done when SvxBrushItem is used
!rBack.GetColor().GetTransparency() || rBack.GetGraphicPos() != GPOS_NONE ||
@@ -6905,7 +6931,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
// OD 09.12.2002 #103045# - determine page, fly frame is on
const SwPageFrm* pFlyPage = pFly->FindPageFrm();
- const Color aPageBackgrdColor = pFlyPage->GetDrawBackgrdColor();
+ const Color aPageBackgrdColor(pFlyPage->GetDrawBackgrdColor());
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
// --> OD #i76669#
SwViewObjectContactRedirector aSwRedirector( *pSh );
@@ -6951,7 +6977,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
Graphic SwDrawFrmFmt::MakeGraphic( ImageMap* )
{
Graphic aRet;
- SdrModel *pMod = getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pMod = getIDocumentDrawModelAccess()->GetDrawModel();
if ( pMod )
{
SdrObject *pObj = FindSdrObject();
@@ -6964,4 +6990,4 @@ Graphic SwDrawFrmFmt::MakeGraphic( ImageMap* )
return aRet;
}
-
+//eof
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index a4d0b35067b9..c60263e11fd0 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1909,7 +1909,7 @@ void SwTabFrm::MakeAll()
LockJoin(); //Ich lass mich nicht unterwegs vernichten.
SwLayNotify aNotify( this ); //uebernimmt im DTor die Benachrichtigung
// If pos is invalid, we have to call a SetInvaKeep at aNotify.
- // Otherwise the keep atribute would not work in front of a table.
+ // Otherwise the keep attribute would not work in front of a table.
const sal_Bool bOldValidPos = GetValidPosFlag();
//Wenn mein direkter Nachbar gleichzeitig mein Follow ist
@@ -2528,7 +2528,7 @@ void SwTabFrm::MakeAll()
}
// --> FME 2004-06-09 #i29771# Two tries to split the table:
- // If an error occured during splitting. We start a second
+ // If an error occurred during splitting. We start a second
// try, this time without splitting of table rows.
if ( bSplitError )
{
@@ -2537,7 +2537,7 @@ void SwTabFrm::MakeAll()
}
// --> FME 2005-02-10 #119477#
- // If splitting the table was successfull or not,
+ // If splitting the table was successful or not,
// we do not want to have 'empty' follow tables.
if ( GetFollow() && !GetFollow()->GetFirstNonHeadlineRow() )
Join();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index a6f8abe57a28..a79b78577594 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -308,7 +308,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
Point aOldPoint = rPoint;
// PAGES01
- // search for page containing rPoint. The borders around the pages are considerd
+ // search for page containing rPoint. The borders around the pages are considered
const SwPageFrm* pPage = GetPageAtPos( rPoint, 0, true );
// --> OD 2008-12-23 #i95626#
@@ -1984,9 +1984,6 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
* Ende nach links erweitern, bis Frame-Start Rect berechnen
* und bei mehr als 2 Frames von allen dazwischen liegenden
* Frames die PrtArea dazu.
- * 4. Wenn es sich um eine Tabellenselektion handelt wird fuer jeden
- * PaM im Ring der CellFrm besorgt, dessen PrtArea wird zu den
- * Rechtecken addiert.
*
* Grosser Umbau wg. der FlyFrm; denn diese muessen ausgespart werden.
* Ausnahmen: - Der Fly in dem die Selektion stattfindet (wenn sie in einem Fly
@@ -2008,8 +2005,7 @@ inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
}
void SwRootFrm::CalcFrmRects(
- SwShellCrsr &rCrsr,
- const sal_Bool bIsTblMode )
+ SwShellCrsr &rCrsr )
{
SwPosition *pStartPos = rCrsr.Start(),
*pEndPos = rCrsr.GetPoint() == pStartPos ? rCrsr.GetMark() : rCrsr.GetPoint();
@@ -2053,523 +2049,513 @@ void SwRootFrm::CalcFrmRects(
}
}
- //Fall 4: Tabellenselection
- if( bIsTblMode )
- {
- const SwFrm *pCell = pStartFrm->GetUpper();
- while ( !pCell->IsCellFrm() )
- pCell = pCell->GetUpper();
- SwRect aTmp( pCell->Prt() );
- aTmp.Pos() += pCell->Frm().Pos();
- aRegion.ChangeOrigin( aTmp );
- aRegion.Remove( 0, aRegion.Count() );
- aRegion.Insert( aTmp, 0 );
- }
- else
- {
- // falls eine nicht erlaubte Selection besteht, dann korrigiere das
- // nicht erlaubt ist Header/Footer/TableHeadline ueber 2 Seiten
- do { // middle check loop
- const SwLayoutFrm* pSttLFrm = pStartFrm->GetUpper();
- const sal_uInt16 cHdFtTblHd = FRM_HEADER | FRM_FOOTER | FRM_TAB;
- while( pSttLFrm &&
- ! (cHdFtTblHd & pSttLFrm->GetType() ))
- pSttLFrm = pSttLFrm->GetUpper();
- if( !pSttLFrm )
- break;
- const SwLayoutFrm* pEndLFrm = pEndFrm->GetUpper();
- while( pEndLFrm &&
- ! (cHdFtTblHd & pEndLFrm->GetType() ))
- pEndLFrm = pEndLFrm->GetUpper();
- if( !pEndLFrm )
- break;
+ // falls eine nicht erlaubte Selection besteht, dann korrigiere das
+ // nicht erlaubt ist Header/Footer/TableHeadline ueber 2 Seiten
+ do
+ { // middle check loop
+ const SwLayoutFrm* pSttLFrm = pStartFrm->GetUpper();
+ const sal_uInt16 cHdFtTblHd = FRM_HEADER | FRM_FOOTER | FRM_TAB;
+ while ( pSttLFrm
+ && !( cHdFtTblHd & pSttLFrm->GetType() ) )
+ {
+ pSttLFrm = pSttLFrm->GetUpper();
+ }
+ if ( !pSttLFrm )
+ break;
+ const SwLayoutFrm* pEndLFrm = pEndFrm->GetUpper();
+ while ( pEndLFrm
+ && !( cHdFtTblHd & pEndLFrm->GetType() ) )
+ {
+ pEndLFrm = pEndLFrm->GetUpper();
+ }
+ if ( !pEndLFrm )
+ break;
- ASSERT( pEndLFrm->GetType() == pSttLFrm->GetType(),
- "Selection ueber unterschiedliche Inhalte" );
- switch( pSttLFrm->GetType() )
- {
- case FRM_HEADER:
+ ASSERT( pEndLFrm->GetType() == pSttLFrm->GetType(),
+ "Selection ueber unterschiedliche Inhalte" );
+ switch (pSttLFrm->GetType())
+ {
+ case FRM_HEADER:
case FRM_FOOTER:
- // auf unterschiedlichen Seiten ??
- // dann immer auf die Start-Seite
- if( pEndLFrm->FindPageFrm() != pSttLFrm->FindPageFrm() )
- {
- // End- auf den Start-CntntFrame setzen
- if( pStartPos == rCrsr.GetPoint() )
- pEndFrm = pStartFrm;
- else
- pStartFrm = pEndFrm;
- }
- break;
- case FRM_TAB:
- // auf unterschiedlichen Seiten ??
- // existiert
- // dann teste auf Tabelle-Headline
- {
- const SwTabFrm* pTabFrm = (SwTabFrm*)pSttLFrm;
- if( ( pTabFrm->GetFollow() ||
- ((SwTabFrm*)pEndLFrm)->GetFollow() ) &&
- pTabFrm->GetTable()->GetRowsToRepeat() > 0 &&
- pTabFrm->GetLower() != ((SwTabFrm*)pEndLFrm)->GetLower() &&
- ( lcl_IsInRepeatedHeadline( pStartFrm ) ||
- lcl_IsInRepeatedHeadline( pEndFrm ) ) )
- {
- // End- auf den Start-CntntFrame setzen
- if( pStartPos == rCrsr.GetPoint() )
- pEndFrm = pStartFrm;
- else
- pStartFrm = pEndFrm;
- }
- }
- break;
+ // auf unterschiedlichen Seiten ??
+ // dann immer auf die Start-Seite
+ if ( pEndLFrm->FindPageFrm() != pSttLFrm->FindPageFrm() )
+ {
+ // End- auf den Start-CntntFrame setzen
+ if ( pStartPos == rCrsr.GetPoint() )
+ pEndFrm = pStartFrm;
+ else
+ pStartFrm = pEndFrm;
}
- } while( sal_False );
-
- SwCrsrMoveState aTmpState( MV_NONE );
- aTmpState.b2Lines = sal_True;
- aTmpState.bNoScroll = sal_True;
- aTmpState.nCursorBidiLevel = pStartFrm->IsRightToLeft() ? 1 : 0;
-
- //CntntRects zu Start- und EndFrms.
- SwRect aStRect, aEndRect;
- pStartFrm->GetCharRect( aStRect, *pStartPos, &aTmpState );
- Sw2LinesPos *pSt2Pos = aTmpState.p2Lines;
- aTmpState.p2Lines = NULL;
- aTmpState.nCursorBidiLevel = pEndFrm->IsRightToLeft() ? 1 : 0;
-
- pEndFrm->GetCharRect ( aEndRect, *pEndPos, &aTmpState );
- Sw2LinesPos *pEnd2Pos = aTmpState.p2Lines;
-
- SwRect aStFrm ( pStartFrm->UnionFrm( sal_True ) );
- aStFrm.Intersection( pStartFrm->PaintArea() );
- SwRect aEndFrm( pStartFrm == pEndFrm ? aStFrm : pEndFrm->UnionFrm( sal_True ) );
- if( pStartFrm != pEndFrm )
+ break;
+ case FRM_TAB:
+ // auf unterschiedlichen Seiten ??
+ // existiert
+ // dann teste auf Tabelle-Headline
{
- aEndFrm.Intersection( pEndFrm->PaintArea() );
+ const SwTabFrm* pTabFrm = (SwTabFrm*) pSttLFrm;
+ if ( ( pTabFrm->GetFollow()
+ || ( (SwTabFrm*) pEndLFrm )->GetFollow() )
+ && pTabFrm->GetTable()->GetRowsToRepeat() > 0
+ && pTabFrm->GetLower() != ( (SwTabFrm*) pEndLFrm )->GetLower()
+ && ( lcl_IsInRepeatedHeadline( pStartFrm )
+ || lcl_IsInRepeatedHeadline( pEndFrm ) ) )
+ {
+ // End- auf den Start-CntntFrame setzen
+ if ( pStartPos == rCrsr.GetPoint() )
+ pEndFrm = pStartFrm;
+ else
+ pStartFrm = pEndFrm;
+ }
}
- SWRECTFN( pStartFrm )
- const sal_Bool bR2L = pStartFrm->IsRightToLeft();
- const sal_Bool bEndR2L = pEndFrm->IsRightToLeft();
-
- // If there's no doubleline portion involved or start and end are both
- // in the same doubleline portion, all works fine, but otherwise
- // we need the following...
- if( pSt2Pos != pEnd2Pos && ( !pSt2Pos || !pEnd2Pos ||
- pSt2Pos->aPortion != pEnd2Pos->aPortion ) )
+ break;
+ }
+ } while ( sal_False);
+
+ SwCrsrMoveState aTmpState( MV_NONE );
+ aTmpState.b2Lines = sal_True;
+ aTmpState.bNoScroll = sal_True;
+ aTmpState.nCursorBidiLevel = pStartFrm->IsRightToLeft() ? 1 : 0;
+
+ //CntntRects zu Start- und EndFrms.
+ SwRect aStRect, aEndRect;
+ pStartFrm->GetCharRect( aStRect, *pStartPos, &aTmpState );
+ Sw2LinesPos *pSt2Pos = aTmpState.p2Lines;
+ aTmpState.p2Lines = NULL;
+ aTmpState.nCursorBidiLevel = pEndFrm->IsRightToLeft() ? 1 : 0;
+
+ pEndFrm->GetCharRect( aEndRect, *pEndPos, &aTmpState );
+ Sw2LinesPos *pEnd2Pos = aTmpState.p2Lines;
+
+ SwRect aStFrm( pStartFrm->UnionFrm( sal_True ) );
+ aStFrm.Intersection( pStartFrm->PaintArea() );
+ SwRect aEndFrm( pStartFrm == pEndFrm ? aStFrm : pEndFrm->UnionFrm( sal_True ) );
+ if ( pStartFrm != pEndFrm )
+ {
+ aEndFrm.Intersection( pEndFrm->PaintArea() );
+ }
+ SWRECTFN( pStartFrm )
+ const sal_Bool bR2L = pStartFrm->IsRightToLeft();
+ const sal_Bool bEndR2L = pEndFrm->IsRightToLeft();
+
+ // If there's no doubleline portion involved or start and end are both
+ // in the same doubleline portion, all works fine, but otherwise
+ // we need the following...
+ if ( pSt2Pos != pEnd2Pos
+ && ( !pSt2Pos || !pEnd2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion ) )
+ {
+ // If we have a start(end) position inside a doubleline portion
+ // the surrounded part of the doubleline portion is subtracted
+ // from the region and the aStRect(aEndRect) is set to the
+ // end(start) of the doubleline portion.
+ if ( pSt2Pos )
{
- // If we have a start(end) position inside a doubleline portion
- // the surrounded part of the doubleline portion is subtracted
- // from the region and the aStRect(aEndRect) is set to the
- // end(start) of the doubleline portion.
- if( pSt2Pos )
- {
- SwRect aTmp( aStRect );
+ SwRect aTmp( aStRect );
- // BiDi-Portions are swimming against the current.
- const sal_Bool bPorR2L = ( MT_BIDI == pSt2Pos->nMultiType ) ?
- ! bR2L :
- bR2L;
+ // BiDi-Portions are swimming against the current.
+ const sal_Bool bPorR2L = ( MT_BIDI == pSt2Pos->nMultiType ) ?
+ !bR2L :
+ bR2L;
- if( MT_BIDI == pSt2Pos->nMultiType &&
- (pSt2Pos->aPortion2.*fnRect->fnGetWidth)() )
- {
- // nested bidi portion
- long nRightAbs = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
- nRightAbs -= (pSt2Pos->aPortion2.*fnRect->fnGetLeft)();
- long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*fnRect->fnGetWidth)();
+ if ( MT_BIDI == pSt2Pos->nMultiType
+ && ( pSt2Pos->aPortion2.*fnRect->fnGetWidth )() )
+ {
+ // nested bidi portion
+ long nRightAbs = ( pSt2Pos->aPortion.*fnRect->fnGetRight )();
+ nRightAbs -= ( pSt2Pos->aPortion2.*fnRect->fnGetLeft )();
+ long nLeftAbs = nRightAbs - ( pSt2Pos->aPortion2.*fnRect->fnGetWidth )();
- (aTmp.*fnRect->fnSetRight)( nRightAbs );
+ ( aTmp.*fnRect->fnSetRight )( nRightAbs );
- if ( ! pEnd2Pos || pEnd2Pos->aPortion != pSt2Pos->aPortion )
- {
- SwRect aTmp2( pSt2Pos->aPortion );
- (aTmp2.*fnRect->fnSetRight)( nLeftAbs );
- aTmp2.Intersection( aEndFrm );
- Sub( aRegion, aTmp2 );
- }
- }
- else
+ if ( !pEnd2Pos || pEnd2Pos->aPortion != pSt2Pos->aPortion )
{
- if( bPorR2L )
- (aTmp.*fnRect->fnSetLeft)(
- (pSt2Pos->aPortion.*fnRect->fnGetLeft)() );
- else
- (aTmp.*fnRect->fnSetRight)(
- (pSt2Pos->aPortion.*fnRect->fnGetRight)() );
+ SwRect aTmp2( pSt2Pos->aPortion );
+ ( aTmp2.*fnRect->fnSetRight )( nLeftAbs );
+ aTmp2.Intersection( aEndFrm );
+ Sub( aRegion, aTmp2 );
}
+ }
+ else
+ {
+ if ( bPorR2L )
+ ( aTmp.*fnRect->fnSetLeft )(
+ ( pSt2Pos->aPortion.*fnRect->fnGetLeft )() );
+ else
+ ( aTmp.*fnRect->fnSetRight )(
+ ( pSt2Pos->aPortion.*fnRect->fnGetRight )() );
+ }
+
+ if ( MT_ROT_90 == pSt2Pos->nMultiType
+ || ( pSt2Pos->aPortion.*fnRect->fnGetTop )() == ( aTmp.*fnRect->fnGetTop )() )
+ {
+ ( aTmp.*fnRect->fnSetTop )(
+ ( pSt2Pos->aLine.*fnRect->fnGetTop )() );
+ }
+
+ aTmp.Intersection( aStFrm );
+ Sub( aRegion, aTmp );
- if( MT_ROT_90 == pSt2Pos->nMultiType ||
- (pSt2Pos->aPortion.*fnRect->fnGetTop)() ==
- (aTmp.*fnRect->fnGetTop)() )
+ SwTwips nTmp = ( pSt2Pos->aLine.*fnRect->fnGetBottom )();
+ if ( MT_ROT_90 != pSt2Pos->nMultiType
+ && ( aStRect.*fnRect->fnBottomDist )( nTmp ) > 0 )
+ {
+ ( aTmp.*fnRect->fnSetTop )( ( aTmp.*fnRect->fnGetBottom )() );
+ ( aTmp.*fnRect->fnSetBottom )( nTmp );
+ if ( ( aStRect.*fnRect->fnBottomDist )( ( pSt2Pos->aPortion.*fnRect->fnGetBottom )() ) > 0 )
{
- (aTmp.*fnRect->fnSetTop)(
- (pSt2Pos->aLine.*fnRect->fnGetTop)() );
+ if ( bPorR2L )
+ ( aTmp.*fnRect->fnSetRight )(
+ ( pSt2Pos->aPortion.*fnRect->fnGetRight )() );
+ else
+ ( aTmp.*fnRect->fnSetLeft )(
+ ( pSt2Pos->aPortion.*fnRect->fnGetLeft )() );
}
-
aTmp.Intersection( aStFrm );
Sub( aRegion, aTmp );
+ }
- SwTwips nTmp = (pSt2Pos->aLine.*fnRect->fnGetBottom)();
- if( MT_ROT_90 != pSt2Pos->nMultiType &&
- (aStRect.*fnRect->fnBottomDist)( nTmp ) > 0 )
- {
- (aTmp.*fnRect->fnSetTop)( (aTmp.*fnRect->fnGetBottom)() );
- (aTmp.*fnRect->fnSetBottom)( nTmp );
- if( (aStRect.*fnRect->fnBottomDist)(
- (pSt2Pos->aPortion.*fnRect->fnGetBottom)() ) > 0 )
- {
- if( bPorR2L )
- (aTmp.*fnRect->fnSetRight)(
- (pSt2Pos->aPortion.*fnRect->fnGetRight)() );
- else
- (aTmp.*fnRect->fnSetLeft)(
- (pSt2Pos->aPortion.*fnRect->fnGetLeft)() );
- }
- aTmp.Intersection( aStFrm );
- Sub( aRegion, aTmp );
- }
+ aStRect = pSt2Pos->aLine;
+ ( aStRect.*fnRect->fnSetLeft )( bR2L ?
+ ( pSt2Pos->aPortion.*fnRect->fnGetLeft )() :
+ ( pSt2Pos->aPortion.*fnRect->fnGetRight )() );
+ ( aStRect.*fnRect->fnSetWidth )( 1 );
+ }
- aStRect = pSt2Pos->aLine;
- (aStRect.*fnRect->fnSetLeft)( bR2L ?
- (pSt2Pos->aPortion.*fnRect->fnGetLeft)() :
- (pSt2Pos->aPortion.*fnRect->fnGetRight)() );
- (aStRect.*fnRect->fnSetWidth)( 1 );
- }
+ if ( pEnd2Pos )
+ {
+ SWRECTFNX( pEndFrm )
+ SwRect aTmp( aEndRect );
- if( pEnd2Pos )
+ // BiDi-Portions are swimming against the current.
+ const sal_Bool bPorR2L = ( MT_BIDI == pEnd2Pos->nMultiType ) ?
+ !bEndR2L :
+ bEndR2L;
+
+ if ( MT_BIDI == pEnd2Pos->nMultiType
+ && ( pEnd2Pos->aPortion2.*fnRectX->fnGetWidth )() )
{
- SWRECTFNX( pEndFrm )
- SwRect aTmp( aEndRect );
+ // nested bidi portion
+ long nRightAbs = ( pEnd2Pos->aPortion.*fnRectX->fnGetRight )();
+ nRightAbs = nRightAbs - ( pEnd2Pos->aPortion2.*fnRectX->fnGetLeft )();
+ long nLeftAbs = nRightAbs - ( pEnd2Pos->aPortion2.*fnRectX->fnGetWidth )();
- // BiDi-Portions are swimming against the current.
- const sal_Bool bPorR2L = ( MT_BIDI == pEnd2Pos->nMultiType ) ?
- ! bEndR2L :
- bEndR2L;
+ ( aTmp.*fnRectX->fnSetLeft )( nLeftAbs );
- if( MT_BIDI == pEnd2Pos->nMultiType &&
- (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)() )
+ if ( !pSt2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion )
{
- // nested bidi portion
- long nRightAbs = (pEnd2Pos->aPortion.*fnRectX->fnGetRight)();
- nRightAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetLeft)();
- long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)();
-
- (aTmp.*fnRectX->fnSetLeft)( nLeftAbs );
-
- if ( ! pSt2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion )
- {
- SwRect aTmp2( pEnd2Pos->aPortion );
- (aTmp2.*fnRectX->fnSetLeft)( nRightAbs );
- aTmp2.Intersection( aEndFrm );
- Sub( aRegion, aTmp2 );
- }
+ SwRect aTmp2( pEnd2Pos->aPortion );
+ ( aTmp2.*fnRectX->fnSetLeft )( nRightAbs );
+ aTmp2.Intersection( aEndFrm );
+ Sub( aRegion, aTmp2 );
}
+ }
+ else
+ {
+ if ( bPorR2L )
+ ( aTmp.*fnRectX->fnSetRight )(
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetRight )() );
else
- {
- if ( bPorR2L )
- (aTmp.*fnRectX->fnSetRight)(
- (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() );
- else
- (aTmp.*fnRectX->fnSetLeft)(
- (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
- }
+ ( aTmp.*fnRectX->fnSetLeft )(
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetLeft )() );
+ }
- if( MT_ROT_90 == pEnd2Pos->nMultiType ||
- (pEnd2Pos->aPortion.*fnRectX->fnGetBottom)() ==
- (aEndRect.*fnRectX->fnGetBottom)() )
- {
- (aTmp.*fnRectX->fnSetBottom)(
- (pEnd2Pos->aLine.*fnRectX->fnGetBottom)() );
- }
+ if ( MT_ROT_90 == pEnd2Pos->nMultiType
+ || ( pEnd2Pos->aPortion.*fnRectX->fnGetBottom )() == ( aEndRect.*fnRectX->fnGetBottom )() )
+ {
+ ( aTmp.*fnRectX->fnSetBottom )(
+ ( pEnd2Pos->aLine.*fnRectX->fnGetBottom )() );
+ }
- aTmp.Intersection( aEndFrm );
- Sub( aRegion, aTmp );
+ aTmp.Intersection( aEndFrm );
+ Sub( aRegion, aTmp );
- // The next statement means neither ruby nor rotate(90):
- if( !( MT_RUBY & pEnd2Pos->nMultiType ) )
+ // The next statement means neither ruby nor rotate(90):
+ if ( !( MT_RUBY & pEnd2Pos->nMultiType ) )
+ {
+ SwTwips nTmp = ( pEnd2Pos->aLine.*fnRectX->fnGetTop )();
+ if ( ( aEndRect.*fnRectX->fnGetTop )() != nTmp )
{
- SwTwips nTmp = (pEnd2Pos->aLine.*fnRectX->fnGetTop)();
- if( (aEndRect.*fnRectX->fnGetTop)() != nTmp )
+ ( aTmp.*fnRectX->fnSetBottom )(
+ ( aTmp.*fnRectX->fnGetTop )() );
+ ( aTmp.*fnRectX->fnSetTop )( nTmp );
+ if ( ( aEndRect.*fnRectX->fnGetTop )() !=
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetTop )() )
{
- (aTmp.*fnRectX->fnSetBottom)(
- (aTmp.*fnRectX->fnGetTop)() );
- (aTmp.*fnRectX->fnSetTop)( nTmp );
- if( (aEndRect.*fnRectX->fnGetTop)() !=
- (pEnd2Pos->aPortion.*fnRectX->fnGetTop)() )
- {
- if( bPorR2L )
- (aTmp.*fnRectX->fnSetLeft)(
- (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
- else
- (aTmp.*fnRectX->fnSetRight)(
- (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() );
- }
- aTmp.Intersection( aEndFrm );
- Sub( aRegion, aTmp );
+ if ( bPorR2L )
+ ( aTmp.*fnRectX->fnSetLeft )(
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetLeft )() );
+ else
+ ( aTmp.*fnRectX->fnSetRight )(
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetRight )() );
}
+ aTmp.Intersection( aEndFrm );
+ Sub( aRegion, aTmp );
}
-
- aEndRect = pEnd2Pos->aLine;
- (aEndRect.*fnRectX->fnSetLeft)( bEndR2L ?
- (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() :
- (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
- (aEndRect.*fnRectX->fnSetWidth)( 1 );
- }
- }
- else if( pSt2Pos && pEnd2Pos &&
- MT_BIDI == pSt2Pos->nMultiType &&
- MT_BIDI == pEnd2Pos->nMultiType &&
- pSt2Pos->aPortion == pEnd2Pos->aPortion &&
- pSt2Pos->aPortion2 != pEnd2Pos->aPortion2 )
- {
- // This is the ugly special case, where the selection starts and
- // ends in the same bidi portion but one start or end is inside a
- // nested bidi portion.
-
- if ( (pSt2Pos->aPortion2.*fnRect->fnGetWidth)() )
- {
- SwRect aTmp( aStRect );
- long nRightAbs = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
- nRightAbs -= (pSt2Pos->aPortion2.*fnRect->fnGetLeft)();
- long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*fnRect->fnGetWidth)();
-
- (aTmp.*fnRect->fnSetRight)( nRightAbs );
- aTmp.Intersection( aStFrm );
- Sub( aRegion, aTmp );
-
- aStRect = pSt2Pos->aLine;
- (aStRect.*fnRect->fnSetLeft)( bR2L ? nRightAbs : nLeftAbs );
- (aStRect.*fnRect->fnSetWidth)( 1 );
}
- SWRECTFNX( pEndFrm )
- if ( (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)() )
- {
- SwRect aTmp( aEndRect );
- long nRightAbs = (pEnd2Pos->aPortion.*fnRectX->fnGetRight)();
- nRightAbs -= (pEnd2Pos->aPortion2.*fnRectX->fnGetLeft)();
- long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)();
+ aEndRect = pEnd2Pos->aLine;
+ ( aEndRect.*fnRectX->fnSetLeft )( bEndR2L ?
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetRight )() :
+ ( pEnd2Pos->aPortion.*fnRectX->fnGetLeft )() );
+ ( aEndRect.*fnRectX->fnSetWidth )( 1 );
+ }
+ }
+ else if ( pSt2Pos && pEnd2Pos
+ && MT_BIDI == pSt2Pos->nMultiType
+ && MT_BIDI == pEnd2Pos->nMultiType
+ && pSt2Pos->aPortion == pEnd2Pos->aPortion
+ && pSt2Pos->aPortion2 != pEnd2Pos->aPortion2 )
+ {
+ // This is the ugly special case, where the selection starts and
+ // ends in the same bidi portion but one start or end is inside a
+ // nested bidi portion.
- (aTmp.*fnRectX->fnSetLeft)( nLeftAbs );
- aTmp.Intersection( aEndFrm );
- Sub( aRegion, aTmp );
+ if ( ( pSt2Pos->aPortion2.*fnRect->fnGetWidth )() )
+ {
+ SwRect aTmp( aStRect );
+ long nRightAbs = ( pSt2Pos->aPortion.*fnRect->fnGetRight )();
+ nRightAbs -= ( pSt2Pos->aPortion2.*fnRect->fnGetLeft )();
+ long nLeftAbs = nRightAbs - ( pSt2Pos->aPortion2.*fnRect->fnGetWidth )();
+
+ ( aTmp.*fnRect->fnSetRight )( nRightAbs );
+ aTmp.Intersection( aStFrm );
+ Sub( aRegion, aTmp );
+
+ aStRect = pSt2Pos->aLine;
+ ( aStRect.*fnRect->fnSetLeft )( bR2L ? nRightAbs : nLeftAbs );
+ ( aStRect.*fnRect->fnSetWidth )( 1 );
+ }
- aEndRect = pEnd2Pos->aLine;
- (aEndRect.*fnRectX->fnSetLeft)( bEndR2L ? nLeftAbs : nRightAbs );
- (aEndRect.*fnRectX->fnSetWidth)( 1 );
- }
+ SWRECTFNX( pEndFrm )
+ if ( ( pEnd2Pos->aPortion2.*fnRectX->fnGetWidth )() )
+ {
+ SwRect aTmp( aEndRect );
+ long nRightAbs = ( pEnd2Pos->aPortion.*fnRectX->fnGetRight )();
+ nRightAbs -= ( pEnd2Pos->aPortion2.*fnRectX->fnGetLeft )();
+ long nLeftAbs = nRightAbs - ( pEnd2Pos->aPortion2.*fnRectX->fnGetWidth )();
+
+ ( aTmp.*fnRectX->fnSetLeft )( nLeftAbs );
+ aTmp.Intersection( aEndFrm );
+ Sub( aRegion, aTmp );
+
+ aEndRect = pEnd2Pos->aLine;
+ ( aEndRect.*fnRectX->fnSetLeft )( bEndR2L ? nLeftAbs : nRightAbs );
+ ( aEndRect.*fnRectX->fnSetWidth )( 1 );
}
+ }
- // The charrect may be outside the paintarea (for cursortravelling)
- // but the selection has to be restricted to the paintarea
- if( aStRect.Left() < aStFrm.Left() )
- aStRect.Left( aStFrm.Left() );
- else if( aStRect.Left() > aStFrm.Right() )
- aStRect.Left( aStFrm.Right() );
- SwTwips nTmp = aStRect.Right();
- if( nTmp < aStFrm.Left() )
- aStRect.Right( aStFrm.Left() );
- else if( nTmp > aStFrm.Right() )
- aStRect.Right( aStFrm.Right() );
- if( aEndRect.Left() < aEndFrm.Left() )
- aEndRect.Left( aEndFrm.Left() );
- else if( aEndRect.Left() > aEndFrm.Right() )
- aEndRect.Left( aEndFrm.Right() );
- nTmp = aEndRect.Right();
- if( nTmp < aEndFrm.Left() )
- aEndRect.Right( aEndFrm.Left() );
- else if( nTmp > aEndFrm.Right() )
- aEndRect.Right( aEndFrm.Right() );
-
- if( pStartFrm == pEndFrm )
+ // The charrect may be outside the paintarea (for cursortravelling)
+ // but the selection has to be restricted to the paintarea
+ if ( aStRect.Left() < aStFrm.Left() )
+ aStRect.Left( aStFrm.Left() );
+ else if ( aStRect.Left() > aStFrm.Right() )
+ aStRect.Left( aStFrm.Right() );
+ SwTwips nTmp = aStRect.Right();
+ if ( nTmp < aStFrm.Left() )
+ aStRect.Right( aStFrm.Left() );
+ else if ( nTmp > aStFrm.Right() )
+ aStRect.Right( aStFrm.Right() );
+ if ( aEndRect.Left() < aEndFrm.Left() )
+ aEndRect.Left( aEndFrm.Left() );
+ else if ( aEndRect.Left() > aEndFrm.Right() )
+ aEndRect.Left( aEndFrm.Right() );
+ nTmp = aEndRect.Right();
+ if ( nTmp < aEndFrm.Left() )
+ aEndRect.Right( aEndFrm.Left() );
+ else if ( nTmp > aEndFrm.Right() )
+ aEndRect.Right( aEndFrm.Right() );
+
+ if ( pStartFrm == pEndFrm )
+ {
+ sal_Bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos
+ && ( MT_BIDI & pSt2Pos->nMultiType )
+ && pSt2Pos->aPortion == pEnd2Pos->aPortion;
+ //case 1: (Same frame and same row)
+ if ( bSameRotatedOrBidi
+ || ( aStRect.*fnRect->fnGetTop )() == ( aEndRect.*fnRect->fnGetTop )() )
{
- sal_Bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos &&
- ( MT_BIDI & pSt2Pos->nMultiType ) &&
- pSt2Pos->aPortion == pEnd2Pos->aPortion;
- //case 1: (Same frame and same row)
- if( bSameRotatedOrBidi ||
- (aStRect.*fnRect->fnGetTop)() == (aEndRect.*fnRect->fnGetTop)() )
+ Point aTmpSt( aStRect.Pos() );
+ Point aTmpEnd( aEndRect.Right(), aEndRect.Bottom() );
+ if ( bSameRotatedOrBidi || bR2L )
{
- Point aTmpSt( aStRect.Pos() );
- Point aTmpEnd( aEndRect.Right(), aEndRect.Bottom() );
- if( bSameRotatedOrBidi || bR2L )
+ if ( aTmpSt.Y() > aTmpEnd.Y() )
{
- if( aTmpSt.Y() > aTmpEnd.Y() )
- {
- long nTmpY = aTmpEnd.Y();
- aTmpEnd.Y() = aTmpSt.Y();
- aTmpSt.Y() = nTmpY;
- }
- if( aTmpSt.X() > aTmpEnd.X() )
- {
- long nTmpX = aTmpEnd.X();
- aTmpEnd.X() = aTmpSt.X();
- aTmpSt.X() = nTmpX;
- }
+ long nTmpY = aTmpEnd.Y();
+ aTmpEnd.Y() = aTmpSt.Y();
+ aTmpSt.Y() = nTmpY;
}
-
- SwRect aTmp = SwRect( aTmpSt, aTmpEnd );
- // Bug 34888: falls Inhalt selektiert ist, der keinen Platz
- // einnimmt (z.B. PostIts,RefMarks, TOXMarks),
- // dann mindestens die Breite des Crsr setzen.
- if( 1 == (aTmp.*fnRect->fnGetWidth)() &&
- pStartPos->nContent.GetIndex() !=
- pEndPos->nContent.GetIndex() )
+ if ( aTmpSt.X() > aTmpEnd.X() )
{
- OutputDevice* pOut = pSh->GetOut();
- long nCrsrWidth = pOut->GetSettings().GetStyleSettings().
- GetCursorSize();
- (aTmp.*fnRect->fnSetWidth)( pOut->PixelToLogic(
- Size( nCrsrWidth, 0 ) ).Width() );
+ long nTmpX = aTmpEnd.X();
+ aTmpEnd.X() = aTmpSt.X();
+ aTmpSt.X() = nTmpX;
}
- aTmp.Intersection( aStFrm );
- Sub( aRegion, aTmp );
}
- //case 2: (Same frame, but not the same line)
- else
- {
- SwTwips lLeft, lRight;
- if( pSt2Pos && pEnd2Pos && pSt2Pos->aPortion == pEnd2Pos->aPortion )
- {
- lLeft = (pSt2Pos->aPortion.*fnRect->fnGetLeft)();
- lRight = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
- }
- else
- {
- lLeft = (pStartFrm->Frm().*fnRect->fnGetLeft)() +
- (pStartFrm->Prt().*fnRect->fnGetLeft)();
- lRight = (pStartFrm->Frm().*fnRect->fnGetLeft)() +
- (pStartFrm->Prt().*fnRect->fnGetRight)();
- }
- if( lLeft < (aStFrm.*fnRect->fnGetLeft)() )
- lLeft = (aStFrm.*fnRect->fnGetLeft)();
- if( lRight > (aStFrm.*fnRect->fnGetRight)() )
- lRight = (aStFrm.*fnRect->fnGetRight)();
- SwRect aSubRect( aStRect );
- //First line
- if( bR2L )
- (aSubRect.*fnRect->fnSetLeft)( lLeft );
- else
- (aSubRect.*fnRect->fnSetRight)( lRight );
- Sub( aRegion, aSubRect );
- //If there's at least a twips between start- and endline,
- //so the whole area between will be added.
- SwTwips aTmpBottom = (aStRect.*fnRect->fnGetBottom)();
- SwTwips aTmpTop = (aEndRect.*fnRect->fnGetTop)();
- if( aTmpBottom != aTmpTop )
- {
- (aSubRect.*fnRect->fnSetLeft)( lLeft );
- (aSubRect.*fnRect->fnSetRight)( lRight );
- (aSubRect.*fnRect->fnSetTop)( aTmpBottom );
- (aSubRect.*fnRect->fnSetBottom)( aTmpTop );
- Sub( aRegion, aSubRect );
- }
- //and the last line
- aSubRect = aEndRect;
- if( bR2L )
- (aSubRect.*fnRect->fnSetRight)( lRight );
- else
- (aSubRect.*fnRect->fnSetLeft)( lLeft );
- Sub( aRegion, aSubRect );
+ SwRect aTmp = SwRect( aTmpSt, aTmpEnd );
+ // Bug 34888: falls Inhalt selektiert ist, der keinen Platz
+ // einnimmt (z.B. PostIts,RefMarks, TOXMarks),
+ // dann mindestens die Breite des Crsr setzen.
+ if ( 1 == ( aTmp.*fnRect->fnGetWidth )() &&
+ pStartPos->nContent.GetIndex() !=
+ pEndPos->nContent.GetIndex() )
+ {
+ OutputDevice* pOut = pSh->GetOut();
+ long nCrsrWidth = pOut->GetSettings().GetStyleSettings().
+ GetCursorSize();
+ ( aTmp.*fnRect->fnSetWidth )( pOut->PixelToLogic(
+ Size( nCrsrWidth, 0 ) ).Width() );
}
+ aTmp.Intersection( aStFrm );
+ Sub( aRegion, aTmp );
}
- //case 3: (Different frames, maybe with ohther frames between
+ //case 2: (Same frame, but not the same line)
else
{
- //The startframe first...
+ SwTwips lLeft, lRight;
+ if ( pSt2Pos && pEnd2Pos && pSt2Pos->aPortion == pEnd2Pos->aPortion )
+ {
+ lLeft = ( pSt2Pos->aPortion.*fnRect->fnGetLeft )();
+ lRight = ( pSt2Pos->aPortion.*fnRect->fnGetRight )();
+ }
+ else
+ {
+ lLeft = ( pStartFrm->Frm().*fnRect->fnGetLeft )() +
+ ( pStartFrm->Prt().*fnRect->fnGetLeft )();
+ lRight = ( pStartFrm->Frm().*fnRect->fnGetLeft )() +
+ ( pStartFrm->Prt().*fnRect->fnGetRight )();
+ }
+ if ( lLeft < ( aStFrm.*fnRect->fnGetLeft )() )
+ lLeft = ( aStFrm.*fnRect->fnGetLeft )();
+ if ( lRight > ( aStFrm.*fnRect->fnGetRight )() )
+ lRight = ( aStFrm.*fnRect->fnGetRight )();
SwRect aSubRect( aStRect );
- if( bR2L )
- (aSubRect.*fnRect->fnSetLeft)( (aStFrm.*fnRect->fnGetLeft)());
+ //First line
+ if ( bR2L )
+ ( aSubRect.*fnRect->fnSetLeft )( lLeft );
else
- (aSubRect.*fnRect->fnSetRight)( (aStFrm.*fnRect->fnGetRight)());
+ ( aSubRect.*fnRect->fnSetRight )( lRight );
Sub( aRegion, aSubRect );
- SwTwips nTmpTwips = (aStRect.*fnRect->fnGetBottom)();
- if( (aStFrm.*fnRect->fnGetBottom)() != nTmpTwips )
+
+ //If there's at least a twips between start- and endline,
+ //so the whole area between will be added.
+ SwTwips aTmpBottom = ( aStRect.*fnRect->fnGetBottom )();
+ SwTwips aTmpTop = ( aEndRect.*fnRect->fnGetTop )();
+ if ( aTmpBottom != aTmpTop )
{
- aSubRect = aStFrm;
- (aSubRect.*fnRect->fnSetTop)( nTmpTwips );
+ ( aSubRect.*fnRect->fnSetLeft )( lLeft );
+ ( aSubRect.*fnRect->fnSetRight )( lRight );
+ ( aSubRect.*fnRect->fnSetTop )( aTmpBottom );
+ ( aSubRect.*fnRect->fnSetBottom )( aTmpTop );
Sub( aRegion, aSubRect );
}
+ //and the last line
+ aSubRect = aEndRect;
+ if ( bR2L )
+ ( aSubRect.*fnRect->fnSetRight )( lRight );
+ else
+ ( aSubRect.*fnRect->fnSetLeft )( lLeft );
+ Sub( aRegion, aSubRect );
+ }
+ }
+ //case 3: (Different frames, maybe with ohther frames between
+ else
+ {
+ //The startframe first...
+ SwRect aSubRect( aStRect );
+ if ( bR2L )
+ ( aSubRect.*fnRect->fnSetLeft )( ( aStFrm.*fnRect->fnGetLeft )() );
+ else
+ ( aSubRect.*fnRect->fnSetRight )( ( aStFrm.*fnRect->fnGetRight )() );
+ Sub( aRegion, aSubRect );
+ SwTwips nTmpTwips = ( aStRect.*fnRect->fnGetBottom )();
+ if ( ( aStFrm.*fnRect->fnGetBottom )() != nTmpTwips )
+ {
+ aSubRect = aStFrm;
+ ( aSubRect.*fnRect->fnSetTop )( nTmpTwips );
+ Sub( aRegion, aSubRect );
+ }
- //Now the frames between, if there are any
- sal_Bool bBody = pStartFrm->IsInDocBody();
- const SwTableBox* pCellBox = pStartFrm->GetUpper()->IsCellFrm() ?
- ((SwCellFrm*)pStartFrm->GetUpper())->GetTabBox() : 0;
- const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
- SwRect aPrvRect;
-
- ASSERT( pCntnt,
- "<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
- while ( pCntnt && pCntnt != pEndFrm )
+ //Now the frames between, if there are any
+ sal_Bool bBody = pStartFrm->IsInDocBody();
+ const SwTableBox* pCellBox = pStartFrm->GetUpper()->IsCellFrm() ?
+ ( (SwCellFrm*) pStartFrm->GetUpper() )->GetTabBox() :
+ 0;
+ const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
+ SwRect aPrvRect;
+
+ ASSERT( pCntnt,
+ "<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
+ while (pCntnt && pCntnt != pEndFrm)
+ {
+ if ( pCntnt->IsInFly() )
{
- if ( pCntnt->IsInFly() )
- {
- const SwAnchoredObject* pObj = pCntnt->FindFlyFrm();
- aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
- }
+ const SwAnchoredObject* pObj = pCntnt->FindFlyFrm();
+ aSortObjs.Insert( *( const_cast< SwAnchoredObject* >( pObj ) ) );
+ }
- // Consider only frames which have the same IsInDocBody value like pStartFrm
- // If pStartFrm is inside a SwCellFrm, consider only frames which are inside the
- // same cell frame (or its follow cell)
- const SwTableBox* pTmpCellBox = pCntnt->GetUpper()->IsCellFrm() ?
- ((SwCellFrm*)pCntnt->GetUpper())->GetTabBox() : 0;
- if ( bBody == pCntnt->IsInDocBody() &&
- ( !pCellBox || pCellBox == pTmpCellBox ) )
+ // Consider only frames which have the same IsInDocBody value like pStartFrm
+ // If pStartFrm is inside a SwCellFrm, consider only frames which are inside the
+ // same cell frame (or its follow cell)
+ const SwTableBox* pTmpCellBox = pCntnt->GetUpper()->IsCellFrm() ?
+ ( (SwCellFrm*) pCntnt->GetUpper() )->GetTabBox() :
+ 0;
+ if ( bBody == pCntnt->IsInDocBody() &&
+ ( !pCellBox || pCellBox == pTmpCellBox ) )
+ {
+ SwRect aCRect( pCntnt->UnionFrm( sal_True ) );
+ aCRect.Intersection( pCntnt->PaintArea() );
+ if ( aCRect.IsOver( aRegion.GetOrigin() ) )
{
- SwRect aCRect( pCntnt->UnionFrm( sal_True ) );
- aCRect.Intersection( pCntnt->PaintArea() );
- if( aCRect.IsOver( aRegion.GetOrigin() ))
+ SwRect aTmp( aPrvRect );
+ aTmp.Union( aCRect );
+ if ( ( aPrvRect.Height() * aPrvRect.Width() +
+ aCRect.Height() * aCRect.Width() )
+ ==
+ ( aTmp.Height() * aTmp.Width() ) )
{
- SwRect aTmp( aPrvRect );
- aTmp.Union( aCRect );
- if ( (aPrvRect.Height() * aPrvRect.Width() +
- aCRect.Height() * aCRect.Width()) ==
- (aTmp.Height() * aTmp.Width()) )
- {
- aPrvRect.Union( aCRect );
- }
- else
- {
- if ( aPrvRect.HasArea() )
- Sub( aRegion, aPrvRect );
- aPrvRect = aCRect;
- }
+ aPrvRect.Union( aCRect );
+ }
+ else
+ {
+ if ( aPrvRect.HasArea() )
+ Sub( aRegion, aPrvRect );
+ aPrvRect = aCRect;
}
}
- pCntnt = pCntnt->GetNextCntntFrm();
- ASSERT( pCntnt,
- "<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
}
- if ( aPrvRect.HasArea() )
- Sub( aRegion, aPrvRect );
-
- //At least the endframe...
- bVert = pEndFrm->IsVertical();
- bRev = pEndFrm->IsReverse();
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- fnRect = bVert ? ( bRev ? fnRectVL2R : ( pEndFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) ) :
- ( bRev ? fnRectB2T : fnRectHori );
- nTmpTwips = (aEndRect.*fnRect->fnGetTop)();
- if( (aEndFrm.*fnRect->fnGetTop)() != nTmpTwips )
- {
- aSubRect = aEndFrm;
- (aSubRect.*fnRect->fnSetBottom)( nTmpTwips );
- Sub( aRegion, aSubRect );
- }
- aSubRect = aEndRect;
- if( bEndR2L )
- (aSubRect.*fnRect->fnSetRight)((aEndFrm.*fnRect->fnGetRight)());
- else
- (aSubRect.*fnRect->fnSetLeft)( (aEndFrm.*fnRect->fnGetLeft)() );
+ pCntnt = pCntnt->GetNextCntntFrm();
+ ASSERT( pCntnt,
+ "<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
+ }
+ if ( aPrvRect.HasArea() )
+ Sub( aRegion, aPrvRect );
+
+ //At least the endframe...
+ bVert = pEndFrm->IsVertical();
+ bRev = pEndFrm->IsReverse();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = bVert ? ( bRev ? fnRectVL2R : ( pEndFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) ) :
+ ( bRev ? fnRectB2T : fnRectHori );
+ nTmpTwips = ( aEndRect.*fnRect->fnGetTop )();
+ if ( ( aEndFrm.*fnRect->fnGetTop )() != nTmpTwips )
+ {
+ aSubRect = aEndFrm;
+ ( aSubRect.*fnRect->fnSetBottom )( nTmpTwips );
Sub( aRegion, aSubRect );
}
-
- aRegion.Invert();
- delete pSt2Pos;
- delete pEnd2Pos;
+ aSubRect = aEndRect;
+ if ( bEndR2L )
+ ( aSubRect.*fnRect->fnSetRight )( ( aEndFrm.*fnRect->fnGetRight )() );
+ else
+ ( aSubRect.*fnRect->fnSetLeft )( ( aEndFrm.*fnRect->fnGetLeft )() );
+ Sub( aRegion, aSubRect );
}
+ aRegion.Invert();
+ delete pSt2Pos;
+ delete pEnd2Pos;
+
//Flys mit Durchlauf ausstanzen. Nicht ausgestanzt werden Flys:
//- die Lower des StartFrm/EndFrm sind (FlyInCnt und alle Flys die wiederum
// darin sitzen)
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index ea5576427099..ae8a2056f37e 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -70,8 +70,8 @@
#include <cellfrm.hxx>
#include <dbg_lay.hxx>
#include <editeng/frmdiritem.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
+#include <svx/xdef.hxx>
using namespace ::com::sun::star;
@@ -2885,7 +2885,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
}
else
{
- // variable size of body|section frame has shrinked. Thus,
+ // variable size of body|section frame has shrunk. Thus,
// invalidate all lowers not matching the new body|section size
// and the dedicated new last lower.
if( bVert )
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 8466034d65ed..2e917fbf55a2 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -907,7 +907,7 @@ sal_Bool SwOLEObj::UnloadObject( uno::Reference< embed::XEmbeddedObject > xObj,
if ( xPers.is() )
xPers->storeOwn();
else {
- DBG_ERROR("Modified object without persistance in cache!");
+ DBG_ERROR("Modified object without persistence in cache!");
}
}
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index fcf37213bb53..57e2dc371bf4 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -837,7 +837,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
// box, the left and right border does not need to be changed.
// The right and bottom border instead has to be derived from the right-
// bottom box of the selection. If this is a overlapped cell,
- // the appropiate master box.
+ // the appropriate master box.
SwTableBox* pLastBox = 0; // the right-bottom (master) cell
SwDoc* pDoc = GetFrmFmt()->GetDoc();
SwPosition aInsPos( *pMergeBox->GetSttNd()->EndOfSectionNode() );
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index c3973a95a953..26d5edec6177 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -214,7 +214,7 @@ sal_Bool IsItemIncluded( const sal_uInt16 nWhich, const SwTxtAttr *pAttr )
* depending on its 'visited' state. There are actually two cases, which
* should override the colors from the character attribute:
* 1. We never take the 'visited' color during printing/pdf export/preview
- * 2. The user has choosen to override these colors in the view options
+ * 2. The user has chosen to override these colors in the view options
*************************************************************************/
bool lcl_ChgHyperLinkColor( const SwTxtAttr& rAttr,
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 714374bb0313..185e5299b283 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -378,7 +378,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// if we are formatting multi portions we want to allow line breaks
// at the border between single line and multi line portion
- // we have to be carefull with footnote portions, they always come in
+ // we have to be careful with footnote portions, they always come in
// with an index 0
if ( nBreakPos < rInf.GetLineStart() && rInf.IsFirstMulti() &&
! rInf.IsFtnInside() )
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 7b28257d0639..d964c6a7d71d 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -464,7 +464,7 @@ SwPosSize SwTxtSizeInfo::GetTxtSize() const
const SwScriptInfo& rSI =
( (SwParaPortion*)GetParaPortion() )->GetScriptInfo();
- // in some cases, compression is not allowed or surpressed for
+ // in some cases, compression is not allowed or suppressed for
// performance reasons
sal_uInt16 nComp =( SW_CJK == GetFont()->GetActual() &&
rSI.CountCompChg() &&
@@ -610,7 +610,7 @@ sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf )
SwRect aOrigBackRect;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
/// OD 21.08.2002
/// consider, that [GetBackgroundBrush(...)] can set <pCol>
@@ -690,7 +690,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
if ( ! rPor.InFldGrp() )
pSI = &GetParaPortion()->GetScriptInfo();
- // in some cases, kana compression is not allowed or surpressed for
+ // in some cases, kana compression is not allowed or suppressed for
// performance reasons
sal_uInt16 nComp = 0;
if ( ! IsMulti() )
@@ -1177,7 +1177,7 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked)
*************************************************************************/
void SwTxtPaintInfo::DrawBackground( const SwLinePortion &rPor ) const
{
- ASSERT( OnWin(), "SwTxtPaintInfo::DrawBackground: printer polution ?" );
+ ASSERT( OnWin(), "SwTxtPaintInfo::DrawBackground: printer pollution ?" );
SwRect aIntersect;
CalcRect( rPor, 0, &aIntersect );
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 7c2dee8c4e70..b8fd8bccf021 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -817,7 +817,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
* SwTxtNode::GetScalingOfSelectedText()
*
* Calculates the width of the text part specified by nStt and nEnd,
- * the height of the line containing nStt is devided by this width,
+ * the height of the line containing nStt is divided by this width,
* indicating the scaling factor, if the text part is rotated.
* Having CH_BREAKs in the text part, this method returns the scaling
* factor for the longest of the text parts separated by the CH_BREAKs.
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index eb1871f5fd8c..8d13282e5d72 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -215,7 +215,7 @@ SwLinePortion *SwTxtFormatter::UnderFlow( SwTxtFormatInfo &rInf )
pTmpPrev->Move( rInf );
rInf.SetLast( pTmpPrev );
pTmpPrev = pTmpPrev->GetPortion();
- ASSERT( pTmpPrev, "UnderFlow: Loosing control!" );
+ ASSERT( pTmpPrev, "UnderFlow: Losing control!" );
};
}
pPor = pPor->GetPortion();
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index 1ea43236d5cb..7cc6e38d51f3 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -81,7 +81,7 @@ class SwTxtFormatter : public SwTxtPainter
// wird von SwTxtFormatter wegen UpdatePos ueberladen
void CalcAdjustLine( SwLineLayout *pCurr );
- // consideres line spacing attributes
+ // considers line spacing attributes
void CalcRealHeight( sal_Bool bNewLine = sal_False );
// uebertraegt die Daten nach rInf
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index c7f82cf751f2..5616551a1eab 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -437,7 +437,7 @@ void SwFldPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
SwFontSave aSave( rInf, pFnt );
- ASSERT( GetLen() <= 1, "SwFldPortion::Paint: rest-portion polution?" );
+ ASSERT( GetLen() <= 1, "SwFldPortion::Paint: rest-portion pollution?" );
if( Width() && ( !bPlaceHolder || rInf.GetOpt().IsShowPlaceHolderFields() ) )
{
// Dies ist eine freizuegige Auslegung der Hintergrundbelegung ...
@@ -1144,7 +1144,7 @@ SwCombinedPortion::SwCombinedPortion( const XubString &rTxt )
void SwCombinedPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
- ASSERT( GetLen() <= 1, "SwFldPortion::Paint: rest-portion polution?" );
+ ASSERT( GetLen() <= 1, "SwFldPortion::Paint: rest-portion pollution?" );
if( Width() )
{
rInf.DrawBackBrush( *this );
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 24eadeb4254a..9dbd2f2f07ba 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1063,7 +1063,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
{
// If bOn is sal_False and the next attribute starts later than rPos
// the winner attribute is interrupted at rPos.
- // If the start of the next atribute is behind the end of
+ // If the start of the next attribute is behind the end of
// the last attribute on the aEnd-stack, this is the endposition
// on the stack is the end of the 2-line portion.
if( !bOn || aEnd.back() < *pTmp->GetStart() )
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 02aa72613997..e1f0ca0280ab 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -814,7 +814,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
sal_Bool bGrow = ( pDrop->GetLen() != 0 );
- // for growing controll
+ // for growing control
long nMax = KSHRT_MAX;
long nMin = nFactor / 2;
#if OSL_DEBUG_LEVEL > 1
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index c47a6319f797..7a6f6b193c30 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1679,7 +1679,7 @@ SwContourCache::~SwContourCache()
void SwContourCache::ClrObject( MSHORT nPos )
{
- ASSERT( pTextRanger[ nPos ], "ClrObject: Allready cleared. Good Bye!" );
+ ASSERT( pTextRanger[ nPos ], "ClrObject: Already cleared. Good Bye!" );
nPntCnt -= pTextRanger[ nPos ]->GetPointCount();
delete pTextRanger[ nPos ];
--nObjCnt;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index dc38db89b4fc..0fbe3b9e0b4b 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1037,8 +1037,8 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
break;
case RES_UPDATE_ATTR:
{
- nPos = ((SwUpdateAttr*)pNew)->nStart;
- nLen = ((SwUpdateAttr*)pNew)->nEnd - nPos;
+ nPos = ((SwUpdateAttr*)pNew)->getStart();
+ nLen = ((SwUpdateAttr*)pNew)->getEnd() - nPos;
if( IsIdxInside( nPos, nLen ) )
{
// Es muss in jedem Fall neu formatiert werden,
@@ -1051,7 +1051,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
nLen = 1;
_InvalidateRange( SwCharRange( nPos, nLen) );
- MSHORT nTmp = ((SwUpdateAttr*)pNew)->nWhichAttr;
+ MSHORT nTmp = ((SwUpdateAttr*)pNew)->getWhichAttr();
if( ! nTmp || RES_TXTATR_CHARFMT == nTmp || RES_TXTATR_AUTOFMT == nTmp ||
RES_FMT_CHG == nTmp || RES_ATTRSET_CHG == nTmp )
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 8945688013b5..f5db22ee04c2 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -426,78 +426,54 @@ bool operator == (const SwFormToken & rToken, FormTokenType eType)
}
//-----------------------------------------------------------------------------
-void SwForm::AdjustTabStops(SwDoc& rDoc, sal_Bool bInsertNewTapStops) // #i21237#
+void SwForm::AdjustTabStops( SwDoc& rDoc ) // #i21237#
{
- for(sal_uInt16 nLevel = 1; nLevel < GetFormMax(); nLevel++)
+ const sal_uInt16 nFormMaxLevel = GetFormMax();
+ for ( sal_uInt16 nLevel = 1; nLevel < nFormMaxLevel; ++nLevel )
{
- const String& sTemplateName = GetTemplate(nLevel);
-
- SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( sTemplateName );
- if( !pColl )
+ SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( GetTemplate(nLevel) );
+ if( pColl == NULL )
{
- sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName
- ( sTemplateName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ); // #i21237#
- if( USHRT_MAX != nId )
- pColl = rDoc.GetTxtCollFromPool( nId );
+ // Paragraph Style for this level has not been created.
+ // --> No need to propagate default values
+ continue;
}
- const SvxTabStopItem* pTabStops = 0;
- sal_uInt16 nTabCount = 0;
- if( pColl &&
- 0 != ( pTabStops = &pColl->GetTabStops(sal_False) ) &&
- 0 != ( nTabCount = pTabStops->Count() ) )
+ const SvxTabStopItem* pTabStops = pColl != NULL ? &pColl->GetTabStops(sal_False) : 0;
+ const sal_uInt16 nTabCount = pTabStops != NULL ? pTabStops->Count() : 0;
+ if( pTabStops != NULL
+ && nTabCount != 0 )
{
- // #i21237#
SwFormTokens aCurrentPattern = GetPattern(nLevel);
SwFormTokens::iterator aIt = aCurrentPattern.begin();
- sal_Bool bChanged = sal_False;
-
+ bool bChanged = false;
for(sal_uInt16 nTab = 0; nTab < nTabCount; ++nTab)
{
const SvxTabStop& rTab = (*pTabStops)[nTab];
- // --> FME 2004-12-16 #i29178#
- // For Word import, we do not want to replace exising tokens,
- // we insert new tabstop tokens without a tabstop character:
- if ( bInsertNewTapStops )
+ if ( rTab.GetAdjustment() == SVX_TAB_ADJUST_DEFAULT )
+ continue; // ignore the default tab stop
+
+ aIt = find_if( aIt, aCurrentPattern.end(), SwFormTokenEqualToFormTokenType(TOKEN_TAB_STOP) );
+ if ( aIt != aCurrentPattern.end() )
{
- if ( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() )
- {
- bChanged = sal_True;
- SwFormToken aToken(TOKEN_TAB_STOP);
- aToken.bWithTab = sal_False;
- aToken.nTabStopPosition = rTab.GetTabPos();
- aToken.eTabAlign = rTab.GetAdjustment();
- aToken.cTabFillChar = rTab.GetFill();
- aCurrentPattern.push_back(aToken);
- }
+ bChanged = true;
+ aIt->nTabStopPosition = rTab.GetTabPos();
+ aIt->eTabAlign =
+ ( nTab == nTabCount - 1
+ && rTab.GetAdjustment() == SVX_TAB_ADJUST_RIGHT )
+ ? SVX_TAB_ADJUST_END
+ : rTab.GetAdjustment();
+ aIt->cTabFillChar = rTab.GetFill();
+ ++aIt;
}
- // <--
else
- {
- aIt = find_if(aIt, aCurrentPattern.end(),
- SwFormTokenEqualToFormTokenType
- (TOKEN_TAB_STOP));
- if ( aIt != aCurrentPattern.end() )
- {
- bChanged = sal_True;
- aIt->nTabStopPosition = rTab.GetTabPos();
- aIt->eTabAlign = nTab == nTabCount - 1 &&
- SVX_TAB_ADJUST_RIGHT == rTab.GetAdjustment() ?
- SVX_TAB_ADJUST_END :
- rTab.GetAdjustment();
- aIt->cTabFillChar = rTab.GetFill();
- ++aIt;
- }
- else
- break; // no more tokens to replace
- }
+ break; // no more tokens to replace
}
- // <--
- if(bChanged)
- SetPattern(nLevel, aCurrentPattern); // #i21237#
+ if ( bChanged )
+ SetPattern( nLevel, aCurrentPattern );
}
}
}
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 2c35683be3b8..75d2a3e837f0 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -215,71 +215,76 @@ void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- if( !mpTxtFld )
+ if ( mpTxtFld == NULL )
return;
- // don't do anything, especially not expand!
- if( pNew && pNew->Which() == RES_OBJECTDYING )
+ if( pNew != NULL
+ && pNew->Which() == RES_OBJECTDYING )
+ {
+ // don't do anything, especially not expand!
return;
+ }
- SwTxtNode* pTxtNd = (SwTxtNode*)&mpTxtFld->GetTxtNode();
+ SwTxtNode* pTxtNd = (SwTxtNode*) &mpTxtFld->GetTxtNode();
ASSERT( pTxtNd, "wo ist denn mein Node?" );
- if( pNew )
+ if ( pNew )
{
- switch( pNew->Which() )
+ switch (pNew->Which())
{
case RES_TXTATR_FLDCHG:
- // "Farbe hat sich geaendert !"
- // this, this fuer "nur Painten"
- pTxtNd->ModifyNotification( this, this );
- return;
+ // "Farbe hat sich geaendert !"
+ // this, this fuer "nur Painten"
+ pTxtNd->ModifyNotification( this, this );
+ return;
+
case RES_REFMARKFLD_UPDATE:
- // GetReferenz-Felder aktualisieren
- if( RES_GETREFFLD == GetField()->GetTyp()->Which() )
- {
- // --> OD 2007-09-06 #i81002#
-// ((SwGetRefField*)GetFld())->UpdateField();
- dynamic_cast<SwGetRefField*>(GetField())->UpdateField( mpTxtFld );
- // <--
- }
- break;
+ // GetReferenz-Felder aktualisieren
+ if ( RES_GETREFFLD == GetField()->GetTyp()->Which() )
+ {
+ dynamic_cast<SwGetRefField*>(GetField())->UpdateField( mpTxtFld );
+ }
+ break;
+
case RES_DOCPOS_UPDATE:
- // Je nach DocPos aktualisieren (SwTxtFrm::Modify())
- pTxtNd->ModifyNotification( pNew, this );
- return;
+ // Je nach DocPos aktualisieren (SwTxtFrm::Modify())
+ pTxtNd->ModifyNotification( pNew, this );
+ return;
case RES_ATTRSET_CHG:
- case RES_FMT_CHG:
- pTxtNd->ModifyNotification( pOld, pNew );
- return;
- default:
- break;
+ case RES_FMT_CHG:
+ pTxtNd->ModifyNotification( pOld, pNew );
+ return;
+
+ default:
+ break;
}
}
switch (GetField()->GetTyp()->Which())
{
- case RES_HIDDENPARAFLD:
- if( !pOld || RES_HIDDENPARA_PRINT != pOld->Which() )
- break;
- case RES_DBSETNUMBERFLD:
- case RES_DBNUMSETFLD:
- case RES_DBNEXTSETFLD:
- case RES_DBNAMEFLD:
- pTxtNd->ModifyNotification( 0, pNew);
- return;
+ case RES_HIDDENPARAFLD:
+ if ( !pOld || RES_HIDDENPARA_PRINT != pOld->Which() )
+ break;
+ case RES_DBSETNUMBERFLD:
+ case RES_DBNUMSETFLD:
+ case RES_DBNEXTSETFLD:
+ case RES_DBNAMEFLD:
+ pTxtNd->ModifyNotification( 0, pNew );
+ return;
}
- if( RES_USERFLD == GetField()->GetTyp()->Which() )
+ if ( RES_USERFLD == GetField()->GetTyp()->Which() )
{
- SwUserFieldType* pType = (SwUserFieldType*)GetField()->GetTyp();
- if(!pType->IsValid())
+ SwUserFieldType* pType = (SwUserFieldType*) GetField()->GetTyp();
+ if ( !pType->IsValid() )
{
SwCalc aCalc( *pTxtNd->GetDoc() );
pType->GetValue( aCalc );
}
}
- mpTxtFld->ExpandTxtFld();
+
+ const bool bForceNotify = (pOld == NULL) && (pNew == NULL);
+ mpTxtFld->ExpandTxtFld( bForceNotify );
}
sal_Bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const
@@ -313,9 +318,10 @@ sal_Bool SwFmtFld::IsProtect() const
SwTxtFld::SwTxtFld(
SwFmtFld & rAttr,
- xub_StrLen const nStartPos )
+ xub_StrLen const nStartPos,
+ const bool bIsClipboardDoc )
: SwTxtAttr( rAttr, nStartPos )
- , m_aExpand( rAttr.GetField()->ExpandField(true) )
+ , m_aExpand( rAttr.GetField()->ExpandField( bIsClipboardDoc ) )
, m_pTxtNode( NULL )
{
rAttr.SetTxtFld( *this );
@@ -338,14 +344,15 @@ bool SwTxtFld::IsFldInDoc() const
&& GetpTxtNode()->GetNodes().IsDocNodes();
}
-void SwTxtFld::ExpandTxtFld() const
+void SwTxtFld::ExpandTxtFld( const bool bForceNotify ) const
{
ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
const SwField* pFld = GetFmtFld().GetField();
const XubString aNewExpand( pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
- if( aNewExpand == m_aExpand )
+ if ( !bForceNotify &&
+ aNewExpand == m_aExpand )
{
// Bei Seitennummernfeldern
const sal_uInt16 nWhich = pFld->GetTyp()->Which();
@@ -446,13 +453,51 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
}
+/*static*/
+void SwTxtFld::GetPamForTxtFld(
+ const SwTxtFld& rTxtFld,
+ boost::shared_ptr< SwPaM >& rPamForTxtFld )
+{
+ if ( rTxtFld.GetpTxtNode() == NULL )
+ {
+ ASSERT( false, "<SwTxtFld::GetPamForField> - missing <SwTxtNode>" );
+ return;
+ }
+
+ const SwTxtNode& rTxtNode = rTxtFld.GetTxtNode();
+
+ rPamForTxtFld.reset( new SwPaM( rTxtNode,
+ ( (rTxtFld.End() != NULL) ? *(rTxtFld.End()) : ( *(rTxtFld.GetStart()) + 1 ) ),
+ rTxtNode,
+ *(rTxtFld.GetStart()) ) );
+
+}
+
+
+/*static*/
+void SwTxtFld::DeleteTxtFld( const SwTxtFld& rTxtFld )
+{
+ if ( rTxtFld.GetpTxtNode() != NULL )
+ {
+ boost::shared_ptr< SwPaM > pPamForTxtFld;
+ GetPamForTxtFld( rTxtFld, pPamForTxtFld );
+ if ( pPamForTxtFld.get() != NULL )
+ {
+ rTxtFld.GetTxtNode().GetDoc()->DeleteAndJoin( *pPamForTxtFld );
+ }
+ }
+}
+
+
+
// input field in-place editing
SwTxtInputFld::SwTxtInputFld(
SwFmtFld & rAttr,
xub_StrLen const nStart,
- xub_StrLen const nEnd )
+ xub_StrLen const nEnd,
+ const bool bIsClipboardDoc )
- : SwTxtFld( rAttr, nStart )
+ : SwTxtFld( rAttr, nStart, bIsClipboardDoc )
, m_nEnd( nEnd )
, m_bLockNotifyContentChange( false )
{
@@ -553,8 +598,9 @@ void SwTxtInputFld::UpdateTextNodeContent( const String& rNewContent )
// text annotation field
SwTxtAnnotationFld::SwTxtAnnotationFld(
SwFmtFld & rAttr,
- xub_StrLen const nStart )
- : SwTxtFld( rAttr, nStart )
+ xub_StrLen const nStart,
+ const bool bIsClipboardDoc )
+ : SwTxtFld( rAttr, nStart, bIsClipboardDoc )
{
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 4ef7f67be490..69a118f2eca7 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2671,7 +2671,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
SwRect aOrigBackRect;
//UUUU
- FillAttributesPtr aFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
/// OD 21.08.2002
/// consider, that [GetBackgroundBrush(...)] can set <pCol>
@@ -2701,13 +2701,13 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
if( GetShell() && GetShell()->GetWin() )
{
- // here we determine the prefered window text color for painting
+ // here we determine the preferred window text color for painting
const SwViewOption* pViewOption = GetShell()->GetViewOptions();
if(pViewOption->IsPagePreview() &&
!SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews())
nNewColor = COL_BLACK;
else
- // we take the font color from the appearence page
+ // we take the font color from the appearance page
nNewColor = SwViewOption::GetFontColor().GetColor();
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 7b58c0ec6745..3622e4c02086 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -91,6 +91,9 @@
#include <switerator.hxx>
#include <attrhint.hxx>
+//UUUU
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
+#include <svl/itemiter.hxx>
using namespace ::com::sun::star;
@@ -202,21 +205,23 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
// SwTxtNode
// --------------------
-SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere,
- SwTxtFmtColl *pTxtColl,
- const SfxItemSet* pAutoAttr )
- : SwCntntNode( rWhere, ND_TEXTNODE, pTxtColl ),
- m_pSwpHints( 0 ),
- mpNodeNum( 0 ),
- m_bLastOutlineState( false ),
- m_bNotifiable( false ),
- // --> OD 2008-11-19 #i70748#
- mbEmptyListStyleSetDueToSetOutlineLevelAttr( false ),
- // <--
- // --> OD 2008-05-06 #refactorlists#
- mbInSetOrResetAttr( false ),
- mpList( 0 )
- // <--
+SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl, const SfxItemSet* pAutoAttr )
+: SwCntntNode( rWhere, ND_TEXTNODE, pTxtColl ),
+ m_pSwpHints( 0 ),
+ mpNodeNum( 0 ),
+ m_Text(),
+ m_pParaIdleData_Impl(0),
+ m_bContainsHiddenChars(false),
+ m_bHiddenCharsHidePara(false),
+ m_bRecalcHiddenCharFlags(false),
+ m_bLastOutlineState( false ),
+ m_bNotifiable( false ),
+ mbEmptyListStyleSetDueToSetOutlineLevelAttr( false ),
+ mbInSetOrResetAttr( false ),
+ mpList( 0 ),
+ m_pNumStringCache(),
+ m_wXParagraph(),
+ maFillAttributes()
{
InitSwParaStatistics( true );
@@ -1072,6 +1077,8 @@ void SwTxtNode::Update(
// Bookmarks must never grow to either side, when editing (directly) to the left or right (#i29942#)!
// And a bookmark with same start and end must remain to the left of the inserted text (used in XML import).
{
+ bool bAtLeastOneBookmarkMoved = false;
+ bool bAtLeastOneExpandedBookmarkAtInsertionPosition = false;
const IDocumentMarkAccess* const pMarkAccess = getIDocumentMarkAccess();
for ( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
ppMark != pMarkAccess->getAllMarksEnd();
@@ -1079,14 +1086,28 @@ void SwTxtNode::Update(
{
const ::sw::mark::IMark* const pMark = ppMark->get();
const SwPosition* pEnd = &pMark->GetMarkEnd();
- SwIndex & rIdx = const_cast<SwIndex&>(pEnd->nContent);
+ SwIndex & rEndIdx = const_cast<SwIndex&>(pEnd->nContent);
if( this == &pEnd->nNode.GetNode() &&
- rPos.GetIndex() == rIdx.GetIndex() )
+ rPos.GetIndex() == rEndIdx.GetIndex() )
{
- rIdx.Assign( &aTmpIdxReg, rIdx.GetIndex() );
- bSortMarks = true;
+ rEndIdx.Assign( &aTmpIdxReg, rEndIdx.GetIndex() );
+ bAtLeastOneBookmarkMoved = true;
+ }
+ else if ( !bAtLeastOneExpandedBookmarkAtInsertionPosition )
+ {
+ if ( pMark->IsExpanded() )
+ {
+ const SwPosition* pStart = &pMark->GetMarkStart();
+ if ( this == &pStart->nNode.GetNode()
+ && rPos.GetIndex() == pStart->nContent.GetIndex() )
+ {
+ bAtLeastOneExpandedBookmarkAtInsertionPosition = true;
+ }
+ }
}
}
+
+ bSortMarks = bAtLeastOneBookmarkMoved && bAtLeastOneExpandedBookmarkAtInsertionPosition;
}
}
@@ -1542,7 +1563,11 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
if( this != pDest )
{
// Frames benachrichtigen, sonst verschwinden die Ftn-Nummern
- SwUpdateAttr aHint( nOldPos, nOldPos, 0 );
+ SwUpdateAttr aHint(
+ nOldPos,
+ nOldPos,
+ 0);
+
pDest->ModifyNotification( 0, &aHint );
}
}
@@ -2463,7 +2488,11 @@ void SwTxtNode::GCAttr()
if(bChanged)
{
//TxtFrm's reagieren auf aHint, andere auf aNew
- SwUpdateAttr aHint( nMin, nMax, 0 );
+ SwUpdateAttr aHint(
+ nMin,
+ nMax,
+ 0);
+
NotifyClients( 0, &aHint );
SwFmtChg aNew( GetTxtColl() );
NotifyClients( 0, &aNew );
@@ -3646,6 +3675,28 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal
(SwTxtFmtColl*)((SwFmtChg*)pNewValue)->pChangedFmt );
}
+ //UUUU reset fill information
+ if(maFillAttributes.get())
+ {
+ sal_uInt16 nWhich = pNewValue ? pNewValue->Which() : 0;
+ bool bReset(RES_FMT_CHG == nWhich); // ..on format change (e.g. style changed)
+
+ if(!bReset && RES_ATTRSET_CHG == nWhich) // ..on ItemChange from DrawingLayer FillAttributes
+ {
+ SfxItemIter aIter(*((SwAttrSetChg*)pNewValue)->GetChgSet());
+
+ for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem && !bReset; pItem = aIter.NextItem())
+ {
+ bReset = !IsInvalidItem(pItem) && pItem->Which() >= XATTR_FILL_FIRST && pItem->Which() <= XATTR_FILL_LAST;
+ }
+ }
+
+ if(bReset)
+ {
+ maFillAttributes.reset();
+ }
+ }
+
// --> OD 2008-03-27 #refactorlists#
if ( !mbInSetOrResetAttr )
{
@@ -3695,6 +3746,12 @@ SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
HandleModifyAtTxtNode( *this, &aTmp1, &aTmp2 );
}
// <--
+
+ //UUUU reset fill information on parent style change
+ if(maFillAttributes.get())
+ {
+ maFillAttributes.reset();
+ }
}
// nur wenn im normalen Nodes-Array
@@ -4619,6 +4676,7 @@ namespace {
// --> OD 2008-11-19 #i70748#
if ( mbOutlineLevelSet )
{
+ mrTxtNode.GetNodes().UpdateOutlineNode( mrTxtNode );
if ( mrTxtNode.GetAttrOutlineLevel() == 0 )
{
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
@@ -5056,3 +5114,16 @@ bool SwTxtNode::HasPageNumberField()
}
//Bug 120881(End)
+//UUUU
+drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwTxtNode::getSdrAllFillAttributesHelper() const
+{
+ // create SdrAllFillAttributesHelper on demand
+ if(!maFillAttributes.get())
+ {
+ const_cast< SwTxtNode* >(this)->maFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(GetSwAttrSet()));
+ }
+
+ return maFillAttributes;
+}
+
+// eof
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 3a9a4ebcba77..19fe3e5314d3 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1049,12 +1049,14 @@ SwTxtAttr* MakeTxtAttr(
break;
case RES_TXTATR_FIELD:
- pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt );
+ pNew =
+ new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt, rDoc.IsClipBoard() );
break;
case RES_TXTATR_ANNOTATION:
{
- pNew = new SwTxtAnnotationFld( static_cast<SwFmtFld &>(rNew), nStt );
+ pNew =
+ new SwTxtAnnotationFld( static_cast<SwFmtFld &>(rNew), nStt, rDoc.IsClipBoard() );
if ( bIsCopy == COPY )
{
// On copy of the annotation field do not keep the annotated text range by removing
@@ -1067,7 +1069,8 @@ SwTxtAttr* MakeTxtAttr(
break;
case RES_TXTATR_INPUTFIELD:
- pNew = new SwTxtInputFld( static_cast<SwFmtFld &>(rNew), nStt, nEnd );
+ pNew =
+ new SwTxtInputFld( static_cast<SwFmtFld &>(rNew), nStt, nEnd, rDoc.IsClipBoard() );
break;
case RES_TXTATR_FLYCNT:
@@ -1253,7 +1256,7 @@ SwTxtAttr* SwTxtNode::InsertItem(
{
const bool bSuccess( InsertHint( pNew, nMode ) );
// N.B.: also check that the hint is actually in the hints array,
- // because hints of certain types may be merged after succesful
+ // because hints of certain types may be merged after successful
// insertion, and thus destroyed!
if (!bSuccess || ( USHRT_MAX == m_pSwpHints->GetPos( pNew ) ))
{
@@ -1677,7 +1680,10 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
{
// create MsgHint before start/end become invalid
SwUpdateAttr aHint(
- *pAttr->GetStart(), *pAttr->GetEnd(), pAttr->Which() );
+ *pAttr->GetStart(),
+ *pAttr->GetEnd(),
+ pAttr->Which());
+
m_pSwpHints->Delete( pAttr );
SwTxtAttr::Destroy( pAttr, GetDoc()->GetAttrPool() );
NotifyClients( 0, &aHint );
@@ -1752,7 +1758,11 @@ void SwTxtNode::DeleteAttributes(
// Start und End weg.
// Das CalcVisibleFlag bei HiddenParaFields entfaellt,
// da dies das Feld im Dtor selbst erledigt.
- SwUpdateAttr aHint( nStart, *pEndIdx, nWhich );
+ SwUpdateAttr aHint(
+ nStart,
+ *pEndIdx,
+ nWhich);
+
m_pSwpHints->DeleteAtPos( nPos ); // gefunden, loeschen,
SwTxtAttr::Destroy( pTxtHt, GetDoc()->GetAttrPool() );
NotifyClients( 0, &aHint );
@@ -1780,10 +1790,10 @@ void SwTxtNode::DelSoftHyph( const xub_StrLen nStt, const xub_StrLen nEnd )
}
//Modify here for #119405, by easyfan, 2012-05-24
-//In MS Word, the font underline setting of the paragraph end position wont affect the formatting of numbering, so we ignore it
+//In MS Word, the font underline setting of the paragraph end position wont affect the formatting of numbering, escapement, etc, so we ignore them
bool lcl_IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich)
{
- return (nWhich == RES_CHRATR_UNDERLINE);
+ return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_ESCAPEMENT);
}
//In MS Word, following properties of the paragraph end position wont affect the formatting of bullets, so we ignore them:
@@ -1792,7 +1802,7 @@ bool lcl_IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich)
//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
+ 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);
}
@@ -2195,7 +2205,7 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
{
const sal_uInt16 nHintWhich = pItem->Which();
ASSERT(!isUNKNOWNATR(nHintWhich),
- "SwTxtNode::GetAttr(): unkonwn attribute?");
+ "SwTxtNode::GetAttr(): unknown attribute?");
if ( !pAttrArr.get() )
{
@@ -3043,11 +3053,16 @@ bool SwpHints::TryInsertHint(
CHECK;
#endif
// ... und die Abhaengigen benachrichtigen
- if ( rNode.GetDepends() )
+ if(rNode.GetDepends())
{
- SwUpdateAttr aHint( nHtStart, nHtStart, nWhich );
- rNode.ModifyNotification( 0, &aHint );
+ SwUpdateAttr aHint(
+ nHtStart,
+ nHtStart,
+ nWhich);
+
+ rNode.ModifyNotification(0,&aHint);
}
+
return true;
}
@@ -3127,7 +3142,12 @@ bool SwpHints::TryInsertHint(
// ... und die Abhaengigen benachrichtigen
if ( rNode.GetDepends() )
{
- SwUpdateAttr aHint( nHtStart, nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd, nWhich );
+ SwUpdateAttr aHint(
+ // rNode.GetDoc()->GetAttrPool(),
+ nHtStart,
+ nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd,
+ nWhich);
+
rNode.ModifyNotification( 0, &aHint );
}
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 9424eac43478..e3101ac2231c 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -68,7 +68,11 @@ void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolIte
if ( m_pTxtNode )
{
- SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
+ SwUpdateAttr aUpdateAttr(
+ *GetStart(),
+ *GetEnd(),
+ nWhich);
+
m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -186,7 +190,11 @@ void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if ( m_pTxtNode )
{
- SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
+ SwUpdateAttr aUpdateAttr(
+ *GetStart(),
+ *GetEnd(),
+ nWhich);
+
m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -235,7 +243,11 @@ void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if ( m_pTxtNode )
{
- SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
+ SwUpdateAttr aUpdateAttr(
+ *GetStart(),
+ *GetEnd(),
+ nWhich);
+
m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index c256b6222a7c..8e77ac6c5156 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -640,19 +640,26 @@ void SwTxtNode::RstTxtAttr(
}
}
}
- ++i;
}
+
+ ++i;
}
TryDeleteSwpHints();
+
if (bChanged)
{
if ( HasHints() )
{
m_pSwpHints->Resort();
}
+
//TxtFrm's reagieren auf aHint, andere auf aNew
- SwUpdateAttr aHint( nMin, nMax, 0 );
+ SwUpdateAttr aHint(
+ nMin,
+ nMax,
+ 0);
+
NotifyClients( 0, &aHint );
SwFmtChg aNew( GetFmtColl() );
NotifyClients( 0, &aNew );
@@ -1983,17 +1990,17 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
// Asian languages count words as characters
if ( nCurrScript == ::com::sun::star::i18n::ScriptType::ASIAN )
{
- // substract white spaces
+ // subtract white spaces
sal_Int32 nSpaceCount = 0;
sal_Int32 nSpacePos = 0;
- // substract normal white spaces
+ // subtract normal white spaces
nSpacePos = -1;
while ( ( nSpacePos = aScriptText.indexOf( ' ', nSpacePos + 1 ) ) != -1 )
{
nSpaceCount++;
}
- // substract Asian full-width white spaces
+ // subtract Asian full-width white spaces
nSpacePos = -1;
while ( ( nSpacePos = aScriptText.indexOf( 12288, nSpacePos + 1 ) ) != -1 )
{
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index bd49052290b4..a197624c3595 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -41,16 +39,13 @@
#include <editsh.hxx>
#include <unobaseclass.hxx>
#include <limits>
-
-#include <limits>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
-
// the undo array should never grow beyond this limit:
#define UNDO_ACTION_LIMIT (USHRT_MAX - 1000)
-
// UndoManager ///////////////////////////////////////////////////////////
namespace sw {
@@ -95,7 +90,7 @@ void UndoManager::DoUndo(bool const bDoUndo)
{
EnableUndo(bDoUndo);
- SdrModel *const pSdrModel = m_rDrawModelAccess.GetDrawModel();
+ SwDrawModel*const pSdrModel = m_rDrawModelAccess.GetDrawModel();
if( pSdrModel )
{
pSdrModel->EnableUndo(bDoUndo);
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 72af00f16993..4045e7d5debe 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1039,20 +1039,31 @@ SwHistory::~SwHistory()
|*
*************************************************************************/
-void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
- sal_uLong nNodeIdx )
+void SwHistory::Add(
+ const SfxPoolItem* pOldValue,
+ const SfxPoolItem* pNewValue,
+ sal_uLong nNodeIdx)
{
ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
+ const sal_uInt16 nWhich(pNewValue->Which());
- sal_uInt16 nWhich = pNewValue->Which();
- if( (nWhich >= POOLATTR_END)
- || (nWhich == RES_TXTATR_FIELD)
- || (nWhich == RES_TXTATR_ANNOTATION) )
+ // excluded values
+ if(nWhich == RES_TXTATR_FIELD || nWhich == RES_TXTATR_ANNOTATION)
+ {
return;
+ }
// no default Attribute?
- SwHistoryHint * pHt;
- if ( pOldValue && pOldValue != GetDfltAttr( pOldValue->Which() ) )
+ SwHistoryHint* pHt = 0;
+
+ //UUUU To be able to include the DrawingLayer FillItems something more
+ // general has to be done to check if an Item is default than to check
+ // if it's pointzer equals that in Writer's global PoolDefaults (held in
+ // aAttrTab and used to fill the pool defaults in Writer - looks as if
+ // Writer is *older* than the SfxItemPool ?). I checked the possibility to
+ // get the SfxItemPool here (works), but decided to use the SfxPoolItem's
+ // global tooling aka IsDefaultItem(const SfxPoolItem*) for now
+ if(pOldValue && !IsDefaultItem(pOldValue))
{
pHt = new SwHistorySetFmt( pOldValue, nNodeIdx );
}
@@ -1060,7 +1071,8 @@ void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
{
pHt = new SwHistoryResetFmt( pNewValue, nNodeIdx );
}
- m_SwpHstry.Insert( pHt, Count() );
+
+ m_SwpHstry.Insert(pHt, Count());
}
@@ -1275,21 +1287,34 @@ sal_uInt16 SwHistory::SetTmpEnd( sal_uInt16 nNewTmpEnd )
return nOld;
}
-void SwHistory::CopyFmtAttr( const SfxItemSet& rSet, sal_uLong nNodeIdx )
+void SwHistory::CopyFmtAttr(
+ const SfxItemSet& rSet,
+ sal_uLong nNodeIdx)
{
- if( rSet.Count() )
+ if(rSet.Count())
{
- SfxItemIter aIter( rSet );
- do {
- if( (SfxPoolItem*)-1 != aIter.GetCurItem() )
+ SfxItemIter aIter(rSet);
+
+ do
+ {
+ if(!IsInvalidItem(aIter.GetCurItem()))
{
const SfxPoolItem* pNew = aIter.GetCurItem();
- Add( pNew, pNew, nNodeIdx );
+
+ Add(
+ pNew,
+ pNew,
+ nNodeIdx);
}
- if( aIter.IsAtEnd() )
+
+ if(aIter.IsAtEnd())
+ {
break;
+ }
+
aIter.NextItem();
- } while( sal_True );
+
+ } while(true);
}
}
@@ -1380,31 +1405,38 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst )
void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- // --> OD 2010-10-05 #i114861#
- // Do not handle a "noop" modify
- // - e.g. <SwTxtNode::NumRuleChgd()> uses such a "noop" modify
-// if ( m_pHistory && ( pOld || pNew ) )
- if ( m_pHistory && ( pOld || pNew ) &&
- pOld != pNew )
- // <--
+ if ( m_pHistory && ( pOld || pNew ) && pOld != pNew )
{
if ( pNew->Which() < POOLATTR_END )
{
- m_pHistory->Add( pOld, pNew, m_nNodeIndex );
+ if(RES_UPDATE_ATTR == pNew->Which())
+ {
+ // const SfxItemPool& rPool = static_cast< const SwUpdateAttr* >(pNew)->GetSfxItemPool();
+
+ m_pHistory->Add(
+ // rPool,
+ pOld,
+ pNew,
+ m_nNodeIndex);
+ }
+ else
+ {
+ OSL_ENSURE(false, "Unexpected update attribute (!)");
+ }
}
else if ( RES_ATTRSET_CHG == pNew->Which() )
{
SwHistoryHint* pNewHstr;
- const SfxItemSet& rSet =
- *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet();
+ const SfxItemSet& rSet = *static_cast< const SwAttrSetChg* >(pOld)->GetChgSet();
+
if ( 1 < rSet.Count() )
{
- pNewHstr =
- new SwHistorySetAttrSet( rSet, m_nNodeIndex, m_WhichIdSet );
+ pNewHstr = new SwHistorySetAttrSet( rSet, m_nNodeIndex, m_WhichIdSet );
}
else
{
const SfxPoolItem* pItem = SfxItemIter( rSet ).FirstItem();
+
if ( m_WhichIdSet.Seek_Entry( pItem->Which() ) )
{
pNewHstr = new SwHistorySetFmt( pItem, m_nNodeIndex );
@@ -1414,6 +1446,7 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pNewHstr = new SwHistoryResetFmt( pItem, m_nNodeIndex );
}
}
+
m_pHistory->m_SwpHstry.Insert( pNewHstr, m_pHistory->Count() );
}
}
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 5a4fd7d090a6..ded3fd70354d 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -19,22 +19,16 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#define _SVSTDARR_USHORTS
#define _SVSTDARR_USHORTSSORT
#include <UndoAttribute.hxx>
-
#include <svl/itemiter.hxx>
-
#include <editeng/tstpitem.hxx>
-
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
-
#include <hintids.hxx>
#include <fmtflcnt.hxx>
#include <txtftn.hxx>
@@ -65,6 +59,7 @@
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
#include <switerator.hxx>
+#include <drawdoc.hxx>
// -----------------------------------------------------
@@ -202,7 +197,7 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rContext.GetDoc() ))
return;
- // --> OD 2004-10-26 #i35443# - If anchor attribute has been successfull
+ // --> OD 2004-10-26 #i35443# - If anchor attribute has been successful
// restored, all other attributes are also restored.
// Thus, keep track of its restoration
bool bAnchorAttrRestored( false );
@@ -211,7 +206,7 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
bAnchorAttrRestored = RestoreFlyAnchor(rContext);
if ( bAnchorAttrRestored )
{
- // Anchor attribute successfull restored.
+ // Anchor attribute successful restored.
// Thus, keep anchor position for redo
SaveFlyAnchor();
}
diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx
index 8baddb07fd47..478a1980b1e9 100644
--- a/sw/source/core/undo/unfmco.cxx
+++ b/sw/source/core/undo/unfmco.cxx
@@ -94,14 +94,13 @@ void SwUndoFmtColl::DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM)
sal_uInt16 const nPos = rDoc.GetTxtFmtColls()->GetPos(
(SwTxtFmtColl*)pFmtColl );
// does the format still exist?
- if( USHRT_MAX != nPos )
+ if ( USHRT_MAX != nPos )
{
- // --> OD 2008-04-15 #refactorlists#
- rDoc.SetTxtFmtColl(rPaM,
- (SwTxtFmtColl*)pFmtColl,
- mbReset,
- mbResetListAttrs );
- // <--
+ rDoc.SetTxtFmtColl(
+ rPaM,
+ (SwTxtFmtColl*) pFmtColl,
+ mbReset,
+ mbResetListAttrs );
}
}
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 44772872db5f..0e710657ed14 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1737,7 +1737,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
// then pBox received nodes from elsewhere.
// If bNodesMoved is set for pBox the undo must move the
// boxes back, otherwise it must delete them.
- // The bNodesMoved flag is stored in a seperate array
+ // The bNodesMoved flag is stored in a separate array
// which mirrors Ptrs.pNewSttNds, i.e. Ptrs.pNewSttNds[i]
// and aMvBoxes[i] belong together.
sal_Bool bNodesMoved =
diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx b/sw/source/core/unocore/XMLRangeHelper.cxx
index 8e50525e8186..d4cb11dcb66b 100644
--- a/sw/source/core/unocore/XMLRangeHelper.cxx
+++ b/sw/source/core/unocore/XMLRangeHelper.cxx
@@ -347,7 +347,7 @@ CellRange getCellRangeFromXMLString( const OUString & rXMLString )
nStartPos, nEndPos - 1,
aResult ))
{
- // if an error occured, bail out
+ // if an error occurred, bail out
return CellRange();
}
}
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 6d1711adff13..cf59ea79e4cc 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -31,9 +29,7 @@
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
-#ifndef _COM_SUN_STAR_UCB_NAMECLASH_HDL_
#include <com/sun/star/ucb/NameClash.hdl>
-#endif
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -50,7 +46,12 @@
#include <swunodef.hxx>
#include <errhdl.hxx>
-namespace SWUnoHelper {
+//UUUU
+#include <svx/xfillit0.hxx>
+#include <svl/itemset.hxx>
+
+namespace SWUnoHelper
+{
sal_Int32 GetEnumAsInt32( const UNO_NMSPC::Any& rVal )
{
@@ -284,4 +285,34 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
return bOk;
}
+//UUUU
+bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet)
+{
+ const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rSet.GetItem(XATTR_FILLSTYLE, false)));
+
+ if(!pXFillStyleItem)
+ {
+ return false;
+ }
+
+ // here different FillStyles can be excluded for export; it will depend on the
+ // quality these fallbacks can reach. That again is done in getSvxBrushItemFromSourceSet,
+ // take a look there how the superset of DrawObject FillStyles is mapped to SvxBrushItem.
+ // For now, take them all - except XFILL_NONE
+
+ if(XFILL_NONE != pXFillStyleItem->GetValue())
+ {
+ return true;
+ }
+
+ // if(XFILL_SOLID == pXFillStyleItem->GetValue() || XFILL_BITMAP == pXFillStyleItem->GetValue())
+ // {
+ // return true;
+ // }
+
+ return false;
+}
+
}
+
+// eof
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 696ed773b67a..36d7f14eb397 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -697,12 +697,12 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
//Therefore we need to shift the range one row up
SwRangeDescriptor aDesc;
if (aRangeRepresentation.getLength() == 0)
- return xRes; // we cant handle this thus returning an empty references
+ return xRes; // we can't handle this thus returning an empty references
aRangeRepresentation = aRangeRepresentation.copy( 1 ); // get rid of '.' to have only the cell range left
FillRangeDescriptor( aDesc, aRangeRepresentation );
aDesc.Normalize();
if (aDesc.nTop <= 0) // no chance to shift the range one row up?
- return xRes; // we cant handle this thus returning an empty references
+ return xRes; // we can't handle this thus returning an empty references
aDesc.nTop -= 1;
aDesc.nBottom -= 1;
@@ -743,7 +743,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
{
SwTable* pTable = SwTable::FindTable( pTblFmt );
if(pTable->IsTblComplex())
- return xRes; // we cant handle this thus returning an empty references
+ return xRes; // we can't handle this thus returning an empty references
else
{
// get a character map in the size of the table to mark
@@ -833,7 +833,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
}
aDataLen[oi] = nL;
- // check that there is no other seperate sequence of data
+ // check that there is no other separate sequence of data
// to be found because that is not supported
while (ii < iiEnd)
{
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index bd0f03a33480..a087d17cef84 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -19,14 +19,11 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <swtypes.hxx>
#include <cmdid.h>
-
#include <unomid.h>
#include <unodraw.hxx>
#include <unocoll.hxx>
@@ -87,6 +84,7 @@
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
#include <switerator.hxx>
+#include <drawdoc.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -874,7 +872,7 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage()
{
vos::OGuard aGuard(Application::GetSolarMutex());
// --> OD 2005-08-08 #i52858# - method name changed
- SdrModel* pModel = pDoc->GetOrCreateDrawModel();
+ SwDrawModel* pModel = pDoc->GetOrCreateDrawModel();
// <--
SdrPage* pPage = pModel->GetPage( 0 );
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index c476763d1bcd..550f11d6cb6a 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -539,18 +539,29 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
}
}
}
- if( bSetValue )
+ if ( bSetValue )
{
// nothing special to be done here for the properties
// UNO_NAME_DATA_BASE_NAME and UNO_NAME_DATA_BASE_URL.
// We just call PutValue (empty string is allowed).
// Thus the last property set will be used as Data Source.
- sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType );
- if( USHRT_MAX != nMId )
- pType->PutValue( rValue, nMId );
+ const sal_uInt16 nMemberValueId = GetFieldTypeMId( rPropertyName, *pType );
+ if ( USHRT_MAX != nMemberValueId )
+ {
+ pType->PutValue( rValue, nMemberValueId );
+ if ( pType->Which() == RES_USERFLD )
+ {
+ // trigger update of User field in order to get depending Input Fields updated.
+ pType->UpdateFlds();
+ }
+ }
else
- throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
+ {
+ throw beans::UnknownPropertyException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "Unknown property: " ) ) + rPropertyName,
+ static_cast< cppu::OWeakObject * >( this ) );
+ }
}
}
else if(!pType && m_pDoc &&
@@ -898,37 +909,34 @@ void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName
void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- SwFieldType* pFldType = GetFldType(sal_True);
- if(pFldType)
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ SwFieldType* pFldType = GetFldType( sal_True );
+ if ( pFldType != NULL )
{
sal_uInt16 nTypeIdx = USHRT_MAX;
const SwFldTypes* pTypes = GetDoc()->GetFldTypes();
- for( sal_uInt16 i = 0; i < pTypes->Count(); i++ )
+ for ( sal_uInt16 i = 0; i < pTypes->Count(); i++ )
{
- if((*pTypes)[i] == pFldType)
+ if ( ( *pTypes )[i] == pFldType )
nTypeIdx = i;
}
// zuerst alle Felder loeschen
- SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ SwIterator< SwFmtFld, SwFieldType > aIter( *pFldType );
SwFmtFld* pFld = aIter.First();
- while(pFld)
+ while ( pFld != NULL )
{
- // Feld im Undo?
- SwTxtFld *pTxtFld = pFld->GetTxtFld();
- if(pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
+ SwTxtFld* pTxtFld = pFld->GetTxtFld();
+ if ( pTxtFld != NULL
+ && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
{
- SwTxtNode& rTxtNode = (SwTxtNode&)*pTxtFld->GetpTxtNode();
- SwPaM aPam(rTxtNode, *pTxtFld->GetStart());
- aPam.SetMark();
- aPam.Move();
- GetDoc()->DeleteAndJoin(aPam);
+ SwTxtFld::DeleteTxtFld( *pTxtFld );
}
pFld = aIter.Next();
}
// dann den FieldType loeschen
- GetDoc()->RemoveFldType(nTypeIdx);
+ GetDoc()->RemoveFldType( nTypeIdx );
}
else
throw uno::RuntimeException();
@@ -1877,38 +1885,41 @@ void SwXTextField::attach( const uno::Reference< text::XTextRange > & xTextRange
uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- uno::Reference< text::XTextRange > aRef;
- SwField* pField = (SwField*)GetField();
- if(pField)
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ uno::Reference< text::XTextRange > aRef;
+
+ SwField* pField = (SwField*) GetField();
+ if ( pField != NULL )
{
const SwTxtFld* pTxtFld = m_pFmtFld->GetTxtFld();
- if(!pTxtFld)
+ if ( !pTxtFld )
throw uno::RuntimeException();
- const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
-
- SwPaM aPam(rTxtNode, *pTxtFld->GetStart() + 1, rTxtNode, *pTxtFld->GetStart());
- aRef = SwXTextRange::CreateXTextRange(
- *m_pDoc, *aPam.GetPoint(), aPam.GetMark());
+ boost::shared_ptr< SwPaM > pPamForTxtFld;
+ SwTxtFld::GetPamForTxtFld( *pTxtFld, pPamForTxtFld );
+ if ( pPamForTxtFld.get() != NULL )
+ {
+ aRef = SwXTextRange::CreateXTextRange( *m_pDoc,
+ *(pPamForTxtFld->GetPoint()),
+ pPamForTxtFld->GetMark() );
+ }
}
return aRef;
}
+
void SwXTextField::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- SwField* pField = (SwField*)GetField();
- if(pField)
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ SwField* pField = (SwField*) GetField();
+ if ( pField != NULL )
{
- UnoActionContext aContext(GetDoc());
- const SwTxtFld* pTxtFld = m_pFmtFld->GetTxtFld();
- SwTxtNode& rTxtNode = (SwTxtNode&)*pTxtFld->GetpTxtNode();
- SwPaM aPam(rTxtNode, *pTxtFld->GetStart());
- aPam.SetMark();
- aPam.Move();
- GetDoc()->DeleteAndJoin(aPam);
+ UnoActionContext aContext( GetDoc() );
+
+ ASSERT( m_pFmtFld->GetTxtFld(), "<SwXTextField::dispose()> - missing <SwTxtFld> --> crash" );
+ SwTxtFld::DeleteTxtFld( *( m_pFmtFld->GetTxtFld() ) );
}
if ( m_pTextObject )
@@ -1969,19 +1980,19 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
- if(pField)
+ if ( pField )
{
// Sonderbehandlung Serienbrieffeld
sal_uInt16 nWhich = pField->Which();
- if( RES_DBFLD == nWhich &&
- (rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)) ||
- rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_URL))||
- rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_TABLE_NAME))||
- rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_COLUMN_NAME))))
+ if ( RES_DBFLD == nWhich
+ && ( rPropertyName.equalsAsciiL( SW_PROP_NAME( UNO_NAME_DATA_BASE_NAME ) )
+ || rPropertyName.equalsAsciiL( SW_PROP_NAME( UNO_NAME_DATA_BASE_URL ) )
+ || rPropertyName.equalsAsciiL( SW_PROP_NAME( UNO_NAME_DATA_TABLE_NAME ) )
+ || rPropertyName.equalsAsciiL( SW_PROP_NAME( UNO_NAME_DATA_COLUMN_NAME ) ) ) )
{
// hier muss ein neuer Feldtyp angelegt werden und
// das Feld an den neuen Typ umgehaengt werden
- DBG_WARNING("not implemented");
+ DBG_WARNING( "not implemented" );
}
else
{
@@ -2001,30 +2012,30 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
}
pField->PutValue( rValue, pEntry->nWID );
- //#i100374# notify SwPostIt about new field content
- if (RES_POSTITFLD== nWhich && m_pFmtFld)
- {
- const_cast<SwFmtFld*>(m_pFmtFld)->Broadcast(SwFmtFldHint( 0, SWFMTFLD_CHANGED ));
- }
+ //#i100374# notify SwPostIt about new field content
+ if ( RES_POSTITFLD == nWhich && m_pFmtFld )
+ {
+ const_cast< SwFmtFld* >( m_pFmtFld )->Broadcast( SwFmtFldHint( 0, SWFMTFLD_CHANGED ) );
+ }
//#114571# changes of the expanded string have to be notified
//#to the SwTxtFld
- if(RES_DBFLD == nWhich && m_pFmtFld->GetTxtFld())
+ if ( RES_DBFLD == nWhich && m_pFmtFld->GetTxtFld() )
{
m_pFmtFld->GetTxtFld()->ExpandTxtFld();
}
- //#i100374# changing a document field should set the modify flag
- SwDoc* pDoc = GetDoc();
- if (pDoc)
- pDoc->SetModified();
+ //#i100374# changing a document field should set the modify flag
+ SwDoc* pDoc = GetDoc();
+ if ( pDoc )
+ pDoc->SetModified();
}
- else if(m_pProps)
+ else if ( m_pProps )
{
String* pStr = 0;
sal_Bool* pBool = 0;
- switch(pEntry->nWID)
+ switch (pEntry->nWID)
{
case FIELD_PROP_PAR1:
pStr = &m_pProps->sPar1;
@@ -2045,54 +2056,54 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
case FIELD_PROP_SUBTYPE:
m_pProps->nSubType = SWUnoHelper::GetEnumAsInt32( rValue );
break;
- case FIELD_PROP_BYTE1 :
+ case FIELD_PROP_BYTE1:
rValue >>= m_pProps->nByte1;
break;
- case FIELD_PROP_BOOL1 :
+ case FIELD_PROP_BOOL1:
pBool = &m_pProps->bBool1;
break;
- case FIELD_PROP_BOOL2 :
+ case FIELD_PROP_BOOL2:
pBool = &m_pProps->bBool2;
break;
- case FIELD_PROP_BOOL3 :
+ case FIELD_PROP_BOOL3:
pBool = &m_pProps->bBool3;
break;
case FIELD_PROP_BOOL4:
pBool = &m_pProps->bBool4;
- break;
- case FIELD_PROP_DATE :
- {
- if(rValue.getValueType() != ::getCppuType(static_cast<const util::Date*>(0)))
+ break;
+ case FIELD_PROP_DATE:
+ {
+ if ( rValue.getValueType() != ::getCppuType( static_cast< const util::Date* >( 0 ) ) )
throw lang::IllegalArgumentException();
- util::Date aTemp = *(const util::Date*)rValue.getValue();
- m_pProps->aDate = Date(aTemp.Day, aTemp.Month, aTemp.Year);
+ util::Date aTemp = *(const util::Date*) rValue.getValue();
+ m_pProps->aDate = Date( aTemp.Day, aTemp.Month, aTemp.Year );
}
- break;
+ break;
case FIELD_PROP_USHORT1:
- case FIELD_PROP_USHORT2:
+ case FIELD_PROP_USHORT2:
{
- sal_Int16 nVal = 0;
- rValue >>= nVal;
- if( FIELD_PROP_USHORT1 == pEntry->nWID)
- m_pProps->nUSHORT1 = nVal;
- else
- m_pProps->nUSHORT2 = nVal;
- }
+ sal_Int16 nVal = 0;
+ rValue >>= nVal;
+ if ( FIELD_PROP_USHORT1 == pEntry->nWID )
+ m_pProps->nUSHORT1 = nVal;
+ else
+ m_pProps->nUSHORT2 = nVal;
+ }
break;
case FIELD_PROP_SHORT1:
rValue >>= m_pProps->nSHORT1;
break;
case FIELD_PROP_DOUBLE:
- if(rValue.getValueType() != ::getCppuType(static_cast<const double*>(0)))
+ if ( rValue.getValueType() != ::getCppuType( static_cast< const double* >( 0 ) ) )
throw lang::IllegalArgumentException();
- m_pProps->fDouble = *(double*)rValue.getValue();
+ m_pProps->fDouble = *(double*) rValue.getValue();
break;
- case FIELD_PROP_DATE_TIME :
- if(!m_pProps->pDateTime)
+ case FIELD_PROP_DATE_TIME:
+ if ( !m_pProps->pDateTime )
m_pProps->pDateTime = new util::DateTime;
- rValue >>= (*m_pProps->pDateTime);
+ rValue >>= ( *m_pProps->pDateTime );
break;
case FIELD_PROP_PROP_SEQ:
rValue >>= m_pProps->aPropSeq;
@@ -2101,12 +2112,12 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
rValue >>= m_pProps->aStrings;
break;
}
- if( pStr )
+ if ( pStr )
::GetString( rValue, *pStr );
- else if( pBool )
+ else if ( pBool )
{
- if( rValue.getValueType() == getCppuBooleanType() )
- *pBool = *(sal_Bool*)rValue.getValue();
+ if ( rValue.getValueType() == getCppuBooleanType() )
+ *pBool = *(sal_Bool*) rValue.getValue();
else
throw lang::IllegalArgumentException();
}
@@ -2369,10 +2380,8 @@ void SwXTextField::update( ) throw (uno::RuntimeException)
}
break;
}
- // --> FME 2004-10-06 #116480#
// Text formatting has to be triggered.
- const_cast<SwFmtFld*>(m_pFmtFld)->ModifyNotification( 0, 0 );
- // <--
+ const_cast< SwFmtFld* >( m_pFmtFld )->ModifyNotification( 0, 0 );
}
else
m_bCallUpdate = sal_True;
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 47cb131d7243..ab3ae3bf65bc 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -36,10 +36,8 @@
#include <svx/xflhtit.hxx>
#include <svx/xfltrit.hxx>
#include <editeng/memberids.hrc>
-
#include <swtypes.hxx>
#include <cmdid.h>
-
#include <memory>
#include <hints.hxx>
#include <doc.hxx>
@@ -105,10 +103,8 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/printer.hxx>
-//Begin Bug 119922
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
-//End Bug 119922
#include <SwStyleNameMapper.hxx>
#include <xmloff/xmlcnitm.hxx>
#include <poolfmt.hxx>
@@ -121,9 +117,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <svx/fmmodel.hxx>
#include <switerator.hxx>
-
-//UUUU
-#include <unobrushitemhelper.hxx>
+#include <svx/unobrushitemhelper.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xgrscit.hxx>
@@ -139,6 +133,8 @@
#include <svx/xflboxy.hxx>
#include <svx/xflbckit.hxx>
#include <svx/unoshape.hxx>
+#include <swunohelper.hxx>
+#include <drawdoc.hxx>
// from fefly1.cxx
extern sal_Bool lcl_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -153,9 +149,6 @@ using ::com::sun::star::style::XStyleFamiliesSupplier;
const sal_Char __FAR_DATA sPackageProtocol[] = "vnd.sun.star.Package:";
const sal_Char __FAR_DATA sGraphicObjectProtocol[] = "vnd.sun.star.GraphicObject:";
-//UUUU
-#define OWN_ATTR_FILLBMP_MODE (OWN_ATTR_VALUE_START+45)
-
/****************************************************************************
Rahmenbeschreibung
****************************************************************************/
@@ -204,6 +197,13 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet,
const sal_Bool bOasis /*sal_False*/ )
//End Bug 119922
{
+ //UUUU assert when the target SfxItemSet has no parent. It *should* have the pDfltFrmFmt
+ // from SwDoc set as parent (or similar) to have the necessary XFILL_NONE in the ItemSet
+ if(!rToSet.GetParent())
+ {
+ OSL_ENSURE(false, "OOps, target SfxItemSet *should* have a parent which contains XFILL_NONE as XFillStyleItem (!)");
+ }
+
sal_Bool bRet = sal_True;
//Anker kommt auf jeden Fall in den Set
SwFmtAnchor aAnchor ( static_cast < const SwFmtAnchor & > ( rFromSet.Get ( RES_ANCHOR ) ) );
@@ -298,7 +298,10 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet,
// in the obvious order some attributes may be wrong since they are set by the 1st set, but not
// redefined as needed by the 2nd set when they are default (and thus no tset) in the 2nd set. If
// it is necessary for any reason to set both (it should not) a in-between step will be needed
- // that resets the items for FillAttributes in rToSet to default
+ // that resets the items for FillAttributes in rToSet to default.
+ // Note: There are other mechanisms in XMLOFF to pre-sort this relationship already, but this version
+ // was used initially, is tested and works. Keep it to be able to react when another feed adds attributes
+ // from both sets.
if(bSvxBrushItemPropertiesUsed && !bXFillStyleItemUsed)
{
//UUUU create a temporary SvxBrushItem, fill the attributes to it and use it to set
@@ -910,43 +913,50 @@ inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, con
rToSet.Put(aCol);
}
}
-sal_Bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItemSet&, sal_Bool& rSizeFound)
+sal_Bool SwFrameProperties_Impl::AnyToItemSet(
+ SwDoc *pDoc,
+ SfxItemSet& rSet,
+ SfxItemSet&,
+ sal_Bool& rSizeFound )
{
- //Properties fuer alle Frames
- const ::uno::Any *pStyleName;
- SwDocStyleSheet* pStyle = NULL;
- sal_Bool bRet;
+ sal_Bool bRet = sal_False;
- if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
+ SwDocStyleSheet* pStyle = NULL;
+ const ::uno::Any *pStyleName;
+ if ( GetProperty( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
{
- OUString sStyle;
- *pStyleName >>= sStyle;
- pStyle = (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle,
- SFX_STYLE_FAMILY_FRAME);
+ OUString sTmpStylename;
+ *pStyleName >>= sTmpStylename;
+ String sStylename;
+ SwStyleNameMapper::FillUIName( String(sTmpStylename), sStylename, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, sal_True );
+ pStyle =
+ (SwDocStyleSheet*) pDoc->GetDocShell()->GetStyleSheetPool()->Find( sStylename, SFX_STYLE_FAMILY_FRAME );
}
const ::uno::Any* pColumns = NULL;
- GetProperty (RES_COL, MID_COLUMNS, pColumns);
- if ( pStyle )
+ GetProperty( RES_COL, MID_COLUMNS, pColumns );
+ if ( pStyle != NULL )
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) );
- const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
- lcl_FillCol ( rSet, *pItemSet, pColumns );
+ const ::SfxItemSet *pItemSet = &xStyle->GetItemSet();
+ bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
+ lcl_FillCol( rSet, *pItemSet, pColumns );
}
else
{
- const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME )->GetAttrSet();
- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
- lcl_FillCol ( rSet, *pItemSet, pColumns );
+ const ::SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME )->GetAttrSet();
+ bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
+ lcl_FillCol( rSet, *pItemSet, pColumns );
}
+
const ::uno::Any* pEdit;
- if(GetProperty(RES_EDIT_IN_READONLY, 0, pEdit))
+ if ( GetProperty( RES_EDIT_IN_READONLY, 0, pEdit ) )
{
- SfxBoolItem aBool(RES_EDIT_IN_READONLY);
- ((SfxPoolItem&)aBool).PutValue(*pEdit, 0);
- rSet.Put(aBool);
+ SfxBoolItem aBool( RES_EDIT_IN_READONLY );
+ ( (SfxPoolItem&) aBool ).PutValue( *pEdit, 0 );
+ rSet.Put( aBool );
}
+
return bRet;
}
/****************************************************************************
@@ -982,23 +992,24 @@ inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet,
}
}
-sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
- SwDoc* pDoc,
- SfxItemSet& rFrmSet,
- SfxItemSet& rGrSet,
- sal_Bool& rSizeFound)
+sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
+ SwDoc* pDoc,
+ SfxItemSet& rFrmSet,
+ SfxItemSet& rGrSet,
+ sal_Bool& rSizeFound )
{
- //Properties fuer alle Frames
- sal_Bool bRet;
- const ::uno::Any *pStyleName;
- SwDocStyleSheet* pStyle = NULL;
+ sal_Bool bRet = sal_False;
- if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
+ SwDocStyleSheet* pStyle = NULL;
+ const ::uno::Any *pStyleName;
+ if ( GetProperty( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
{
- OUString sStyle;
- *pStyleName >>= sStyle;
- pStyle = (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle,
- SFX_STYLE_FAMILY_FRAME);
+ OUString sTmpStylename;
+ *pStyleName >>= sTmpStylename;
+ String sStylename;
+ SwStyleNameMapper::FillUIName( String(sTmpStylename), sStylename, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, sal_True );
+ pStyle =
+ (SwDocStyleSheet*) pDoc->GetDocShell()->GetStyleSheetPool()->Find( sStylename, SFX_STYLE_FAMILY_FRAME );
}
const ::uno::Any* pHEvenMirror = 0;
@@ -1008,24 +1019,22 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_HORZ_ODD_PAGES, pHOddMirror);
GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_VERT, pVMirror);
- if ( pStyle )
+ if ( pStyle != NULL )
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) );
const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- //Begin Bug 119922
sal_Bool bOasis = sal_False;
{
const SfxMedium* pMedium = pDoc->GetDocShell()->GetMedium();
- const SfxFilter * pFilter = pMedium
- ? pMedium->GetFilter()
- : NULL;
- if ( pMedium && pFilter )
+ const SfxFilter * pFilter = pMedium != NULL
+ ? pMedium->GetFilter()
+ : NULL;
+ if ( pFilter != NULL )
{
bOasis = pFilter->GetVersion() > SOFFICE_FILEFORMAT_60;
}
}
bRet = FillBaseProperties( rFrmSet, *pItemSet, rSizeFound, bOasis );
- //End Bug 119922
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
}
else
@@ -1035,8 +1044,7 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
}
-
- static const :: sal_uInt16 nIDs[] =
+ static const ::sal_uInt16 nIDs[] =
{
RES_GRFATR_CROPGRF,
RES_GRFATR_ROTATION,
@@ -1052,14 +1060,14 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
0
};
const ::uno::Any* pAny;
- for(sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++)
+ for ( sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++ )
{
- sal_uInt8 nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ? CONVERT_TWIPS : 0;
- if(GetProperty(nIDs[nIndex], nMId, pAny ))
+ const sal_uInt8 nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ? CONVERT_TWIPS : 0;
+ if ( GetProperty( nIDs[nIndex], nMId, pAny ) )
{
SfxPoolItem* pItem = ::GetDfltAttr( nIDs[nIndex] )->Clone();
- bRet &= pItem->PutValue(*pAny, nMId );
- rGrSet.Put(*pItem);
+ bRet &= pItem->PutValue( *pAny, nMId );
+ rGrSet.Put( *pItem );
delete pItem;
}
}
@@ -1067,6 +1075,7 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
return bRet;
}
+
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
public:
@@ -1077,17 +1086,22 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-sal_Bool SwOLEProperties_Impl::AnyToItemSet(
- SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound)
+
+sal_Bool SwOLEProperties_Impl::AnyToItemSet(
+ SwDoc* pDoc,
+ SfxItemSet& rFrmSet,
+ SfxItemSet& rSet,
+ sal_Bool& rSizeFound )
{
const ::uno::Any* pTemp;
- if(!GetProperty(FN_UNO_CLSID, 0, pTemp) && !GetProperty(FN_UNO_STREAM_NAME, 0, pTemp) )
+ if ( !GetProperty( FN_UNO_CLSID, 0, pTemp ) && !GetProperty( FN_UNO_STREAM_NAME, 0, pTemp ) )
return sal_False;
- SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound);
- //
+ SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound );
+
return sal_True;
}
+
/******************************************************************
* SwXFrame
******************************************************************/
@@ -1282,7 +1296,7 @@ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
{
SwDoc *pDoc = pFmt->GetDoc();
// --> OD 2005-08-08 #i52858# - method name changed
- SdrModel *pDrawModel = pDoc->GetOrCreateDrawModel();
+ SwDrawModel* pDrawModel = pDoc->GetOrCreateDrawModel();
// <--
SwFlyDrawContact* pContactObject = new SwFlyDrawContact( pFmt, *pDrawModel );
pObject = pContactObject->GetMaster();
@@ -1674,7 +1688,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
{
SdrObject* pObject =
GetOrCreateSdrObject( (SwFlyFrmFmt*)pFmt );
- SdrModel *pDrawModel = pDoc->GetDrawModel();
+ SwDrawModel* pDrawModel = pDoc->GetDrawModel();
pDrawModel->GetPage(0)->
SetNavigationPosition(pObject->GetNavigationPosition(), nZOrder);
}
@@ -1727,7 +1741,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
if(RES_BACKGROUND == pEntry->nWID)
{
const SwAttrSet& rSet = pFmt->GetAttrSet();
- const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet));
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
aChangedBrushItem.PutValue(aValue, nMemberId);
@@ -1763,6 +1777,64 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
bDone = true;
}
+ switch(nMemberId)
+ {
+ case MID_NAME:
+ {
+ //UUUU when named items get set, replace these with the NameOrIndex items
+ // which exist already in the pool
+ switch(pEntry->nWID)
+ {
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_FILLBITMAP:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ {
+ OUString aTempName;
+
+ if(!(aValue >>= aTempName ))
+ {
+ throw lang::IllegalArgumentException();
+ }
+
+ bDone = SvxShape::SetFillAttribute(pEntry->nWID, aTempName, aSet);
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ break;
+ }
+ case MID_GRAFURL:
+ {
+ //UUUU Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
+ switch(pEntry->nWID)
+ {
+ case XATTR_FILLBITMAP:
+ {
+ const Graphic aNullGraphic;
+ XFillBitmapItem aXFillBitmapItem(aSet.GetPool(), aNullGraphic);
+
+ aXFillBitmapItem.PutValue(aValue, nMemberId);
+ aSet.Put(aXFillBitmapItem);
+ bDone = true;
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
if(!bDone)
{
m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
@@ -1830,7 +1902,9 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
throw lang::IllegalArgumentException();
}
else
+ {
pFmt->SetFmtAttr(aSet);
+ }
}
}
else if(IsDescriptor())
@@ -1941,26 +2015,25 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
{
String sGrfName;
const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
- if(pIdx)
+ if ( pIdx )
{
- SwNodeIndex aIdx(*pIdx, 1);
-// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
+ SwNodeIndex aIdx( *pIdx, 1 );
SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
- if(!pGrfNode)
+ if ( !pGrfNode )
throw uno::RuntimeException();
- if( pGrfNode->IsGrfLink() )
+ if ( pGrfNode->IsGrfLink() )
{
- pFmt->GetDoc()->GetGrfNms( *(SwFlyFrmFmt*)pFmt, &sGrfName, 0 );
+ pFmt->GetDoc()->GetGrfNms( *(SwFlyFrmFmt*) pFmt, &sGrfName, 0 );
}
else
{
- String sPrefix( RTL_CONSTASCII_STRINGPARAM(sGraphicObjectProtocol) );
+ String sPrefix( RTL_CONSTASCII_STRINGPARAM( sGraphicObjectProtocol ) );
String sId( pGrfNode->GetGrfObj().GetUniqueID(),
- RTL_TEXTENCODING_ASCII_US );
- (sGrfName = sPrefix) += sId;
+ RTL_TEXTENCODING_ASCII_US );
+ ( sGrfName = sPrefix ) += sId;
}
}
- aAny <<= OUString(sGrfName);
+ aAny <<= OUString( sGrfName );
}
else if( FN_UNO_REPLACEMENT_GRAPHIC_U_R_L == pEntry->nWID)
{
@@ -2157,7 +2230,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
if(RES_BACKGROUND == pEntry->nWID)
{
//UUUU
- const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet));
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
if(!aOriginalBrushItem.QueryValue(aAny, nMemberId))
{
@@ -2291,42 +2364,6 @@ beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
return aStates.getConstArray()[0];
}
-//UUUU
-bool SwXFrame::needToMapFillItemsToSvxBrushItemTypes() const
-{
- SwFrmFmt* pFmt = GetFrmFmt();
-
- if(!pFmt)
- {
- return false;
- }
-
- const SwAttrSet& rFmtSet = pFmt->GetAttrSet();
- const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rFmtSet.GetItem(XATTR_FILLSTYLE, false)));
-
- if(!pXFillStyleItem)
- {
- return false;
- }
-
- //UUUU here different FillStyles can be excluded for export; it will depend on the
- // quality these fallbacks can reach. That again is done in getSvxBrushItemFromSourceSet,
- // take a look there how the superset of DrawObject FillStyles is mapped to SvxBrushItem.
- // For now, take them all - except XFILL_NONE
-
- if(XFILL_NONE != pXFillStyleItem->GetValue())
- {
- return true;
- }
-
- //if(XFILL_SOLID == pXFillStyleItem->GetValue() || XFILL_BITMAP == pXFillStyleItem->GetValue())
- //{
- // return true;
- //}
-
- return false;
-}
-
uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
const uno::Sequence< OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -2372,7 +2409,7 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
// as beans::PropertyState_DIRECT_VALUE to let users of this property call
// getPropertyValue where the member properties will be mapped from the
// fill attributes to the according SvxBrushItem entries
- else if(RES_BACKGROUND == pEntry->nWID && needToMapFillItemsToSvxBrushItemTypes())
+ else if(RES_BACKGROUND == pEntry->nWID && SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(rFmtSet))
{
pStates[i] = beans::PropertyState_DIRECT_VALUE;
}
@@ -2682,6 +2719,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
SfxItemSet aGrSet(pDoc->GetAttrPool(), aGrAttrRange );
SfxItemSet aFrmSet(pDoc->GetAttrPool(), aFrmAttrRange );
+
+ //UUUU set correct parent to get the XFILL_NONE FillStyle as needed
+ aFrmSet.SetParent(&pDoc->GetDfltFrmFmt()->GetAttrSet());
+
//jetzt muessen die passenden Items in den Set
sal_Bool bSizeFound;
if(!pProps->AnyToItemSet( pDoc, aFrmSet, aGrSet, bSizeFound))
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 85ca8e7419af..1d2c108d84f6 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -297,6 +297,9 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
// OD 18.09.2003 #i18732# - add property
// OD 2004-05-05 #i28701# - add property 'WrapInfluenceOnObjPos'
// OD 2009-07-13 #i73249# - add properties 'Title' and 'Description'
+//UUUU all users of COMMON_FRAME_PROPERTIES add the new XATTR_FILL_FIRST, XATTR_FILL_LAST FillStyle,
+// thus it may be possible to remove the RES_BACKGROUND entries from SvxBrushItem completely (this includes
+// all using UNO_NAME_BACK_* slots) in the future
#define COMMON_FRAME_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_ANCHOR_PAGE_NO), RES_ANCHOR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_ANCHOR_PAGENUM }, \
{ SW_PROP_NMID(UNO_NAME_ANCHOR_TYPE), RES_ANCHOR, CPPU_E2T(CPPUTYPE_TXTCNTANCHOR), PROPERTY_NONE, MID_ANCHOR_ANCHORTYPE}, \
@@ -582,6 +585,14 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
COMMON_TEXT_CONTENT_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_CHAR_STYLE_NAME), RES_TXTATR_CHARFMT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0},\
{ SW_PROP_NMID(UNO_NAME_CHAR_STYLE_NAMES), FN_UNO_CHARFMT_SEQUENCE, CPPU_E2T(CPPUTYPE_OUSTRINGS), PropertyAttribute::MAYBEVOID, 0},\
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to style import/export
+ //UUUU Added for paragraph backgrounds, this is for paragraph itself
+ FILL_PROPERTIES_SW
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aParagraphMap_Impl;
@@ -609,6 +620,14 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
TABSTOPS_MAP_ENTRY
COMMON_TEXT_CONTENT_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_PARA_AUTO_STYLE_NAME), RES_AUTO_STYLE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0},
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to style import/export
+ //UUUU Added for paragraph backgrounds, this is for Paragraph AutoStyles
+ FILL_PROPERTIES_SW
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aAutoParaStyleMap;
@@ -724,6 +743,14 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
static SfxItemPropertyMapEntry aParaStyleMap [] =
{
COMMON_PARA_STYLE_PROPERTIES
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to style import/export
+ //UUUU Added for paragraph backgrounds, this is for Paragraph Styles
+ FILL_PROPERTIES_SW
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aParaStyleMap;
@@ -735,6 +762,14 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{
COMMON_PARA_STYLE_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_PARA_STYLE_CONDITIONS), FN_UNO_PARA_STYLE_CONDITIONS, CPPU_E2T(CPPUTYPE_SEQNAMEDVALUE), PropertyAttribute::MAYBEVOID, 0},
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to style import/export
+ //UUUU Added for paragraph backgrounds, this is for Paragraph Styles
+ FILL_PROPERTIES_SW
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aParaStyleMap;
@@ -818,9 +853,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE},
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
- //UUUU adf FillProperties for SW, same as FILL_PROPERTIES in svx
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
// but need own defines in Writer due to later association of strings
- // and uno types (see loop at end of this metjhod and definition of SW_PROP_NMID)
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to style import/export
FILL_PROPERTIES_SW
{0,0,0,0,0,0}
@@ -851,56 +887,59 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_BOTTOM_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
{ SW_PROP_NMID(UNO_NAME_SHADOW_FORMAT), RES_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_HEADER_BACK_COLOR), FN_UNO_HEADER_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR },
- // { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC), FN_UNO_HEADER_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC
- { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC_URL), FN_UNO_HEADER_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
- { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC_FILTER), FN_UNO_HEADER_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_FILTER },
- { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC_LOCATION), FN_UNO_HEADER_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PROPERTY_NONE ,MID_GRAPHIC_POSITION},
- { SW_PROP_NMID(UNO_NAME_HEADER_LEFT_MARGIN), FN_UNO_HEADER_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_HEADER_RIGHT_MARGIN), FN_UNO_HEADER_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_HEADER_BACK_TRANSPARENT), FN_UNO_HEADER_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT },
- { SW_PROP_NMID(UNO_NAME_HEADER_LEFT_BORDER), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_RIGHT_BORDER), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_TOP_BORDER), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_BOTTOM_BORDER), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, BOTTOM_BORDER|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_BORDER_DISTANCE), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, BORDER_DISTANCE|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_LEFT_BORDER_DISTANCE), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LEFT_BORDER_DISTANCE |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_RIGHT_BORDER_DISTANCE), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_TOP_BORDER_DISTANCE), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, TOP_BORDER_DISTANCE |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_BOTTOM_BORDER_DISTANCE), FN_UNO_HEADER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_SHADOW_FORMAT), FN_UNO_HEADER_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_HEADER_BODY_DISTANCE), FN_UNO_HEADER_BODY_DISTANCE,CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_LO_MARGIN|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_IS_DYNAMIC_HEIGHT), FN_UNO_HEADER_IS_DYNAMIC_DISTANCE,CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
- { SW_PROP_NMID(UNO_NAME_HEADER_IS_SHARED), FN_UNO_HEADER_SHARE_CONTENT,CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
- { SW_PROP_NMID(UNO_NAME_HEADER_HEIGHT), FN_UNO_HEADER_HEIGHT, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_SIZE_HEIGHT|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_HEADER_IS_ON), FN_UNO_HEADER_ON, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
- { SW_PROP_NMID(UNO_NAME_HEADER_DYNAMIC_SPACING), FN_UNO_HEADER_EAT_SPACING, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID ,0 },
-
- { SW_PROP_NMID(UNO_NAME_FOOTER_BACK_COLOR), FN_UNO_FOOTER_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR },
- // { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC), FN_UNO_FOOTER_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC
- { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC_URL), FN_UNO_FOOTER_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
- { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC_FILTER), FN_UNO_FOOTER_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_FILTER },
- { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC_LOCATION), FN_UNO_FOOTER_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PROPERTY_NONE ,MID_GRAPHIC_POSITION},
- { SW_PROP_NMID(UNO_NAME_FOOTER_LEFT_MARGIN), FN_UNO_FOOTER_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_FOOTER_RIGHT_MARGIN), FN_UNO_FOOTER_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_FOOTER_BACK_TRANSPARENT), FN_UNO_FOOTER_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT },
- { SW_PROP_NMID(UNO_NAME_FOOTER_LEFT_BORDER), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_RIGHT_BORDER), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_TOP_BORDER), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_BOTTOM_BORDER), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, BOTTOM_BORDER|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_BORDER_DISTANCE), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, BORDER_DISTANCE|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_LEFT_BORDER_DISTANCE), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LEFT_BORDER_DISTANCE |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_RIGHT_BORDER_DISTANCE), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_TOP_BORDER_DISTANCE), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, TOP_BORDER_DISTANCE |CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_BOTTOM_BORDER_DISTANCE), FN_UNO_FOOTER_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_SHADOW_FORMAT), FN_UNO_FOOTER_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},
- { SW_PROP_NMID(UNO_NAME_FOOTER_BODY_DISTANCE), FN_UNO_FOOTER_BODY_DISTANCE,CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_UP_MARGIN|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_IS_DYNAMIC_HEIGHT), FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE,CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
- { SW_PROP_NMID(UNO_NAME_FOOTER_IS_SHARED), FN_UNO_FOOTER_SHARE_CONTENT,CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
- { SW_PROP_NMID(UNO_NAME_FOOTER_HEIGHT), FN_UNO_FOOTER_HEIGHT, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_SIZE_HEIGHT|CONVERT_TWIPS },
- { SW_PROP_NMID(UNO_NAME_FOOTER_IS_ON), FN_UNO_FOOTER_ON, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
- { SW_PROP_NMID(UNO_NAME_FOOTER_DYNAMIC_SPACING), FN_UNO_FOOTER_EAT_SPACING, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID ,0 },
-
+ //UUU use real WhichIDs for Header, no longer use extra-defined WhichIDs which make handling harder as needed.
+ // The implementation will decide if these are part of Header/Footer or PageStyle depending on the SlotName,
+ // more precisely on the first characters. Thus it is necessary that these are 'Header' for the Header slots
+ { SW_PROP_NMID(UNO_NAME_HEADER_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR },
+ // { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC), RES_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC
+ { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
+ { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC_FILTER), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_FILTER },
+ { SW_PROP_NMID(UNO_NAME_HEADER_GRAPHIC_LOCATION), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PROPERTY_NONE ,MID_GRAPHIC_POSITION},
+ { SW_PROP_NMID(UNO_NAME_HEADER_LEFT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS},
+ { SW_PROP_NMID(UNO_NAME_HEADER_RIGHT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},
+ { SW_PROP_NMID(UNO_NAME_HEADER_BACK_TRANSPARENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT },
+ { SW_PROP_NMID(UNO_NAME_HEADER_LEFT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_RIGHT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_TOP_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_BOTTOM_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, BOTTOM_BORDER|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, BORDER_DISTANCE|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_LEFT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LEFT_BORDER_DISTANCE |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_RIGHT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_TOP_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, TOP_BORDER_DISTANCE |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_BOTTOM_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_SHADOW_FORMAT), RES_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},
+ { SW_PROP_NMID(UNO_NAME_HEADER_BODY_DISTANCE), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_LO_MARGIN|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_IS_DYNAMIC_HEIGHT), SID_ATTR_PAGE_DYNAMIC, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
+ { SW_PROP_NMID(UNO_NAME_HEADER_IS_SHARED), SID_ATTR_PAGE_SHARED, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
+ { SW_PROP_NMID(UNO_NAME_HEADER_HEIGHT), SID_ATTR_PAGE_SIZE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_SIZE_HEIGHT|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_HEADER_IS_ON), SID_ATTR_PAGE_ON, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
+ { SW_PROP_NMID(UNO_NAME_HEADER_DYNAMIC_SPACING), RES_HEADER_FOOTER_EAT_SPACING, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID ,0 },
+
+ //UUU use real WhichIDs for Footer, see Header (above) for more infos
+ { SW_PROP_NMID(UNO_NAME_FOOTER_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR },
+ // { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC), RES_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC
+ { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC_FILTER), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_FILTER },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_GRAPHIC_LOCATION), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PROPERTY_NONE ,MID_GRAPHIC_POSITION},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_LEFT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_RIGHT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_BACK_TRANSPARENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_LEFT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_RIGHT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_TOP_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_BOTTOM_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, BOTTOM_BORDER|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, BORDER_DISTANCE|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_LEFT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LEFT_BORDER_DISTANCE |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_RIGHT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_TOP_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, TOP_BORDER_DISTANCE |CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_BOTTOM_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_SHADOW_FORMAT), RES_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_BODY_DISTANCE), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_UP_MARGIN|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_IS_DYNAMIC_HEIGHT), SID_ATTR_PAGE_DYNAMIC, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_IS_SHARED), SID_ATTR_PAGE_SHARED, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_HEIGHT), SID_ATTR_PAGE_SIZE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_SIZE_HEIGHT|CONVERT_TWIPS },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_IS_ON), SID_ATTR_PAGE_ON, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,0 },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_DYNAMIC_SPACING), RES_HEADER_FOOTER_EAT_SPACING, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID ,0 },
{ SW_PROP_NMID(UNO_NAME_IS_LANDSCAPE), SID_ATTR_PAGE, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_PAGE_ORIENTATION },
{ SW_PROP_NMID(UNO_NAME_NUMBERING_TYPE), SID_ATTR_PAGE, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , MID_PAGE_NUMTYPE },
@@ -932,7 +971,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_TEXT_DISTANCE), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE , MID_LINE_TEXT_DIST |CONVERT_TWIPS },
{ SW_PROP_NMID(UNO_NAME_FOOTNOTE_LINE_DISTANCE), FN_PARAM_FTN_INFO, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE , MID_LINE_FOOTNOTE_DIST|CONVERT_TWIPS},
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
- // writing grid
+
+ // writing grid
{ SW_PROP_NMID(UNO_NAME_GRID_COLOR), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_GRID_COLOR},
{ SW_PROP_NMID(UNO_NAME_GRID_LINES), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_GRID_LINES},
{ SW_PROP_NMID(UNO_NAME_GRID_BASE_HEIGHT), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_GRID_BASEHEIGHT|CONVERT_TWIPS},
@@ -944,6 +984,72 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_GRID_BASE_WIDTH), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_GRID_BASEWIDTH|CONVERT_TWIPS},
{ SW_PROP_NMID(UNO_NAME_GRID_SNAP_TO_CHARS), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_SNAPTOCHARS},
{ SW_PROP_NMID(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_STANDARD_MODE},
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to style import/export
+ FILL_PROPERTIES_SW
+
+ //UUUU Added DrawingLayer FillStyle Properties for Header. These need an own unique name,
+ // but reuse the same WhichIDs as the regular fill. The implementation will decide to which
+ // group of fill properties it belongs based on the start of the name (was already done in
+ // the implementation partially), thus all SlotNames *have* to start with 'Header'
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, CPPU_E2T(CPPUTYPE_BOOLEAN) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_Y), XATTR_FILLBMP_POSOFFSETY, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, CPPU_E2T(CPPUTYPE_RECTANGLEPOINT) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, CPPU_E2T(CPPUTYPE_INT32) , 0, SFX_METRIC_ITEM},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, CPPU_E2T(CPPUTYPE_INT32) , 0, SFX_METRIC_ITEM},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, CPPU_E2T(CPPUTYPE_BOOLEAN) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_TILE), XATTR_FILLBMP_TILE, CPPU_E2T(CPPUTYPE_BOOLEAN) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, CPPU_E2T(CPPUTYPE_BITMAPMODE), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLCOLOR), XATTR_FILLCOLOR, CPPU_E2T(CPPUTYPE_INT32), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBACKGROUND), XATTR_FILLBACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBITMAP), XATTR_FILLBITMAP, CPPU_E2T(CPPUTYPE_REFBITMAP), 0, MID_BITMAP},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBITMAPNAME), XATTR_FILLBITMAP, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLBITMAPURL), XATTR_FILLBITMAP, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_GRAFURL },
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT, CPPU_E2T(CPPUTYPE_INT16), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLGRADIENT), XATTR_FILLGRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), 0, MID_FILLGRADIENT},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLGRADIENTNAME), XATTR_FILLGRADIENT, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLHATCH), XATTR_FILLHATCH, CPPU_E2T(CPPUTYPE_HATCH), 0, MID_FILLHATCH},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLHATCHNAME), XATTR_FILLHATCH, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLSTYLE), XATTR_FILLSTYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, CPPU_E2T(CPPUTYPE_INT16), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENT), XATTR_FILLFLOATTRANSPARENCE, CPPU_E2T(CPPUTYPE_GRADIENT), 0, MID_FILLGRADIENT},
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENTNAME), XATTR_FILLFLOATTRANSPARENCE, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_HEADER_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, CPPU_E2T(CPPUTYPE_INT32), 0, 0},
+
+ //UUUU Added DrawingLayer FillStyle Properties for Footer, similar as for Header (see there)
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, CPPU_E2T(CPPUTYPE_BOOLEAN) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_Y), XATTR_FILLBMP_POSOFFSETY, CPPU_E2T(CPPUTYPE_INT32) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, CPPU_E2T(CPPUTYPE_RECTANGLEPOINT) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, CPPU_E2T(CPPUTYPE_INT32) , 0, SFX_METRIC_ITEM},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, CPPU_E2T(CPPUTYPE_INT32) , 0, SFX_METRIC_ITEM},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, CPPU_E2T(CPPUTYPE_BOOLEAN) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_TILE), XATTR_FILLBMP_TILE, CPPU_E2T(CPPUTYPE_BOOLEAN) , 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, CPPU_E2T(CPPUTYPE_BITMAPMODE), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLCOLOR), XATTR_FILLCOLOR, CPPU_E2T(CPPUTYPE_INT32), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBACKGROUND), XATTR_FILLBACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBITMAP), XATTR_FILLBITMAP, CPPU_E2T(CPPUTYPE_REFBITMAP), 0, MID_BITMAP},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBITMAPNAME), XATTR_FILLBITMAP, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLBITMAPURL), XATTR_FILLBITMAP, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_GRAFURL },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT, CPPU_E2T(CPPUTYPE_INT16), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLGRADIENT), XATTR_FILLGRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), 0, MID_FILLGRADIENT},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLGRADIENTNAME), XATTR_FILLGRADIENT, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLHATCH), XATTR_FILLHATCH, CPPU_E2T(CPPUTYPE_HATCH), 0, MID_FILLHATCH},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLHATCHNAME), XATTR_FILLHATCH, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLSTYLE), XATTR_FILLSTYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, CPPU_E2T(CPPUTYPE_INT16), 0, 0},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENT), XATTR_FILLFLOATTRANSPARENCE, CPPU_E2T(CPPUTYPE_GRADIENT), 0, MID_FILLGRADIENT},
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENTNAME), XATTR_FILLFLOATTRANSPARENCE, CPPU_E2T(CPPUTYPE_OUSTRING), 0, MID_NAME },
+ { SW_PROP_NMID(UNO_NAME_FOOTER_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, CPPU_E2T(CPPUTYPE_INT32), 0, 0},
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aPageStyleMap;
@@ -1174,9 +1280,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_WIDTH_TYPE), RES_FRM_SIZE, CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, MID_FRMSIZE_WIDTH_TYPE },
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
- //UUUU adf FillProperties for SW, same as FILL_PROPERTIES in svx
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
// but need own defines in Writer due to later association of strings
- // and uno types (see loop at end of this metjhod and definition of SW_PROP_NMID)
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to FlyFrame import/export
FILL_PROPERTIES_SW
{0,0,0,0,0,0}
@@ -1187,7 +1294,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
case PROPERTY_MAP_TEXT_GRAPHIC:
{
static SfxItemPropertyMapEntry aGraphicPropertyMap_Impl[] =
- {
+ { //UUUU
+ // evtl. completely remove SvxBrushItem stuff ()
+ // add support for XATTR_FILL_FIRST, XATTR_FILL_LAST
+ // COMMON_FRAME_PROPERTIES currently hosts the RES_BACKGROUND entries from SvxBrushItem
COMMON_FRAME_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUR },
{ SW_PROP_NMID(UNO_NAME_CONTOUR_OUTSIDE), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUROUTSIDE },
@@ -1214,6 +1324,13 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_GRAPHIC_IS_INVERTED), RES_GRFATR_INVERT, CPPU_E2T(CPPUTYPE_BOOLEAN), 0, 0},
{ SW_PROP_NMID(UNO_NAME_TRANSPARENCY), RES_GRFATR_TRANSPARENCY, CPPU_E2T(CPPUTYPE_INT16), 0, 0},
{ SW_PROP_NMID(UNO_NAME_GRAPHIC_COLOR_MODE), RES_GRFATR_DRAWMODE, CPPU_E2T(CPPUTYPE_COLORMODE), 0, 0},
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to Writer GraphicObject import/export
+ FILL_PROPERTIES_SW
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aGraphicPropertyMap_Impl;
@@ -1222,7 +1339,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
case PROPERTY_MAP_EMBEDDED_OBJECT:
{
static SfxItemPropertyMapEntry aEmbeddedPropertyMap_Impl[] =
- {
+ { //UUUU
+ // evtl. completely remove SvxBrushItem stuff ()
+ // add support for XATTR_FILL_FIRST, XATTR_FILL_LAST
+ // COMMON_FRAME_PROPERTIES currently hosts the RES_BACKGROUND entries from SvxBrushItem
COMMON_FRAME_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUR },
{ SW_PROP_NMID(UNO_NAME_CONTOUR_OUTSIDE), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUROUTSIDE},
@@ -1237,6 +1357,13 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_COMPONENT),FN_UNO_COMPONENT, CPPU_E2T(CPPUTYPE_REFCOMPONENT), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_EMBEDDED_OBJECT),FN_EMBEDDED_OBJECT, CPPU_E2T(CPPUTPYE_REFEMBEDDEDOBJECT), PropertyAttribute::READONLY, 0},
// { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 },
+
+ //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+ // but need own defines in Writer due to later association of strings
+ // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+ // This entry is for adding that properties to OLE/EmbeddedObject import/export
+ FILL_PROPERTIES_SW
+
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aEmbeddedPropertyMap_Impl;
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index c7968ce65fa6..9df686af04b7 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -52,11 +50,17 @@
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+//UUUU
+#include <swunohelper.hxx>
+#include <svx/unobrushitemhelper.hxx>
+#include <editeng/unoipset.hxx>
+#include <svx/xflbstit.hxx>
+#include <svx/xflbmtit.hxx>
+#include <com/sun/star/drawing/BitmapMode.hpp>
using namespace ::com::sun::star;
using ::rtl::OUString;
-
/* -----------------------------01.12.00 18:09--------------------------------
---------------------------------------------------------------------------*/
@@ -174,6 +178,13 @@ public:
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException);
+ //UUUU
+ void GetSinglePropertyValue_Impl(
+ const SfxItemPropertySimpleEntry& rEntry,
+ const SfxItemSet& rSet,
+ uno::Any& rAny ) const
+ throw(uno::RuntimeException);
+
uno::Sequence< beans::GetDirectPropertyTolerantResult >
GetPropertyValuesTolerant_Impl(
const uno::Sequence< ::rtl::OUString >& rPropertyNames,
@@ -481,6 +492,99 @@ throw (beans::PropertyVetoException, lang::IllegalArgumentException,
/* -----------------------------02.04.01 11:43--------------------------------
---------------------------------------------------------------------------*/
+
+//UUUU Support for DrawingLayer FillStyles for GetPropertyValue() usages
+void SwXParagraph::Impl::GetSinglePropertyValue_Impl(
+ const SfxItemPropertySimpleEntry& rEntry,
+ const SfxItemSet& rSet,
+ uno::Any& rAny ) const
+throw(uno::RuntimeException)
+{
+ bool bDone(false);
+
+ switch(rEntry.nWID)
+ {
+ case RES_BACKGROUND:
+ {
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
+ const sal_uInt8 nMemberId(rEntry.nMemberId & (~SFX_METRIC_ITEM));
+
+ if(!aOriginalBrushItem.QueryValue(rAny, nMemberId))
+ {
+ OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
+ }
+
+ bDone = true;
+ break;
+ }
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ const XFillBmpStretchItem* pStretchItem = dynamic_cast< const XFillBmpStretchItem* >(&rSet.Get(XATTR_FILLBMP_STRETCH));
+ const XFillBmpTileItem* pTileItem = dynamic_cast< const XFillBmpTileItem* >(&rSet.Get(XATTR_FILLBMP_TILE));
+
+ if( pTileItem && pTileItem->GetValue() )
+ {
+ rAny <<= drawing::BitmapMode_REPEAT;
+ }
+ else if( pStretchItem && pStretchItem->GetValue() )
+ {
+ rAny <<= drawing::BitmapMode_STRETCH;
+ }
+ else
+ {
+ rAny <<= drawing::BitmapMode_NO_REPEAT;
+ }
+
+ bDone = true;
+ break;
+ }
+ default: break;
+ }
+
+ if(!bDone)
+ {
+ // fallback to standard get value implementation used before this helper was created
+ m_rPropSet.getPropertyValue(rEntry, rSet, rAny);
+
+ if(rEntry.pType && *(rEntry.pType) == ::getCppuType((const sal_Int16*)0) && *(rEntry.pType) != rAny.getValueType())
+ {
+ // since the sfx uInt16 item now exports a sal_Int32, we may have to fix this here
+ sal_Int32 nValue(0);
+
+ rAny >>= nValue;
+ rAny <<= static_cast< sal_Int16 >(nValue);
+ }
+
+ //UUUU check for needed metric translation
+ if(rEntry.nMemberId & SFX_METRIC_ITEM)
+ {
+ bool bDoIt(true);
+
+ if(XATTR_FILLBMP_SIZEX == rEntry.nWID || XATTR_FILLBMP_SIZEY == rEntry.nWID)
+ {
+ // exception: If these ItemTypes are used, do not convert when these are negative
+ // since this means they are intended as percent values
+ sal_Int32 nValue = 0;
+
+ if(rAny >>= nValue)
+ {
+ bDoIt = nValue > 0;
+ }
+ }
+
+ if(bDoIt)
+ {
+ const SfxMapUnit eMapUnit(rSet.GetPool()->GetMetric(rEntry.nWID));
+
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ SvxUnoConvertToMM(eMapUnit, rAny);
+ }
+ }
+ }
+ }
+}
+
uno::Sequence< uno::Any > SwXParagraph::Impl::GetPropertyValues_Impl(
const uno::Sequence< OUString > & rPropertyNames )
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
@@ -514,8 +618,8 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
*pEntry, aPam, &(pValues[nProp]), eTemp, &rTxtNode );
if (!bDone)
{
- m_rPropSet.getPropertyValue(
- *pEntry, rAttrSet, pValues[nProp]);
+ //UUUU
+ GetSinglePropertyValue_Impl(*pEntry, rAttrSet, pValues[nProp]);
}
}
}
@@ -797,8 +901,8 @@ throw (uno::RuntimeException)
// if not found try the real paragraph attributes...
if (!bDone)
{
- m_rPropSet.getPropertyValue(
- *pEntry, rValueAttrSet, aValue );
+ //UUUU
+ GetSinglePropertyValue_Impl(*pEntry, rValueAttrSet, aValue);
}
}
@@ -931,61 +1035,107 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
//-----------------------------------------------------------------------------
beans::PropertyState lcl_SwXParagraph_getPropertyState(
-// SwUnoCrsr& rUnoCrsr,
- const SwTxtNode& rTxtNode,
- const SwAttrSet** ppSet,
- const SfxItemPropertySimpleEntry& rEntry,
- sal_Bool &rAttrSetFetched )
-throw (beans::UnknownPropertyException)
+ // SwUnoCrsr& rUnoCrsr,
+ const SwTxtNode& rTxtNode,
+ const SwAttrSet** ppSet,
+ const SfxItemPropertySimpleEntry& rEntry,
+ sal_Bool &rAttrSetFetched)
+ throw (beans::UnknownPropertyException)
{
- beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE;
+ beans::PropertyState eRet(beans::PropertyState_DEFAULT_VALUE);
- if(!(*ppSet) && !rAttrSetFetched )
+ if(!(*ppSet) && !rAttrSetFetched)
{
(*ppSet) = rTxtNode.GetpSwAttrSet();
rAttrSetFetched = sal_True;
}
- SwPosition aPos( rTxtNode );
- SwPaM aPam( aPos );
- switch( rEntry.nWID )
+
+ SwPosition aPos(rTxtNode);
+ SwPaM aPam(aPos);
+ bool bDone(false);
+
+ switch(rEntry.nWID)
{
- case FN_UNO_NUM_RULES:
- // if numbering is set, return it; else do nothing
- SwUnoCursorHelper::getNumberingProperty( aPam, eRet, NULL );
- break;
- case FN_UNO_ANCHOR_TYPES:
- break;
- case RES_ANCHOR:
- if ( MID_SURROUND_SURROUNDTYPE != rEntry.nMemberId )
- goto lcl_SwXParagraph_getPropertyStateDEFAULT;
- break;
- case RES_SURROUND:
- if ( MID_ANCHOR_ANCHORTYPE != rEntry.nMemberId )
- goto lcl_SwXParagraph_getPropertyStateDEFAULT;
- break;
- case FN_UNO_PARA_STYLE:
- case FN_UNO_PARA_CONDITIONAL_STYLE_NAME:
+ case FN_UNO_NUM_RULES:
{
- SwFmtColl* pFmt = SwUnoCursorHelper::GetCurTxtFmtColl(
- aPam, rEntry.nWID == FN_UNO_PARA_CONDITIONAL_STYLE_NAME);
- eRet = pFmt ? beans::PropertyState_DIRECT_VALUE
- : beans::PropertyState_AMBIGUOUS_VALUE;
+ // if numbering is set, return it; else do nothing
+ SwUnoCursorHelper::getNumberingProperty(aPam,eRet,NULL);
+ bDone = true;
+ break;
}
- break;
- case FN_UNO_PAGE_STYLE:
+ case FN_UNO_ANCHOR_TYPES:
+ {
+ bDone = true;
+ break;
+ }
+ case RES_ANCHOR:
+ {
+ bDone = (MID_SURROUND_SURROUNDTYPE == rEntry.nMemberId);
+ break;
+ }
+ case RES_SURROUND:
+ {
+ bDone = (MID_ANCHOR_ANCHORTYPE == rEntry.nMemberId);
+ break;
+ }
+ case FN_UNO_PARA_STYLE:
+ case FN_UNO_PARA_CONDITIONAL_STYLE_NAME:
+ {
+ SwFmtColl* pFmt = SwUnoCursorHelper::GetCurTxtFmtColl(aPam,rEntry.nWID == FN_UNO_PARA_CONDITIONAL_STYLE_NAME);
+ eRet = pFmt ? beans::PropertyState_DIRECT_VALUE : beans::PropertyState_AMBIGUOUS_VALUE;
+ bDone = true;
+ break;
+ }
+ case FN_UNO_PAGE_STYLE:
{
String sVal;
- SwUnoCursorHelper::GetCurPageStyle( aPam, sVal );
- eRet = sVal.Len() ? beans::PropertyState_DIRECT_VALUE
- : beans::PropertyState_AMBIGUOUS_VALUE;
+ SwUnoCursorHelper::GetCurPageStyle(aPam,sVal);
+ eRet = sVal.Len() ? beans::PropertyState_DIRECT_VALUE : beans::PropertyState_AMBIGUOUS_VALUE;
+ bDone = true;
+ break;
}
- break;
- lcl_SwXParagraph_getPropertyStateDEFAULT:
- default:
- if((*ppSet) && SFX_ITEM_SET == (*ppSet)->GetItemState(rEntry.nWID, sal_False))
+
+ //UUUU DrawingLayer PropertyStyle support
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ if(*ppSet)
+ {
+ if(SFX_ITEM_SET == (*ppSet)->GetItemState(XATTR_FILLBMP_STRETCH, false)
+ || SFX_ITEM_SET == (*ppSet)->GetItemState(XATTR_FILLBMP_TILE, false))
+ {
+ eRet = beans::PropertyState_DIRECT_VALUE;
+ }
+ else
+ {
+ eRet = beans::PropertyState_AMBIGUOUS_VALUE;
+ }
+
+ bDone = true;
+ }
+ break;
+ }
+ case RES_BACKGROUND:
+ {
+ if(*ppSet)
+ {
+ if(SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(**ppSet))
+ {
+ eRet = beans::PropertyState_DIRECT_VALUE;
+ bDone = true;
+ }
+ }
+ break;
+ }
+ }
+
+ if(!bDone)
+ {
+ if((*ppSet) && SFX_ITEM_SET == (*ppSet)->GetItemState(rEntry.nWID,sal_False))
+ {
eRet = beans::PropertyState_DIRECT_VALUE;
- break;
+ }
}
+
return eRet;
}
@@ -1102,10 +1252,24 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
static_cast<cppu::OWeakObject *>(this));
}
- if (pEntry->nWID < RES_FRMATR_END)
+ const bool bBelowFrmAtrEnd(pEntry->nWID < RES_FRMATR_END);
+ const bool bDrawingLayerRange(XATTR_FILL_FIRST <= pEntry->nWID && XATTR_FILL_LAST >= pEntry->nWID);
+
+ if(bBelowFrmAtrEnd || bDrawingLayerRange)
{
SvUShortsSort aWhichIds;
- aWhichIds.Insert(pEntry->nWID);
+
+ //UUUU For FillBitmapMode two IDs have to be reset (!)
+ if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+ {
+ aWhichIds.Insert(XATTR_FILLBMP_STRETCH);
+ aWhichIds.Insert(XATTR_FILLBMP_TILE);
+ }
+ else
+ {
+ aWhichIds.Insert(pEntry->nWID);
+ }
+
if (pEntry->nWID < RES_PARATR_BEGIN)
{
aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, &aWhichIds);
@@ -1116,20 +1280,24 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
// to paragraph boundaries
SwPosition aStart( *aCursor.Start() );
SwPosition aEnd ( *aCursor.End() );
- ::std::auto_ptr<SwUnoCrsr> pTemp(
- aCursor.GetDoc()->CreateUnoCrsr(aStart, sal_False) );
+ ::std::auto_ptr<SwUnoCrsr> pTemp( aCursor.GetDoc()->CreateUnoCrsr(aStart, sal_False) );
+
if(!SwUnoCursorHelper::IsStartOfPara(*pTemp))
{
pTemp->MovePara(fnParaCurr, fnParaStart);
}
+
pTemp->SetMark();
*pTemp->GetPoint() = aEnd;
//pTemp->Exchange();
+
SwUnoCursorHelper::SelectPam(*pTemp, true);
+
if (!SwUnoCursorHelper::IsEndOfPara(*pTemp))
{
pTemp->MovePara(fnParaCurr, fnParaEnd);
}
+
pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, &aWhichIds);
}
}
@@ -1167,10 +1335,13 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
static_cast<cppu::OWeakObject *>(this));
}
- if (pEntry->nWID < RES_FRMATR_END)
+ const bool bBelowFrmAtrEnd(pEntry->nWID < RES_FRMATR_END);
+ const bool bDrawingLayerRange(XATTR_FILL_FIRST <= pEntry->nWID && XATTR_FILL_LAST >= pEntry->nWID);
+
+ if(bBelowFrmAtrEnd || bDrawingLayerRange)
{
- const SfxPoolItem& rDefItem =
- rTxtNode.GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID);
+ const SfxPoolItem& rDefItem = rTxtNode.GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID);
+
rDefItem.QueryValue(aRet, pEntry->nMemberId);
}
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index c74c0ba61572..024981084c01 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -781,32 +781,87 @@ const SwPropNameTab aPropNameTab = {
/* 0743 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("Initials")},
//UUUU names for FillAttributes from SVX; use already existing string defines from editengine
-/* 0744 UNO_NAME_FILLBMP_LOGICAL_SIZE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_LOGICAL_SIZE)},
-/* 0745 UNO_NAME_FILLBMP_OFFSET_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_X)},
-/* 0746 UNO_NAME_FILLBMP_OFFSET_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_Y)},
-/* 0747 UNO_NAME_FILLBMP_POSITION_OFFSET_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_X)},
-/* 0748 UNO_NAME_FILLBMP_POSITION_OFFSET_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_Y)},
-/* 0749 UNO_NAME_FILLBMP_RECTANGLE_POINT */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_RECTANGLE_POINT)},
-/* 0750 UNO_NAME_FILLBMP_SIZE_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_X)},
-/* 0751 UNO_NAME_FILLBMP_SIZE_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_Y)},
-/* 0752 UNO_NAME_FILLBMP_STRETCH */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_STRETCH)},
-/* 0753 UNO_NAME_FILLBMP_TILE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_TILE)},
-/* 0754 UNO_NAME_FILLBMP_MODE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_MODE)},
-/* 0755 UNO_NAME_FILLCOLOR */ {MAP_CHAR_LEN(UNO_NAME_FILLCOLOR)},
-/* 0756 UNO_NAME_FILLBACKGROUND */ {MAP_CHAR_LEN(UNO_NAME_FILLBACKGROUND)},
-/* 0757 UNO_NAME_FILLBITMAP */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAP)},
-/* 0758 UNO_NAME_FILLBITMAPNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAPNAME)},
-/* 0759 UNO_NAME_FILLBITMAPURL */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAPURL)},
-/* 0760 UNO_NAME_FILLGRADIENTSTEPCOUNT */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTSTEPCOUNT)},
-/* 0761 UNO_NAME_FILLGRADIENT */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENT)},
-/* 0762 UNO_NAME_FILLGRADIENTNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTNAME)},
-/* 0763 UNO_NAME_FILLHATCH */ {MAP_CHAR_LEN(UNO_NAME_FILLHATCH)},
-/* 0764 UNO_NAME_FILLHATCHNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLHATCHNAME)},
-/* 0765 UNO_NAME_FILLSTYLE */ {MAP_CHAR_LEN(UNO_NAME_FILLSTYLE)},
-/* 0766 UNO_NAME_FILL_TRANSPARENCE */ {MAP_CHAR_LEN(UNO_NAME_FILL_TRANSPARENCE)},
-/* 0767 UNO_NAME_FILLTRANSPARENCEGRADIENT */ {MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENT)},
-/* 0768 UNO_NAME_FILLTRANSPARENCEGRADIENTNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENTNAME)},
-/* 0769 UNO_NAME_FILLCOLOR_2 */ {MAP_CHAR_LEN(UNO_NAME_FILLCOLOR_2)}
+/* 0744 UNO_NAME_SW_FILLBMP_LOGICAL_SIZE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_LOGICAL_SIZE)},
+/* 0745 UNO_NAME_SW_FILLBMP_OFFSET_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_X)},
+/* 0746 UNO_NAME_SW_FILLBMP_OFFSET_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_Y)},
+/* 0747 UNO_NAME_SW_FILLBMP_POSITION_OFFSET_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_X)},
+/* 0748 UNO_NAME_SW_FILLBMP_POSITION_OFFSET_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_Y)},
+/* 0749 UNO_NAME_SW_FILLBMP_RECTANGLE_POINT */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_RECTANGLE_POINT)},
+/* 0750 UNO_NAME_SW_FILLBMP_SIZE_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_X)},
+/* 0751 UNO_NAME_SW_FILLBMP_SIZE_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_Y)},
+/* 0752 UNO_NAME_SW_FILLBMP_STRETCH */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_STRETCH)},
+/* 0753 UNO_NAME_SW_FILLBMP_TILE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_TILE)},
+/* 0754 UNO_NAME_SW_FILLBMP_MODE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_MODE)},
+/* 0755 UNO_NAME_SW_FILLCOLOR */ {MAP_CHAR_LEN(UNO_NAME_FILLCOLOR)},
+/* 0756 UNO_NAME_SW_FILLBACKGROUND */ {MAP_CHAR_LEN(UNO_NAME_FILLBACKGROUND)},
+/* 0757 UNO_NAME_SW_FILLBITMAP */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAP)},
+/* 0758 UNO_NAME_SW_FILLBITMAPNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAPNAME)},
+/* 0759 UNO_NAME_SW_FILLBITMAPURL */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAPURL)},
+/* 0760 UNO_NAME_SW_FILLGRADIENTSTEPCOUNT */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTSTEPCOUNT)},
+/* 0761 UNO_NAME_SW_FILLGRADIENT */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENT)},
+/* 0762 UNO_NAME_SW_FILLGRADIENTNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTNAME)},
+/* 0763 UNO_NAME_SW_FILLHATCH */ {MAP_CHAR_LEN(UNO_NAME_FILLHATCH)},
+/* 0764 UNO_NAME_SW_FILLHATCHNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLHATCHNAME)},
+/* 0765 UNO_NAME_SW_FILLSTYLE */ {MAP_CHAR_LEN(UNO_NAME_FILLSTYLE)},
+/* 0766 UNO_NAME_SW_FILL_TRANSPARENCE */ {MAP_CHAR_LEN(UNO_NAME_FILL_TRANSPARENCE)},
+/* 0767 UNO_NAME_SW_FILLTRANSPARENCEGRADIENT */ {MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENT)},
+/* 0768 UNO_NAME_SW_FILLTRANSPARENCEGRADIENTNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENTNAME)},
+/* 0769 UNO_NAME_SW_FILLCOLOR_2 */ {MAP_CHAR_LEN(UNO_NAME_FILLCOLOR_2)},
+
+/* 0770 UNO_NAME_HEADER_FILLBMP_LOGICAL_SIZE */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_LOGICAL_SIZE)},
+/* 0771 UNO_NAME_HEADER_FILLBMP_OFFSET_X */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_OFFSET_X)},
+/* 0772 UNO_NAME_HEADER_FILLBMP_OFFSET_Y */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_OFFSET_Y)},
+/* 0773 UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_X */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_POSITION_OFFSET_X)},
+/* 0774 UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_Y */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_POSITION_OFFSET_Y)},
+/* 0775 UNO_NAME_HEADER_FILLBMP_RECTANGLE_POINT */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_RECTANGLE_POINT)},
+/* 0776 UNO_NAME_HEADER_FILLBMP_SIZE_X */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_SIZE_X)},
+/* 0777 UNO_NAME_HEADER_FILLBMP_SIZE_Y */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_SIZE_Y)},
+/* 0778 UNO_NAME_HEADER_FILLBMP_STRETCH */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_STRETCH)},
+/* 0779 UNO_NAME_HEADER_FILLBMP_TILE */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_TILE)},
+/* 0780 UNO_NAME_HEADER_FILLBMP_MODE */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBMP_MODE)},
+/* 0781 UNO_NAME_HEADER_FILLCOLOR */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLCOLOR)},
+/* 0782 UNO_NAME_HEADER_FILLBACKGROUND */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBACKGROUND)},
+/* 0783 UNO_NAME_HEADER_FILLBITMAP */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBITMAP)},
+/* 0784 UNO_NAME_HEADER_FILLBITMAPNAME */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBITMAPNAME)},
+/* 0785 UNO_NAME_HEADER_FILLBITMAPURL */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLBITMAPURL)},
+/* 0786 UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLGRADIENTSTEPCOUNT)},
+/* 0787 UNO_NAME_HEADER_FILLGRADIENT */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLGRADIENT)},
+/* 0788 UNO_NAME_HEADER_FILLGRADIENTNAME */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLGRADIENTNAME)},
+/* 0789 UNO_NAME_HEADER_FILLHATCH */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLHATCH)},
+/* 0790 UNO_NAME_HEADER_FILLHATCHNAME */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLHATCHNAME)},
+/* 0791 UNO_NAME_HEADER_FILLSTYLE */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLSTYLE)},
+/* 0792 UNO_NAME_HEADER_FILL_TRANSPARENCE */ {MAP_CHAR_LEN("Header" UNO_NAME_FILL_TRANSPARENCE)},
+/* 0793 UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENT */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLTRANSPARENCEGRADIENT)},
+/* 0794 UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENTNAME */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLTRANSPARENCEGRADIENTNAME)},
+/* 0795 UNO_NAME_HEADER_FILLCOLOR_2 */ {MAP_CHAR_LEN("Header" UNO_NAME_FILLCOLOR_2)},
+
+/* 0776 UNO_NAME_FOOTER_FILLBMP_LOGICAL_SIZE */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_LOGICAL_SIZE)},
+/* 0777 UNO_NAME_FOOTER_FILLBMP_OFFSET_X */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_OFFSET_X)},
+/* 0778 UNO_NAME_FOOTER_FILLBMP_OFFSET_Y */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_OFFSET_Y)},
+/* 0779 UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_X */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_POSITION_OFFSET_X)},
+/* 0780 UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_Y */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_POSITION_OFFSET_Y)},
+/* 0781 UNO_NAME_FOOTER_FILLBMP_RECTANGLE_POINT */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_RECTANGLE_POINT)},
+/* 0782 UNO_NAME_FOOTER_FILLBMP_SIZE_X */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_SIZE_X)},
+/* 0783 UNO_NAME_FOOTER_FILLBMP_SIZE_Y */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_SIZE_Y)},
+/* 0784 UNO_NAME_FOOTER_FILLBMP_STRETCH */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_STRETCH)},
+/* 0785 UNO_NAME_FOOTER_FILLBMP_TILE */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_TILE)},
+/* 0786 UNO_NAME_FOOTER_FILLBMP_MODE */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBMP_MODE)},
+/* 0787 UNO_NAME_FOOTER_FILLCOLOR */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLCOLOR)},
+/* 0788 UNO_NAME_FOOTER_FILLBACKGROUND */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBACKGROUND)},
+/* 0789 UNO_NAME_FOOTER_FILLBITMAP */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBITMAP)},
+/* 0790 UNO_NAME_FOOTER_FILLBITMAPNAME */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBITMAPNAME)},
+/* 0791 UNO_NAME_FOOTER_FILLBITMAPURL */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLBITMAPURL)},
+/* 0792 UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLGRADIENTSTEPCOUNT)},
+/* 0793 UNO_NAME_FOOTER_FILLGRADIENT */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLGRADIENT)},
+/* 0794 UNO_NAME_FOOTER_FILLGRADIENTNAME */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLGRADIENTNAME)},
+/* 0795 UNO_NAME_FOOTER_FILLHATCH */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLHATCH)},
+/* 0796 UNO_NAME_FOOTER_FILLHATCHNAME */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLHATCHNAME)},
+/* 0797 UNO_NAME_FOOTER_FILLSTYLE */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLSTYLE)},
+/* 0798 UNO_NAME_FOOTER_FILL_TRANSPARENCE */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILL_TRANSPARENCE)},
+/* 0799 UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENT */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLTRANSPARENCEGRADIENT)},
+/* 0800 UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENTNAME */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLTRANSPARENCEGRADIENTNAME)},
+/* 0801 UNO_NAME_FOOTER_FILLCOLOR_2 */ {MAP_CHAR_LEN("Footer" UNO_NAME_FILLCOLOR_2)}
+
};
const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index df0a4a10872d..ca2ceeb8c990 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -2167,29 +2167,24 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
OUString uTmp;
pData->aVal >>= uTmp;
String sStyleName;
- SwStyleNameMapper::FillUIName(uTmp, sStyleName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True );
+ SwStyleNameMapper::FillUIName( uTmp, sStyleName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True );
const SwTxtFmtColls* pColls = pDocShell->GetDoc()->GetTxtFmtColls();
const sal_uInt16 nCount = pColls->Count();
- for(sal_uInt16 k = 0; k < nCount; ++k)
+ for ( sal_uInt16 k = 0; k < nCount; ++k )
{
- SwTxtFmtColl &rTxtColl = *((*pColls)[k]);
- if(rTxtColl.IsDefault())
+ SwTxtFmtColl &rTxtColl = *( ( *pColls )[k] );
+ if ( rTxtColl.IsDefault() )
continue;
- //if(rTxtColl.GetOutlineLevel() == nIndex && //#outline level,removed by zhaojianwei
- // rTxtColl.GetName() != sStyleName)
- // rTxtColl..SetOutlineLevel(NO_NUMBERING);
- //else if(rTxtColl.GetName() == sStyleName)
- // rTxtColl.SetOutlineLevel(sal_Int8(nIndex));
- if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle() && //add by zhaojianwei
- rTxtColl.GetAssignedOutlineStyleLevel() == nIndex &&
- rTxtColl.GetName() != sStyleName )
+ if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle()
+ && rTxtColl.GetAssignedOutlineStyleLevel() == nIndex
+ && rTxtColl.GetName() != sStyleName )
{
rTxtColl.DeleteAssignmentToListLevelOfOutlineStyle();
}
else if ( rTxtColl.GetName() == sStyleName )
{
rTxtColl.AssignToListLevelOfOutlineStyle( nIndex );
- } //<-end,,zhaojianwei,
+ }
}
}
break;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index e6eb8cce0fe3..45bc45b75cec 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -76,12 +74,14 @@
#include <numrule.hxx>
//UUUU
-#include <unobrushitemhelper.hxx>
+#include <svx/unobrushitemhelper.hxx>
#include <editeng/unoipset.hxx>
#include <editeng/memberids.hrc>
#include <svx/unoshape.hxx>
#include <svx/xflbstit.hxx>
#include <svx/xflbmtit.hxx>
+#include <swunohelper.hxx>
+#include <svx/xbtmpit.hxx>
#include <boost/shared_ptr.hpp>
@@ -124,47 +124,6 @@ using ::rtl::OUString;
*
******************************************************************************/
-//convert FN_... to RES_ in header and footer itemset
-sal_uInt16 lcl_ConvertFNToRES(sal_uInt16 nFNId)
-{
- sal_uInt16 nRes = USHRT_MAX;
- switch(nFNId)
- {
- case FN_UNO_FOOTER_ON:
- case FN_UNO_HEADER_ON:
- break;
- case FN_UNO_FOOTER_BACKGROUND:
- case FN_UNO_HEADER_BACKGROUND: nRes = RES_BACKGROUND;
- break;
- case FN_UNO_FOOTER_BOX:
- case FN_UNO_HEADER_BOX: nRes = RES_BOX;
- break;
- case FN_UNO_FOOTER_LR_SPACE:
- case FN_UNO_HEADER_LR_SPACE: nRes = RES_LR_SPACE;
- break;
- case FN_UNO_FOOTER_SHADOW:
- case FN_UNO_HEADER_SHADOW: nRes = RES_SHADOW;
- break;
- case FN_UNO_FOOTER_BODY_DISTANCE:
- case FN_UNO_HEADER_BODY_DISTANCE: nRes = RES_UL_SPACE;
- break;
- case FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE:
- case FN_UNO_HEADER_IS_DYNAMIC_DISTANCE: nRes = SID_ATTR_PAGE_DYNAMIC;
- break;
- case FN_UNO_FOOTER_SHARE_CONTENT:
- case FN_UNO_HEADER_SHARE_CONTENT: nRes = SID_ATTR_PAGE_SHARED;
- break;
- case FN_UNO_FOOTER_HEIGHT:
- case FN_UNO_HEADER_HEIGHT: nRes = SID_ATTR_PAGE_SIZE;
- break;
- case FN_UNO_FOOTER_EAT_SPACING:
- case FN_UNO_HEADER_EAT_SPACING: nRes = RES_HEADER_FOOTER_EAT_SPACING;
- break;
- }
- return nRes;
-
-}
-
SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum ( SfxStyleFamily eFamily )
{
switch ( eFamily )
@@ -1737,99 +1696,138 @@ void SwXStyle::ApplyDescriptorProperties()
/*-- 18.04.01 13:07:27---------------------------------------------------
-----------------------------------------------------------------------*/
-struct SwStyleBase_Impl
+class SwStyleBase_Impl
{
- SwDoc& rDoc;
+private:
+ SwDoc& mrDoc;
+ const SwPageDesc* mpOldPageDesc;
+ rtl::Reference< SwDocStyleSheet > mxNewBase;
+ SfxItemSet* mpItemSet;
+ const String& mrStyleName;
+ sal_uInt16 mnPDescPos;
+ const SwAttrSet* mpParentStyle;
- const SwPageDesc* pOldPageDesc;
+public:
+ SwStyleBase_Impl(
+ SwDoc& rSwDoc,
+ const String& rName,
+ const SwAttrSet* pParentStyle)
+ : mrDoc(rSwDoc),
+ mpOldPageDesc(0),
+ mxNewBase(),
+ mpItemSet(0),
+ mrStyleName(rName),
+ mnPDescPos(0xffff),
+ mpParentStyle(pParentStyle)
+ {
+ }
- rtl::Reference< SwDocStyleSheet > mxNewBase;
- SfxItemSet* pItemSet;
+ ~SwStyleBase_Impl()
+ {
+ delete mpItemSet;
+ }
- const String& rStyleName;
- sal_uInt16 nPDescPos;
+ rtl::Reference< SwDocStyleSheet >& getNewBase()
+ {
+ return mxNewBase;
+ }
- SwStyleBase_Impl(SwDoc& rSwDoc, const String& rName) :
- rDoc(rSwDoc),
- pOldPageDesc(0),
- pItemSet(0),
- rStyleName(rName),
- nPDescPos(0xffff)
- {}
+ void setNewBase(SwDocStyleSheet* pNew)
+ {
+ mxNewBase = pNew;
+ }
- ~SwStyleBase_Impl(){ delete pItemSet; }
+ sal_Bool HasItemSet()
+ {
+ return mxNewBase.is();
+ }
+
+ SfxItemSet* replaceItemSet(SfxItemSet* pNew)
+ {
+ SfxItemSet* pRetval = mpItemSet;
+ mpItemSet = pNew;
+ return pRetval;
+ }
- sal_Bool HasItemSet() {return mxNewBase.is();}
SfxItemSet& GetItemSet()
+ {
+ DBG_ASSERT(mxNewBase.is(), "no SwDocStyleSheet available");
+
+ if(!mpItemSet)
{
- DBG_ASSERT(mxNewBase.is(), "no SwDocStyleSheet available");
- if(!pItemSet)
- pItemSet = new SfxItemSet(mxNewBase->GetItemSet());
- return *pItemSet;
+ mpItemSet = new SfxItemSet(mxNewBase->GetItemSet());
+
+ //UUUU set parent style to have the correct XFillStyle setting as XFILL_NONE
+ if(!mpItemSet->GetParent() && mpParentStyle)
+ {
+ mpItemSet->SetParent(mpParentStyle);
+ }
}
- const SwPageDesc& GetOldPageDesc();
+ return *mpItemSet;
+ }
+
+ const SwPageDesc& GetOldPageDesc();
};
/* -----------------------------25.04.01 12:44--------------------------------
---------------------------------------------------------------------------*/
const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
{
- if(!pOldPageDesc)
+ if(!mpOldPageDesc)
{
sal_uInt16 i;
- sal_uInt16 nPDescCount = rDoc.GetPageDescCnt();
+ sal_uInt16 nPDescCount = mrDoc.GetPageDescCnt();
for(i = 0; i < nPDescCount; i++)
{
const SwPageDesc& rDesc =
- const_cast<const SwDoc &>(rDoc).GetPageDesc( i );
- if(rDesc.GetName() == rStyleName)
+ const_cast<const SwDoc &>(mrDoc).GetPageDesc( i );
+ if(rDesc.GetName() == mrStyleName)
{
- pOldPageDesc = & rDesc;
- nPDescPos = i;
+ mpOldPageDesc = & rDesc;
+ mnPDescPos = i;
break;
}
}
- if(!pOldPageDesc)
+ if(!mpOldPageDesc)
{
for(i = RC_POOLPAGEDESC_BEGIN; i <= STR_POOLPAGE_LANDSCAPE; ++i)
{
const String aFmtName(SW_RES(i));
- if(aFmtName == rStyleName)
+ if(aFmtName == mrStyleName)
{
- pOldPageDesc = rDoc.GetPageDescFromPool( static_cast< sal_uInt16 >(RES_POOLPAGE_BEGIN + i - RC_POOLPAGEDESC_BEGIN) );
+ mpOldPageDesc = mrDoc.GetPageDescFromPool( static_cast< sal_uInt16 >(RES_POOLPAGE_BEGIN + i - RC_POOLPAGEDESC_BEGIN) );
break;
}
}
for(i = 0; i < nPDescCount + 1; i++)
{
const SwPageDesc& rDesc =
- const_cast<const SwDoc &>(rDoc).GetPageDesc( i );
- if(rDesc.GetName() == rStyleName)
+ const_cast<const SwDoc &>(mrDoc).GetPageDesc( i );
+ if(rDesc.GetName() == mrStyleName)
{
- nPDescPos = i;
+ mnPDescPos = i;
break;
}
}
}
}
- return *pOldPageDesc;
+ return *mpOldPageDesc;
}
/* -----------------------------19.04.01 09:44--------------------------------
---------------------------------------------------------------------------*/
-void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
- const SfxItemPropertySet& rPropSet,
- const uno::Any& rValue,
- SwStyleBase_Impl& rBase,
- SfxStyleSheetBasePool* pBasePool,
- SwDoc* pDoc,
- SfxStyleFamily eFamily)
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-
+void lcl_SetStyleProperty(
+ const SfxItemPropertySimpleEntry& rEntry,
+ const SfxItemPropertySet& rPropSet,
+ const uno::Any& rValue,
+ SwStyleBase_Impl& rBase,
+ SfxStyleSheetBasePool* pBasePool,
+ SwDoc* pDoc,
+ SfxStyleFamily eFamily)
+throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
//UUUU adapted switch logic to a more readable state; removed goto's and made
// execution of standard setting of proerty in ItemSet dependent of this variable
@@ -1870,18 +1868,18 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
switch(rEntry.nWID)
{
- case XATTR_FILLBITMAP:
case XATTR_FILLGRADIENT:
case XATTR_FILLHATCH:
+ case XATTR_FILLBITMAP:
case XATTR_FILLFLOATTRANSPARENCE:
// not yet needed; activate when LineStyle support may be added
// case XATTR_LINESTART:
// case XATTR_LINEEND:
// case XATTR_LINEDASH:
{
- //UUUU add set commands for FillName items
if(MID_NAME == nMemberId)
{
+ //UUUU add set commands for FillName items
OUString aTempName;
SfxItemSet& rStyleSet = rBase.GetItemSet();
@@ -1893,6 +1891,20 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
SvxShape::SetFillAttribute(rEntry.nWID, aTempName, rStyleSet);
bDone = true;
}
+ else if(MID_GRAFURL == nMemberId)
+ {
+ if(XATTR_FILLBITMAP == rEntry.nWID)
+ {
+ //UUUU Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
+ const Graphic aNullGraphic;
+ SfxItemSet& rStyleSet = rBase.GetItemSet();
+ XFillBitmapItem aXFillBitmapItem(rStyleSet.GetPool(), aNullGraphic);
+
+ aXFillBitmapItem.PutValue(aValue, nMemberId);
+ rStyleSet.Put(aXFillBitmapItem);
+ bDone = true;
+ }
+ }
break;
}
@@ -1900,7 +1912,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
//UUUU
SfxItemSet& rStyleSet = rBase.GetItemSet();
- const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet));
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet, RES_BACKGROUND));
SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
aChangedBrushItem.PutValue(aValue, nMemberId);
@@ -2053,7 +2065,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
aSetRule.Set( i, &aFmt );
}
}
- rBase.mxNewBase->SetNumRule(aSetRule);
+ rBase.getNewBase()->SetNumRule(aSetRule);
}
}
else
@@ -2062,34 +2074,25 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
bDone = true;
break;
}
- // case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
- //{
- // sal_Int8 nLevel = 0;
- // if( aValue >>= nLevel )
- // rBase.mxNewBase->GetCollection()->SetOutlineLevel( nLevel );
- // else
- // rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );
- //
- // bDone = true;
- // break;
- //}
- case RES_PARATR_OUTLINELEVEL: //add by zahojianwei
+
+ case RES_PARATR_OUTLINELEVEL:
{
sal_Int16 nLevel = 0;
aValue >>= nLevel;
if( 0 <= nLevel && nLevel <= MAXLEVEL)
- rBase.mxNewBase->GetCollection()->SetAttrOutlineLevel( nLevel );
+ rBase.getNewBase()->GetCollection()->SetAttrOutlineLevel( nLevel );
bDone = true;
- break; //<-end,zhaojianwei
+ break;
}
+
case FN_UNO_FOLLOW_STYLE:
{
OUString sTmp;
aValue >>= sTmp;
String aString;
SwStyleNameMapper::FillUIName(sTmp, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True ) ;
- rBase.mxNewBase->SetFollow( aString );
+ rBase.getNewBase()->SetFollow( aString );
bDone = true;
break;
@@ -2151,9 +2154,9 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
sal_Bool bAuto = *(sal_Bool*)aValue.getValue();
if(SFX_STYLE_FAMILY_PARA == eFamily)
- rBase.mxNewBase->GetCollection()->SetAutoUpdateFmt(bAuto);
+ rBase.getNewBase()->GetCollection()->SetAutoUpdateFmt(bAuto);
else if(SFX_STYLE_FAMILY_FRAME == eFamily)
- rBase.mxNewBase->GetFrmFmt()->SetAutoUpdateFmt(bAuto);
+ rBase.getNewBase()->GetFrmFmt()->SetAutoUpdateFmt(bAuto);
bDone = true;
break;
@@ -2214,7 +2217,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case FN_UNO_CATEGORY:
{
- if(!rBase.mxNewBase->IsUserDefined())
+ if(!rBase.getNewBase()->IsUserDefined())
throw lang::IllegalArgumentException();
short nSet = 0;
aValue >>= nSet;
@@ -2243,7 +2246,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
default: throw lang::IllegalArgumentException();
}
- rBase.mxNewBase->SetMask( nId|SFXSTYLEBIT_USERDEF );
+ rBase.getNewBase()->SetMask( nId|SFXSTYLEBIT_USERDEF );
bDone = true;
break;
}
@@ -2345,9 +2348,9 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
// --> OD 2006-10-18 #i70223#
if ( SFX_STYLE_FAMILY_PARA == eFamily &&
rEntry.nWID == RES_PARATR_NUMRULE &&
- rBase.mxNewBase.is() && rBase.mxNewBase->GetCollection() &&
- //rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei
- rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei
+ rBase.getNewBase().is() && rBase.getNewBase()->GetCollection() &&
+ //rBase.getNewBase()->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei
+ rBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei
{
OUString sNewNumberingRuleName;
aValue >>= sNewNumberingRuleName;
@@ -2355,8 +2358,8 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
if ( sNewNumberingRuleName.getLength() == 0 || sTmp != pDoc->GetOutlineNumRule()->GetName() )
{
// delete assignment to list level of outline style.
- //rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
- rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,adde by zhaojianwei
+ //rBase.getNewBase()->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
+ rBase.getNewBase()->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,adde by zhaojianwei
}
}
}
@@ -2367,31 +2370,34 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
void SAL_CALL SwXStyle::SetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
- throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
+throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
if ( !m_pDoc )
throw uno::RuntimeException();
+
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE;
+
switch(eFamily)
{
case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE ;break;
case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE ;break;
case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE ;break;
- default:
- ;
+ default: ;
}
+
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
if(rPropertyNames.getLength() != rValues.getLength())
+ {
throw lang::IllegalArgumentException();
+ }
const OUString* pNames = rPropertyNames.getConstArray();
const uno::Any* pValues = rValues.getConstArray();
+ SwStyleBase_Impl aBaseImpl(*m_pDoc, sStyleName, &GetDoc()->GetDfltTxtFmtColl()->GetAttrSet()); //UUUU add pDfltTxtFmtColl as parent
- SwStyleBase_Impl aBaseImpl(*m_pDoc, sStyleName);
if(pBasePool)
{
sal_uInt16 nSaveMask = pBasePool->GetSearchMask();
@@ -2399,43 +2405,50 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl(
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
pBasePool->SetSearchMask(eFamily, nSaveMask );
DBG_ASSERT(pBase, "where is the style?" );
+
if(pBase)
- aBaseImpl.mxNewBase = new SwDocStyleSheet(*(SwDocStyleSheet*)pBase);
+ aBaseImpl.setNewBase(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase));
else
throw uno::RuntimeException();
}
for(sal_Int16 nProp = 0; nProp < rPropertyNames.getLength(); nProp++)
{
- const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp]);
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(pNames[nProp]);
if(!pEntry ||
(!bIsConditional && pNames[nProp].equalsAsciiL(SW_PROP_NAME(UNO_NAME_PARA_STYLE_CONDITIONS))))
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
- if(aBaseImpl.mxNewBase.is())
+
+ if(aBaseImpl.getNewBase().is())
{
- lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl,
- pBasePool, m_pDoc, eFamily);
+ lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, pBasePool, m_pDoc, eFamily);
}
else if(bIsDescriptor)
{
if(!pPropImpl->SetProperty(pNames[nProp], pValues[nProp]))
+ {
throw lang::IllegalArgumentException();
+ }
}
else
+ {
throw uno::RuntimeException();
+ }
}
+
if(aBaseImpl.HasItemSet())
- aBaseImpl.mxNewBase->SetItemSet(aBaseImpl.GetItemSet());
+ {
+ aBaseImpl.getNewBase()->SetItemSet(aBaseImpl.GetItemSet());
+ }
}
void SwXStyle::setPropertyValues(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
+throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2455,12 +2468,14 @@ void SwXStyle::setPropertyValues(
}
-uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
- const SfxItemPropertySet& rPropSet,
- SwStyleBase_Impl& rBase,
- SfxStyleSheetBase* pBase,
- SfxStyleFamily eFamily,
- SwDoc *pDoc) throw(uno::RuntimeException)
+uno::Any lcl_GetStyleProperty(
+ const SfxItemPropertySimpleEntry& rEntry,
+ const SfxItemPropertySet& rPropSet,
+ SwStyleBase_Impl& rBase,
+ SfxStyleSheetBase* pBase,
+ SfxStyleFamily eFamily,
+ SwDoc *pDoc)
+throw(uno::RuntimeException)
{
uno::Any aRet;
@@ -2480,9 +2495,9 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
else if(pBase)
{
- if(!rBase.mxNewBase.is())
+ if(!rBase.getNewBase().is())
{
- rBase.mxNewBase = new SwDocStyleSheet( *(SwDocStyleSheet*)pBase );
+ rBase.setNewBase(new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ));
}
//UUUU
@@ -2516,7 +2531,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
{
- const SwNumRule* pRule = rBase.mxNewBase->GetNumRule();
+ const SwNumRule* pRule = rBase.getNewBase()->GetNumRule();
DBG_ASSERT(pRule, "Wo ist die NumRule?");
uno::Reference< container::XIndexReplace > xRules = new SwXNumberingRules(*pRule);
@@ -2528,7 +2543,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
//case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
//{
// DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
- // sal_uInt8 nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
+ // sal_uInt8 nLevel = rBase.getNewBase()->GetCollection()->GetOutlineLevel();
// if( nLevel != NO_NUMBERING )
// aRet <<= static_cast<sal_Int8>( nLevel );
// bDone = true;
@@ -2537,7 +2552,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
case RES_PARATR_OUTLINELEVEL: //add by zahojianwei
{
DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
- int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
+ int nLevel = rBase.getNewBase()->GetCollection()->GetAttrOutlineLevel();
aRet <<= static_cast<sal_Int16>( nLevel );
bDone = true;
@@ -2547,7 +2562,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
String aString;
- SwStyleNameMapper::FillProgName(rBase.mxNewBase->GetFollow(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True);
+ SwStyleNameMapper::FillProgName(rBase.getNewBase()->GetFollow(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True);
aRet <<= OUString( aString );
bDone = true;
break;
@@ -2578,9 +2593,9 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
sal_Bool bAuto = sal_False;
if(SFX_STYLE_FAMILY_PARA == eFamily)
- bAuto = rBase.mxNewBase->GetCollection()->IsAutoUpdateFmt();
+ bAuto = rBase.getNewBase()->GetCollection()->IsAutoUpdateFmt();
else if(SFX_STYLE_FAMILY_FRAME == eFamily)
- bAuto = rBase.mxNewBase->GetFrmFmt()->IsAutoUpdateFmt();
+ bAuto = rBase.getNewBase()->GetFrmFmt()->IsAutoUpdateFmt();
aRet.setValue(&bAuto, ::getBooleanCppuType());
bDone = true;
@@ -2588,7 +2603,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case FN_UNO_DISPLAY_NAME:
{
- OUString sName(rBase.mxNewBase->GetDisplayName());
+ OUString sName(rBase.getNewBase()->GetDisplayName());
aRet <<= sName;
bDone = true;
@@ -2629,7 +2644,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case FN_UNO_CATEGORY:
{
- sal_uInt16 nPoolId = rBase.mxNewBase->GetCollection()->GetPoolFmtId();
+ sal_uInt16 nPoolId = rBase.getNewBase()->GetCollection()->GetPoolFmtId();
short nRet = -1;
switch ( COLL_GET_RANGE_BITS & nPoolId )
@@ -2660,7 +2675,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case SID_SWREGISTER_COLLECTION:
{
- const SwPageDesc *pPageDesc = rBase.mxNewBase->GetPageDesc();
+ const SwPageDesc *pPageDesc = rBase.getNewBase()->GetPageDesc();
const SwTxtFmtColl* pCol = 0;
String aString;
if( pPageDesc )
@@ -2677,7 +2692,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
//UUUU
const SfxItemSet& rSet = rBase.GetItemSet();
- const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet));
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
if(!aOriginalBrushItem.QueryValue(aRet, nMemberId))
{
@@ -2772,35 +2787,38 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
- const uno::Sequence< OUString > & rPropertyNames )
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+ const uno::Sequence< OUString > & rPropertyNames )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
if ( !m_pDoc )
throw uno::RuntimeException();
+
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE;
+
switch(eFamily)
{
case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE ;break;
case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE ;break;
case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE ;break;
- default:
- ;
+ default: ;
}
+
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
-
const OUString* pNames = rPropertyNames.getConstArray();
uno::Sequence< uno::Any > aRet(rPropertyNames.getLength());
uno::Any* pRet = aRet.getArray();
- SwStyleBase_Impl aBase(*m_pDoc, sStyleName);
+ SwStyleBase_Impl aBase(*m_pDoc, sStyleName, &GetDoc()->GetDfltTxtFmtColl()->GetAttrSet()); //UUUU add pDfltTxtFmtColl as parent
SfxStyleSheetBase* pBase = 0;
+
for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++)
{
const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp]);
if(!pEntry ||
(!bIsConditional && pNames[nProp].equalsAsciiL(SW_PROP_NAME(UNO_NAME_PARA_STYLE_CONDITIONS))))
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
+
if(pBasePool)
{
if(!pBase)
@@ -2810,6 +2828,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
pBase = pBasePool->Find(sStyleName);
pBasePool->SetSearchMask(eFamily, nSaveMask );
}
+
pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, eFamily, GetDoc() );
}
else if(bIsDescriptor)
@@ -2869,7 +2888,8 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXStyle::getPropertyValues(
- const uno::Sequence< OUString >& rPropertyNames ) throw(uno::RuntimeException)
+ const uno::Sequence< OUString >& rPropertyNames )
+throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Sequence< uno::Any > aValues;
@@ -2895,7 +2915,7 @@ uno::Sequence< uno::Any > SwXStyle::getPropertyValues(
void SwXStyle::addPropertiesChangeListener(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
- throw(uno::RuntimeException)
+throw(uno::RuntimeException)
{
}
/*-- 18.04.01 13:07:30---------------------------------------------------
@@ -2903,7 +2923,7 @@ void SwXStyle::addPropertiesChangeListener(
-----------------------------------------------------------------------*/
void SwXStyle::removePropertiesChangeListener(
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
- throw(uno::RuntimeException)
+throw(uno::RuntimeException)
{
}
/*-- 18.04.01 13:07:30---------------------------------------------------
@@ -2912,29 +2932,29 @@ void SwXStyle::removePropertiesChangeListener(
void SwXStyle::firePropertiesChangeEvent(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
- throw(uno::RuntimeException)
+throw(uno::RuntimeException)
{
}
/*-- 17.12.98 08:26:53---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
- throw( beans::UnknownPropertyException,
- beans::PropertyVetoException,
- lang::IllegalArgumentException,
- lang::WrappedTargetException,
- uno::RuntimeException)
+void SwXStyle::setPropertyValue(
+ const OUString& rPropertyName,
+ const uno::Any& rValue)
+throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
const uno::Sequence<uno::Any> aValues(&rValue, 1);
+
SetPropertyValues_Impl( aProperties, aValues );
}
/*-- 17.12.98 08:26:53---------------------------------------------------
-----------------------------------------------------------------------*/
-uno::Any SwXStyle::getPropertyValue(const OUString& rPropertyName)
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+uno::Any SwXStyle::getPropertyValue(
+ const OUString& rPropertyName)
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
@@ -2944,36 +2964,40 @@ uno::Any SwXStyle::getPropertyValue(const OUString& rPropertyName)
/*-- 17.12.98 08:26:53---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::addPropertyChangeListener(const OUString& /*rPropertyName*/,
+void SwXStyle::addPropertyChangeListener(
+ const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
/*-- 17.12.98 08:26:54---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::removePropertyChangeListener(const OUString& /*rPropertyName*/,
+void SwXStyle::removePropertyChangeListener(
+ const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
/*-- 17.12.98 08:26:54---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::addVetoableChangeListener(const OUString& /*rPropertyName*/,
+void SwXStyle::addVetoableChangeListener(
+ const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
/*-- 17.12.98 08:26:54---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::removeVetoableChangeListener(const OUString& /*rPropertyName*/,
+void SwXStyle::removeVetoableChangeListener(
+ const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
@@ -2981,11 +3005,11 @@ void SwXStyle::removeVetoableChangeListener(const OUString& /*rPropertyName*/,
/*-- 08.03.99 10:50:26---------------------------------------------------
-----------------------------------------------------------------------*/
-beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
- throw( beans::UnknownPropertyException, uno::RuntimeException )
+beans::PropertyState SwXStyle::getPropertyState(
+ const OUString& rPropertyName)
+throw( beans::UnknownPropertyException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
-
uno::Sequence< OUString > aNames(1);
OUString* pNames = aNames.getArray();
pNames[0] = rPropertyName;
@@ -2995,13 +3019,15 @@ beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
/*-- 08.03.99 10:50:27---------------------------------------------------
-----------------------------------------------------------------------*/
+
uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
const uno::Sequence< OUString >& rPropertyNames)
- throw( beans::UnknownPropertyException, uno::RuntimeException )
+throw( beans::UnknownPropertyException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength());
beans::PropertyState* pStates = aRet.getArray();
+
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily );
@@ -3013,75 +3039,110 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
const OUString* pNames = rPropertyNames.getConstArray();
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE;
+
switch(eFamily)
{
case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE ;break;
case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE; break;
case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE ;break;
- default:
- ;
+ default: ;
}
+
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
+ const SfxItemSet& rSet = xStyle->GetItemSet();
- SfxItemSet aSet = xStyle->GetItemSet();
for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++)
{
const String& rPropName = pNames[i];
const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( rPropName);
+ bool bDone(false);
+
if(!pEntry)
+ {
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
- if( FN_UNO_NUM_RULES == pEntry->nWID ||
- FN_UNO_FOLLOW_STYLE == pEntry->nWID )
+ }
+
+ if( FN_UNO_NUM_RULES == pEntry->nWID || FN_UNO_FOLLOW_STYLE == pEntry->nWID )
{
+ // handle NumRules first, done
pStates[i] = beans::PropertyState_DIRECT_VALUE;
+ bDone = true;
}
- // else if( FN_UNO_DEFAULT_OUTLINE_LEVEL == pEntry->nWID ) //#outline level,removed by zahojianwei
- // {
- // pStates[i] =
- // ( xStyle->GetCollection()->GetOutlineLevel()
- // == NO_NUMBERING )
- // ? beans::PropertyState_DEFAULT_VALUE
- // : beans::PropertyState_DIRECT_VALUE;
- // } //<-end,zhaojianwei
- else if(SFX_STYLE_FAMILY_PAGE == eFamily &&
- (rPropName.EqualsAscii("Header", 0, 6)
- || rPropName.EqualsAscii("Footer", 0, 6)))
+
+ // allow to retarget the SfxItemSet working on, default correctly. Only
+ // use pSourceSet below this point (except in header/footer processing)
+ const SfxItemSet* pSourceSet = &rSet;
+
+ if(!bDone)
{
- sal_uInt16 nResId = lcl_ConvertFNToRES(pEntry->nWID);
- sal_Bool bFooter = rPropName.EqualsAscii("Footer", 0, 6);
- const SvxSetItem* pSetItem;
- if(SFX_ITEM_SET == aSet.GetItemState(
- bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
- sal_False, (const SfxPoolItem**)&pSetItem))
+ // check for Header/Footer entry
+ const bool bHeader(SFX_STYLE_FAMILY_PAGE == eFamily && rPropName.EqualsAscii("Header", 0, 6));
+ const bool bFooter(SFX_STYLE_FAMILY_PAGE == eFamily && rPropName.EqualsAscii("Footer", 0, 6));
+
+ if(bHeader || bFooter)
{
- const SfxItemSet& rSet = pSetItem->GetItemSet();
- SfxItemState eState = rSet.GetItemState(nResId, sal_False);
- if(SFX_ITEM_SET == eState)
- pStates[i] = beans::PropertyState_DIRECT_VALUE;
+ const SvxSetItem* pSetItem;
+
+ if(SFX_ITEM_SET == rSet.GetItemState(
+ bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
+ sal_False,
+ (const SfxPoolItem**)&pSetItem))
+ {
+ // retarget the SfxItemSet to the HeaderFooter SfxSetItem's SfxItenSet
+ pSourceSet = &pSetItem->GetItemSet();
+ }
else
- pStates[i] = beans::PropertyState_DEFAULT_VALUE;
+ {
+ // if no SetItem, value is ambigous and we are done
+ pStates[i] = beans::PropertyState_AMBIGUOUS_VALUE;
+ bDone = true;
+ }
+ }
+ }
+
+ if(!bDone && OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+ {
+ //UUUU
+ if(SFX_ITEM_SET == pSourceSet->GetItemState(XATTR_FILLBMP_STRETCH, false)
+ || SFX_ITEM_SET == pSourceSet->GetItemState(XATTR_FILLBMP_TILE, false))
+ {
+ pStates[i] = beans::PropertyState_DIRECT_VALUE;
}
else
+ {
pStates[i] = beans::PropertyState_AMBIGUOUS_VALUE;
+ }
+
+ bDone = true;
}
- else
+
+ //UUUU for FlyFrames we need to mark all properties from type RES_BACKGROUND
+ // as beans::PropertyState_DIRECT_VALUE to let users of this property call
+ // getPropertyValue where the member properties will be mapped from the
+ // fill attributes to the according SvxBrushItem entries
+ if(!bDone && RES_BACKGROUND == pEntry->nWID
+ && SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(*pSourceSet))
{
- pStates[i] = pPropSet->getPropertyState(*pEntry, aSet);
- if( SFX_STYLE_FAMILY_PAGE == eFamily &&
- SID_ATTR_PAGE_SIZE == pEntry->nWID &&
- beans::PropertyState_DIRECT_VALUE == pStates[i] )
+ pStates[i] = beans::PropertyState_DIRECT_VALUE;
+ bDone = true;
+ }
+
+ if(!bDone)
+ {
+ pStates[i] = pPropSet->getPropertyState(*pEntry, *pSourceSet);
+
+ if(SFX_STYLE_FAMILY_PAGE == eFamily && SID_ATTR_PAGE_SIZE == pEntry->nWID && beans::PropertyState_DIRECT_VALUE == pStates[i])
{
- const SvxSizeItem& rSize =
- static_cast < const SvxSizeItem& >(
- aSet.Get(SID_ATTR_PAGE_SIZE) );
+ const SvxSizeItem& rSize = static_cast <const SvxSizeItem&>( rSet.Get(SID_ATTR_PAGE_SIZE));
sal_uInt8 nMemberId = pEntry->nMemberId & 0x7f;
- if( ( LONG_MAX == rSize.GetSize().Width() &&
- (MID_SIZE_WIDTH == nMemberId ||
- MID_SIZE_SIZE == nMemberId ) ) ||
- ( LONG_MAX == rSize.GetSize().Height() &&
- MID_SIZE_HEIGHT == nMemberId ) )
+
+ if((LONG_MAX == rSize.GetSize().Width() &&
+ (MID_SIZE_WIDTH == nMemberId ||
+ MID_SIZE_SIZE == nMemberId)) ||
+ (LONG_MAX == rSize.GetSize().Height() &&
+ MID_SIZE_HEIGHT == nMemberId))
{
pStates[i] = beans::PropertyState_DEFAULT_VALUE;
}
@@ -3090,24 +3151,31 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
}
}
else
+ {
throw uno::RuntimeException();
+ }
}
else
+ {
throw uno::RuntimeException();
+ }
+
return aRet;
}
/*-- 08.03.99 10:50:27---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::setPropertyToDefault(const OUString& rPropertyName)
- throw( beans::UnknownPropertyException, uno::RuntimeException )
+void SwXStyle::setPropertyToDefault(
+ const OUString& rPropertyName)
+throw( beans::UnknownPropertyException, uno::RuntimeException )
{
- const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
- setPropertiesToDefault ( aSequence );
+ const uno::Sequence < OUString > aSequence(&rPropertyName,1);
+ setPropertiesToDefault(aSequence);
}
-void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, uno::RuntimeException)
+void SAL_CALL SwXStyle::setPropertiesToDefault(
+ const uno::Sequence< OUString >& aPropertyNames )
+throw (beans::UnknownPropertyException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwFmt *pTargetFmt = 0;
@@ -3120,75 +3188,112 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >&
if(pBase)
{
- rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
+ rtl::Reference< SwDocStyleSheet > xStyle(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase));
switch(eFamily)
{
- case SFX_STYLE_FAMILY_CHAR: pTargetFmt = xStyle->GetCharFmt(); break;
- case SFX_STYLE_FAMILY_PARA: pTargetFmt = xStyle->GetCollection(); break;
- case SFX_STYLE_FAMILY_FRAME: pTargetFmt = xStyle->GetFrmFmt(); break;
+ case SFX_STYLE_FAMILY_CHAR:
+ pTargetFmt = xStyle->GetCharFmt();
+ break;
+
+ case SFX_STYLE_FAMILY_PARA:
+ pTargetFmt = xStyle->GetCollection();
+ break;
+
+ case SFX_STYLE_FAMILY_FRAME:
+ pTargetFmt = xStyle->GetFrmFmt();
+ break;
+
case SFX_STYLE_FAMILY_PAGE:
+ {
+ sal_uInt16 nPgDscPos = USHRT_MAX;
+ SwPageDesc *pDesc = m_pDoc->FindPageDescByName(xStyle->GetPageDesc()->GetName(),&nPgDscPos);
+
+ if(pDesc)
{
- sal_uInt16 nPgDscPos = USHRT_MAX;
- SwPageDesc *pDesc = m_pDoc->FindPageDescByName( xStyle->GetPageDesc()->GetName(), &nPgDscPos );
- if( pDesc )
- pTargetFmt = &pDesc->GetMaster();
+ pTargetFmt = &pDesc->GetMaster();
}
break;
+ }
case SFX_STYLE_FAMILY_PSEUDO:
break;
- default:
- ;
+ default: ;
}
}
}
+
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE;
+
switch(eFamily)
{
- case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
- case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE; break;
- case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE; break;
+ case SFX_STYLE_FAMILY_PARA: nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
+ case SFX_STYLE_FAMILY_FRAME: nPropSetId = PROPERTY_MAP_FRAME_STYLE; break;
+ case SFX_STYLE_FAMILY_PAGE: nPropSetId = PROPERTY_MAP_PAGE_STYLE; break;
case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE; break;
- default:
- ;
+ default: ;
}
+
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
-
const OUString* pNames = aPropertyNames.getConstArray();
- if ( pTargetFmt )
+ if(pTargetFmt)
{
- for( sal_Int32 nProp = 0, nEnd = aPropertyNames.getLength(); nProp < nEnd; nProp++ )
+ for(sal_Int32 nProp = 0,nEnd = aPropertyNames.getLength(); nProp < nEnd; nProp++)
{
- const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp] );
- if( !pEntry )
- throw beans::UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is unknown: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
- if ( pEntry->nWID == FN_UNO_FOLLOW_STYLE || pEntry->nWID == FN_UNO_NUM_RULES )
- throw uno::RuntimeException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Cannot reset: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
- if ( pEntry->nFlags & beans::PropertyAttribute::READONLY )
- throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertiesToDefault: property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
-
- //if( pEntry->nWID == FN_UNO_DEFAULT_OUTLINE_LEVEL ) //#outline level, removed by zhaojianwei
- // static_cast<SwTxtFmtColl*>(pTargetFmt)->SetOutlineLevel( NO_NUMBERING );
- //else
- // pTargetFmt->ResetFmtAttr( pEntry->nWID );
- if( pEntry->nWID == RES_PARATR_OUTLINELEVEL ) //add by zhaojianwei
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(pNames[nProp]);
+
+ if(!pEntry)
+ {
+ throw beans::UnknownPropertyException(OUString(RTL_CONSTASCII_USTRINGPARAM("Property is unknown: ")) + pNames[nProp],static_cast <cppu::OWeakObject *> (this));
+ }
+
+ if(pEntry->nWID == FN_UNO_FOLLOW_STYLE || pEntry->nWID == FN_UNO_NUM_RULES)
+ {
+ throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("Cannot reset: ")) + pNames[nProp],static_cast <cppu::OWeakObject *> (this));
+ }
+
+ if(pEntry->nFlags & beans::PropertyAttribute::READONLY)
+ {
+ throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("setPropertiesToDefault: property is read-only: ")) + pNames[nProp],static_cast <cppu::OWeakObject *> (this));
+ }
+
+ if(pEntry->nWID == RES_PARATR_OUTLINELEVEL)
+ {
static_cast<SwTxtFmtColl*>(pTargetFmt)->DeleteAssignmentToListLevelOfOutlineStyle();
+ }
else
- pTargetFmt->ResetFmtAttr( pEntry->nWID ); //<-end,zhaojianwei
+ {
+ pTargetFmt->ResetFmtAttr(pEntry->nWID);
+ }
+
+ if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+ {
+ //UUUU
+ SwDoc* pDoc = pTargetFmt->GetDoc();
+ SfxItemSet aSet(pDoc->GetAttrPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+ aSet.SetParent(&pTargetFmt->GetAttrSet());
+
+ aSet.ClearItem(XATTR_FILLBMP_STRETCH);
+ aSet.ClearItem(XATTR_FILLBMP_TILE);
+
+ pTargetFmt->SetFmtAttr(aSet);
+ }
}
}
- else if ( bIsDescriptor )
+ else if(bIsDescriptor)
{
- for( sal_Int32 nProp = 0, nEnd = aPropertyNames.getLength(); nProp < nEnd; nProp++ )
- pPropImpl->ClearProperty ( pNames[ nProp ] );
+ for(sal_Int32 nProp = 0,nEnd = aPropertyNames.getLength(); nProp < nEnd; nProp++)
+ {
+ pPropImpl->ClearProperty(pNames[nProp]);
+ }
}
}
-void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
- throw (uno::RuntimeException)
+void SAL_CALL SwXStyle::setAllPropertiesToDefault()
+throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
+
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily);
@@ -3198,78 +3303,82 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
if(pBase)
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
-
SwFmt *pTargetFmt = 0;
sal_uInt16 nPgDscPos = USHRT_MAX;
- switch( eFamily )
+
+ switch(eFamily)
{
- case SFX_STYLE_FAMILY_CHAR :
- pTargetFmt = xStyle->GetCharFmt();
- break;
- case SFX_STYLE_FAMILY_PARA :
+ case SFX_STYLE_FAMILY_CHAR:
+ pTargetFmt = xStyle->GetCharFmt();
+ break;
+
+ case SFX_STYLE_FAMILY_PARA:
{
pTargetFmt = xStyle->GetCollection();
- // --> OD 2007-07-25 #132402# - make code robust
- if ( xStyle->GetCollection() )
+
+ if(xStyle->GetCollection())
{
- // xStyle->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
+ // xStyle->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
xStyle->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,add by zhaojianwei
}
- // <--
+ break;
}
- break;
- case SFX_STYLE_FAMILY_FRAME:
- pTargetFmt = xStyle->GetFrmFmt();
- break;
- case SFX_STYLE_FAMILY_PAGE:
+
+ case SFX_STYLE_FAMILY_FRAME:
+ pTargetFmt = xStyle->GetFrmFmt();
+ break;
+
+ case SFX_STYLE_FAMILY_PAGE:
{
- SwPageDesc *pDesc = m_pDoc->FindPageDescByName( xStyle->GetPageDesc()->GetName(), &nPgDscPos );
- if( pDesc )
+ SwPageDesc *pDesc = m_pDoc->FindPageDescByName(xStyle->GetPageDesc()->GetName(),&nPgDscPos);
+
+ if(pDesc)
{
pTargetFmt = &pDesc->GetMaster();
- pDesc->SetUseOn ( nsUseOnPage::PD_ALL );
+ pDesc->SetUseOn(nsUseOnPage::PD_ALL);
}
+ break;
}
- break;
- case SFX_STYLE_FAMILY_PSEUDO:
- break;
- default:
- ;
+ case SFX_STYLE_FAMILY_PSEUDO:
+ break;
+
+ default: ;
}
- if( pTargetFmt )
+
+ if(pTargetFmt)
{
- if( USHRT_MAX != nPgDscPos )
+ if(USHRT_MAX != nPgDscPos)
{
SwPageDesc& rPageDesc = m_pDoc->_GetPageDesc(nPgDscPos);
rPageDesc.ResetAllMasterAttr();
SvxLRSpaceItem aLR(RES_LR_SPACE);
- sal_Int32 nSize = GetMetricVal ( CM_1) * 2;
- aLR.SetLeft ( nSize );
- aLR.SetLeft ( nSize );
- SvxULSpaceItem aUL( RES_UL_SPACE );
- aUL.SetUpper ( static_cast < sal_uInt16 > ( nSize ) );
- aUL.SetLower ( static_cast < sal_uInt16 > ( nSize ) );
- pTargetFmt->SetFmtAttr( aLR );
- pTargetFmt->SetFmtAttr( aUL );
-
- SwPageDesc* pStdPgDsc = m_pDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD );
- SwFmtFrmSize aFrmSz( ATT_FIX_SIZE );
- if( RES_POOLPAGE_STANDARD == rPageDesc.GetPoolFmtId() )
+ sal_Int32 nSize = GetMetricVal(CM_1) * 2;
+ aLR.SetLeft(nSize);
+ aLR.SetLeft(nSize);
+ SvxULSpaceItem aUL(RES_UL_SPACE);
+ aUL.SetUpper(static_cast <sal_uInt16> (nSize));
+ aUL.SetLower(static_cast <sal_uInt16> (nSize));
+ pTargetFmt->SetFmtAttr(aLR);
+ pTargetFmt->SetFmtAttr(aUL);
+ SwPageDesc* pStdPgDsc = m_pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD);
+ SwFmtFrmSize aFrmSz(ATT_FIX_SIZE);
+
+ if(RES_POOLPAGE_STANDARD == rPageDesc.GetPoolFmtId())
{
- if( m_pDoc->getPrinter( false ) )
+ if(m_pDoc->getPrinter(false))
{
- const Size aPhysSize( SvxPaperInfo::GetPaperSize(
- static_cast<Printer*>( m_pDoc->getPrinter( false ) )) );
- aFrmSz.SetSize( aPhysSize );
+ const Size aPhysSize(SvxPaperInfo::GetPaperSize(
+ static_cast<Printer*>(m_pDoc->getPrinter(false))));
+ aFrmSz.SetSize(aPhysSize);
}
else
{
// --> OD 2008-07-25 #i91928#
-// aFrmSz.SetWidth( LONG_MAX );
-// aFrmSz.SetHeight( LONG_MAX );
- aFrmSz.SetSize( SvxPaperInfo::GetDefaultPaperSize() );
+ // aFrmSz.SetWidth( LONG_MAX );
+ // aFrmSz.SetHeight( LONG_MAX );
+ aFrmSz.SetSize(SvxPaperInfo::GetDefaultPaperSize());
// <--
}
@@ -3278,13 +3387,15 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
{
aFrmSz = pStdPgDsc->GetMaster().GetFrmSize();
}
- if( pStdPgDsc->GetLandscape() )
+
+ if(pStdPgDsc->GetLandscape())
{
SwTwips nTmp = aFrmSz.GetHeight();
- aFrmSz.SetHeight( aFrmSz.GetWidth() );
- aFrmSz.SetWidth( nTmp );
+ aFrmSz.SetHeight(aFrmSz.GetWidth());
+ aFrmSz.SetWidth(nTmp);
}
- pTargetFmt->SetFmtAttr( aFrmSz );
+
+ pTargetFmt->SetFmtAttr(aFrmSz);
}
else
{
@@ -3293,86 +3404,106 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
// <--
}
- if( USHRT_MAX != nPgDscPos )
- m_pDoc->ChgPageDesc( nPgDscPos,
- const_cast<const SwDoc *>(m_pDoc)
- ->GetPageDesc(nPgDscPos) );
+ if(USHRT_MAX != nPgDscPos)
+ {
+ m_pDoc->ChgPageDesc(nPgDscPos, const_cast<const SwDoc *>(m_pDoc)->GetPageDesc(nPgDscPos));
+ }
}
}
else
+ {
throw uno::RuntimeException();
+ }
}
- else if ( bIsDescriptor )
+ else if(bIsDescriptor)
+ {
pPropImpl->ClearAllProperties();
+ }
else
+ {
throw uno::RuntimeException();
+ }
}
-uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults(
+ const uno::Sequence< OUString >& aPropertyNames )
+throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
sal_Int32 nCount = aPropertyNames.getLength();
- uno::Sequence < uno::Any > aRet ( nCount );
- if ( nCount )
+ uno::Sequence < uno::Any > aRet(nCount);
+
+ if(nCount)
{
- if( pBasePool)
+ if(pBasePool)
{
pBasePool->SetSearchMask(eFamily);
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "Doesn't seem to be a style!");
+ DBG_ASSERT(pBase,"Doesn't seem to be a style!");
if(pBase)
{
- rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
+ rtl::Reference< SwDocStyleSheet > xStyle(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase));
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE;
+
switch(eFamily)
{
- case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
- case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE; break;
- case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE; break;
+ case SFX_STYLE_FAMILY_PARA: nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break;
+ case SFX_STYLE_FAMILY_FRAME: nPropSetId = PROPERTY_MAP_FRAME_STYLE; break;
+ case SFX_STYLE_FAMILY_PAGE: nPropSetId = PROPERTY_MAP_PAGE_STYLE; break;
case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE; break;
- default:
- ;
+ default: ;
}
+
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap();
-
- const SfxItemSet &rSet = xStyle->GetItemSet(), *pParentSet = rSet.GetParent();
+ const SfxItemSet &rSet = xStyle->GetItemSet(),*pParentSet = rSet.GetParent();
const OUString *pNames = aPropertyNames.getConstArray();
uno::Any *pRet = aRet.getArray();
- for ( sal_Int32 i = 0 ; i < nCount; i++)
+
+ for(sal_Int32 i = 0; i < nCount; i++)
{
- const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[i] );
- if ( !pEntry )
- throw beans::UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) );
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(pNames[i]);
- if( pParentSet )
- aSwMapProvider.GetPropertySet(nPropSetId)->getPropertyValue(pNames[i], *pParentSet, pRet[i]);
- else if( pEntry->nWID != rSet.GetPool()->GetSlotId(pEntry->nWID) )
+ if(!pEntry)
+ {
+ throw beans::UnknownPropertyException(OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + pNames[i],static_cast <cppu::OWeakObject *> (this));
+ }
+
+ if(pParentSet)
+ {
+ aSwMapProvider.GetPropertySet(nPropSetId)->getPropertyValue(pNames[i],*pParentSet,pRet[i]);
+ }
+ else if(pEntry->nWID != rSet.GetPool()->GetSlotId(pEntry->nWID))
{
const SfxPoolItem& rItem = rSet.GetPool()->GetDefaultItem(pEntry->nWID);
+
rItem.QueryValue(pRet[i], pEntry->nMemberId);
}
}
}
else
+ {
throw uno::RuntimeException();
+ }
}
else
+ {
throw uno::RuntimeException();
+ }
}
return aRet;
}
/*-- 08.03.99 10:50:27---------------------------------------------------
-----------------------------------------------------------------------*/
-uno::Any SwXStyle::getPropertyDefault(const OUString& rPropertyName)
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+uno::Any SwXStyle::getPropertyDefault(
+ const OUString& rPropertyName)
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
- return getPropertyDefaults ( aSequence ).getConstArray()[0];
+ const uno::Sequence < OUString > aSequence(&rPropertyName,1);
+ return getPropertyDefaults(aSequence).getConstArray()[0];
}
/* -----------------21.01.99 13:08-------------------
*
@@ -3418,19 +3549,19 @@ void SwXStyle::Invalidate()
/*-- 17.12.98 08:43:35---------------------------------------------------
-----------------------------------------------------------------------*/
-SwXPageStyle::SwXPageStyle(SfxStyleSheetBasePool& rPool,
- SwDocShell* pDocSh, SfxStyleFamily eFam,
- const String& rStyleName)://, const SfxItemPropertyMap* _pMap) :
- SwXStyle(rPool, eFam, pDocSh->GetDoc(), rStyleName),//, _pMap),
+SwXPageStyle::SwXPageStyle(
+ SfxStyleSheetBasePool& rPool,
+ SwDocShell* pDocSh, SfxStyleFamily eFam,
+ const String& rStyleName)
+: SwXStyle(rPool, eFam, pDocSh->GetDoc(), rStyleName),
pDocShell(pDocSh)
{
-
}
/* -----------------23.08.99 15:52-------------------
--------------------------------------------------*/
-SwXPageStyle::SwXPageStyle(SwDocShell* pDocSh) :
- SwXStyle(pDocSh->GetDoc(), SFX_STYLE_FAMILY_PAGE),
+SwXPageStyle::SwXPageStyle(SwDocShell* pDocSh)
+: SwXStyle(pDocSh->GetDoc(), SFX_STYLE_FAMILY_PAGE),
pDocShell(pDocSh)
{
}
@@ -3448,8 +3579,7 @@ SwXPageStyle::~SwXPageStyle()
void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
- throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
+throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
if(!GetDoc())
throw uno::RuntimeException();
@@ -3461,7 +3591,8 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
const uno::Any* pValues = rValues.getConstArray();
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PAGE_STYLE);
const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap();
- SwStyleBase_Impl aBaseImpl(*GetDoc(), GetStyleName());
+ SwStyleBase_Impl aBaseImpl(*GetDoc(), GetStyleName(), &GetDoc()->GetDfltFrmFmt()->GetAttrSet()); //UUUU add pDfltFrmFmt as parent
+
if(GetBasePool())
{
sal_uInt16 nSaveMask = GetBasePool()->GetSearchMask();
@@ -3469,155 +3600,199 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
SfxStyleSheetBase* pBase = GetBasePool()->Find(GetStyleName());
GetBasePool()->SetSearchMask(GetFamily(), nSaveMask );
DBG_ASSERT(pBase, "where is the style?" );
+
if(pBase)
- aBaseImpl.mxNewBase = new SwDocStyleSheet(*(SwDocStyleSheet*)pBase);
+ {
+ aBaseImpl.setNewBase(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase));
+ }
else
+ {
throw uno::RuntimeException();
+ }
}
for(sal_Int16 nProp = 0; nProp < rPropertyNames.getLength(); nProp++)
{
- const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp] );
+ const String& rPropName = pNames[nProp];
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( rPropName );
+
if (!pEntry)
- throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
+ {
+ throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ }
+
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
- throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
+ {
+ throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ }
if(GetBasePool())
{
switch(pEntry->nWID)
{
- case FN_UNO_HEADER_ON:
- case FN_UNO_HEADER_BACKGROUND:
- case FN_UNO_HEADER_BOX:
- case FN_UNO_HEADER_LR_SPACE:
- case FN_UNO_HEADER_SHADOW:
- case FN_UNO_HEADER_BODY_DISTANCE:
- case FN_UNO_HEADER_IS_DYNAMIC_DISTANCE:
- case FN_UNO_HEADER_SHARE_CONTENT:
- case FN_UNO_HEADER_HEIGHT:
- case FN_UNO_HEADER_EAT_SPACING:
-
- case FN_UNO_FOOTER_ON:
- case FN_UNO_FOOTER_BACKGROUND:
- case FN_UNO_FOOTER_BOX:
- case FN_UNO_FOOTER_LR_SPACE:
- case FN_UNO_FOOTER_SHADOW:
- case FN_UNO_FOOTER_BODY_DISTANCE:
- case FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE:
- case FN_UNO_FOOTER_SHARE_CONTENT:
- case FN_UNO_FOOTER_HEIGHT:
- case FN_UNO_FOOTER_EAT_SPACING:
+ case SID_ATTR_PAGE_ON:
+ case RES_BACKGROUND:
+ case RES_BOX:
+ case RES_LR_SPACE:
+ case RES_SHADOW:
+ case RES_UL_SPACE:
+ case SID_ATTR_PAGE_DYNAMIC:
+ case SID_ATTR_PAGE_SHARED:
+ case SID_ATTR_PAGE_SIZE:
+ case RES_HEADER_FOOTER_EAT_SPACING:
{
- sal_Bool bSetItem = sal_False;
- sal_Bool bFooter = sal_False;
- sal_uInt16 nItemType = TYPE_BOOL;
- sal_uInt16 nRes = 0;
- switch(pEntry->nWID)
- {
- case FN_UNO_FOOTER_ON: bFooter = sal_True;
- //kein break;
- case FN_UNO_HEADER_ON: nRes = SID_ATTR_PAGE_ON;
- break;
- case FN_UNO_FOOTER_BACKGROUND: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_BACKGROUND: nRes = RES_BACKGROUND; nItemType = TYPE_BRUSH;
- break;
- case FN_UNO_FOOTER_BOX: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_BOX: nRes = RES_BOX; nItemType = TYPE_BOX;
- break;
- case FN_UNO_FOOTER_LR_SPACE: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_LR_SPACE: nRes = RES_LR_SPACE;nItemType = TYPE_LRSPACE;
- break;
- case FN_UNO_FOOTER_SHADOW: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_SHADOW: nRes = RES_SHADOW;nItemType = TYPE_SHADOW;
- break;
- case FN_UNO_FOOTER_BODY_DISTANCE: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_BODY_DISTANCE: nRes = RES_UL_SPACE;nItemType = TYPE_ULSPACE;
- break;
- case FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_IS_DYNAMIC_DISTANCE: nRes = SID_ATTR_PAGE_DYNAMIC;
- break;
- case FN_UNO_FOOTER_SHARE_CONTENT: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_SHARE_CONTENT: nRes = SID_ATTR_PAGE_SHARED;
- break;
- case FN_UNO_FOOTER_HEIGHT: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_HEIGHT: nRes = SID_ATTR_PAGE_SIZE;nItemType = TYPE_SIZE;
- break;
- case FN_UNO_FOOTER_EAT_SPACING: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_EAT_SPACING: nRes = RES_HEADER_FOOTER_EAT_SPACING;nItemType = TYPE_SIZE;
- break;
- }
- const SvxSetItem* pSetItem;
- if(SFX_ITEM_SET == aBaseImpl.GetItemSet().GetItemState(
- bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
- sal_False, (const SfxPoolItem**)&pSetItem))
+ // these entries are used in Header, Footer and (partially) in the PageStyle itself.
+ // Check for Header/Footer entry
+ const bool bHeader(rPropName.EqualsAscii("Header", 0, 6));
+ const bool bFooter(rPropName.EqualsAscii("Footer", 0, 6));
+
+ if(bHeader || bFooter)
{
- SvxSetItem* pNewSetItem = (SvxSetItem*)pSetItem->Clone();
- SfxItemSet& rSetSet = pNewSetItem->GetItemSet();
- const SfxPoolItem* pItem = 0;
- SfxPoolItem* pNewItem = 0;
- rSetSet.GetItemState(nRes, sal_True, &pItem);
- if(!pItem && nRes != rSetSet.GetPool()->GetSlotId(nRes))
- pItem = &rSetSet.GetPool()->GetDefaultItem(nRes);
- if(pItem)
+ // it is a Header/Footer entry, access the SvxSetItem containing it's information
+ const SvxSetItem* pSetItem = 0;
+
+ if(SFX_ITEM_SET == aBaseImpl.GetItemSet().GetItemState(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, sal_False, (const SfxPoolItem**)&pSetItem))
{
- pNewItem = pItem->Clone();
+ // create a new SvxSetItem and get it's ItemSet as new target
+ SvxSetItem* pNewSetItem = static_cast< SvxSetItem* >(pSetItem->Clone());
+ SfxItemSet& rSetSet = pNewSetItem->GetItemSet();
+
+ // set parent to ItemSet to ensure XFILL_NONE as XFillStyleItem
+ rSetSet.SetParent(&GetDoc()->GetDfltFrmFmt()->GetAttrSet());
+
+ // replace the used SfxItemSet at the SwStyleBase_Impl temporarily and use the
+ // default method to set the property
+ SfxItemSet* pRememberItemSet = aBaseImpl.replaceItemSet(&rSetSet);
+ lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily());
+ aBaseImpl.replaceItemSet(pRememberItemSet);
+
+ // reset paret at ItemSet from SetItem
+ rSetSet.SetParent(0);
+
+ // set the new SvxSetItem at the real target and delete it
+ aBaseImpl.GetItemSet().Put(*pNewSetItem);
+ delete pNewSetItem;
}
- else
+ else if(pEntry->nWID == SID_ATTR_PAGE_ON)
{
- switch(nItemType)
+ sal_Bool bVal = *(sal_Bool*)pValues[nProp].getValue();
+
+ if(bVal)
{
- case TYPE_BOOL: pNewItem = new SfxBoolItem(nRes); break;
- case TYPE_SIZE: pNewItem = new SvxSizeItem(nRes); break;
- case TYPE_BRUSH: pNewItem = new SvxBrushItem(nRes); break;
- case TYPE_ULSPACE: pNewItem = new SvxULSpaceItem(nRes); break;
- case TYPE_SHADOW : pNewItem = new SvxShadowItem(nRes); break;
- case TYPE_LRSPACE: pNewItem = new SvxLRSpaceItem(nRes); break;
- case TYPE_BOX: pNewItem = new SvxBoxItem(nRes); break;
+ // Header/footer gets switched on, create defauts and the needed SfxSetItem
+ SfxItemSet aTempSet(*aBaseImpl.GetItemSet().GetPool(),
+ RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82
+
+ //UUUU FillAttribute support
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014
+
+ SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
+ SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
+ SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
+ 0);
+
+ //UUUU set correct parent to get the XFILL_NONE FillStyle as needed
+ aTempSet.SetParent(&GetDoc()->GetDfltFrmFmt()->GetAttrSet());
+
+ aTempSet.Put(SfxBoolItem(SID_ATTR_PAGE_ON, sal_True));
+ aTempSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(MM50, MM50)));
+ aTempSet.Put(SvxLRSpaceItem(RES_LR_SPACE));
+ aTempSet.Put(SvxULSpaceItem(RES_UL_SPACE));
+ aTempSet.Put(SfxBoolItem(SID_ATTR_PAGE_SHARED, sal_True));
+ aTempSet.Put(SfxBoolItem(SID_ATTR_PAGE_DYNAMIC, sal_True));
+
+ SvxSetItem aNewSetItem(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, aTempSet);
+ aBaseImpl.GetItemSet().Put(aNewSetItem);
}
}
- bSetItem = pNewItem->PutValue(pValues[nProp], pEntry->nMemberId);
- rSetSet.Put(*pNewItem);
- aBaseImpl.GetItemSet().Put(*pNewSetItem);
- delete pNewItem;
- delete pNewSetItem;
}
- else if(SID_ATTR_PAGE_ON == nRes )
+ else
{
- sal_Bool bVal = *(sal_Bool*)pValues[nProp].getValue();
- if(bVal)
+ switch(pEntry->nWID)
{
- SfxItemSet aTempSet(*aBaseImpl.GetItemSet().GetPool(),
- RES_BACKGROUND, RES_SHADOW,
- RES_LR_SPACE, RES_UL_SPACE,
- nRes, nRes,
- SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- SID_ATTR_PAGE_DYNAMIC, SID_ATTR_PAGE_DYNAMIC,
- SID_ATTR_PAGE_SHARED, SID_ATTR_PAGE_SHARED,
- 0 );
- aTempSet.Put(SfxBoolItem(nRes, sal_True));
- aTempSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(MM50, MM50)));
- aTempSet.Put(SvxLRSpaceItem(RES_LR_SPACE));
- aTempSet.Put(SvxULSpaceItem(RES_UL_SPACE));
- aTempSet.Put(SfxBoolItem(SID_ATTR_PAGE_SHARED, sal_True));
- aTempSet.Put(SfxBoolItem(SID_ATTR_PAGE_DYNAMIC, sal_True));
-
- SvxSetItem aNewSetItem( bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
- aTempSet);
- aBaseImpl.GetItemSet().Put(aNewSetItem);
+ case SID_ATTR_PAGE_DYNAMIC:
+ case SID_ATTR_PAGE_SHARED:
+ case SID_ATTR_PAGE_ON:
+ case RES_HEADER_FOOTER_EAT_SPACING:
+ {
+ // these slots are exclusive to Header/Footer, thus this is an error
+ throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ break;
+ }
+ default:
+ {
+ // part of PageStyle, fallback to default
+ lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily());
+ }
}
}
+
+ break;
}
- break;
+
+ case XATTR_FILLBMP_SIZELOG:
+ case XATTR_FILLBMP_TILEOFFSETX:
+ case XATTR_FILLBMP_TILEOFFSETY:
+ case XATTR_FILLBMP_POSOFFSETX:
+ case XATTR_FILLBMP_POSOFFSETY:
+ case XATTR_FILLBMP_POS:
+ case XATTR_FILLBMP_SIZEX:
+ case XATTR_FILLBMP_SIZEY:
+ case XATTR_FILLBMP_STRETCH:
+ case XATTR_FILLBMP_TILE:
+ case OWN_ATTR_FILLBMP_MODE:
+ case XATTR_FILLCOLOR:
+ case XATTR_FILLBACKGROUND:
+ case XATTR_FILLBITMAP:
+ case XATTR_GRADIENTSTEPCOUNT:
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_FILLSTYLE:
+ case XATTR_FILLTRANSPARENCE:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ case XATTR_SECONDARYFILLCOLOR:
+ {
+ // This DrawingLayer FillStyle attributes can be part of Header, Footer and PageStyle
+ // itself, so decide what to do using the name
+ const bool bHeader(rPropName.EqualsAscii("Header", 0, 6));
+ const bool bFooter(rPropName.EqualsAscii("Footer", 0, 6));
+
+ if(bHeader || bFooter)
+ {
+ const SvxSetItem* pSetItem = 0;
+
+ if(SFX_ITEM_SET == aBaseImpl.GetItemSet().GetItemState(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, sal_False, (const SfxPoolItem**)&pSetItem))
+ {
+ // create a new SvxSetItem and get it's ItemSet as new target
+ SvxSetItem* pNewSetItem = static_cast< SvxSetItem* >(pSetItem->Clone());
+ SfxItemSet& rSetSet = pNewSetItem->GetItemSet();
+
+ // set parent to ItemSet to ensure XFILL_NONE as XFillStyleItem
+ rSetSet.SetParent(&GetDoc()->GetDfltFrmFmt()->GetAttrSet());
+
+ // replace the used SfxItemSet at the SwStyleBase_Impl temporarily and use the
+ // default method to set the property
+ SfxItemSet* pRememberItemSet = aBaseImpl.replaceItemSet(&rSetSet);
+ lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily());
+ aBaseImpl.replaceItemSet(pRememberItemSet);
+
+ // reset paret at ItemSet from SetItem
+ rSetSet.SetParent(0);
+
+ // set the new SvxSetItem at the real target and delete it
+ aBaseImpl.GetItemSet().Put(*pNewSetItem);
+ delete pNewSetItem;
+ }
+ }
+ else
+ {
+ // part of PageStyle, fallback to default
+ lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily());
+ }
+
+ break;
+ }
+
case FN_PARAM_FTN_INFO :
{
const SfxPoolItem& rItem = aBaseImpl.GetItemSet().Get(FN_PARAM_FTN_INFO);
@@ -3627,45 +3802,58 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
delete pNewFtnItem;
if(!bPut)
throw lang::IllegalArgumentException();
+
+ break;
}
- break;
+
case FN_UNO_HEADER :
case FN_UNO_HEADER_LEFT :
case FN_UNO_HEADER_RIGHT :
case FN_UNO_FOOTER :
case FN_UNO_FOOTER_LEFT :
case FN_UNO_FOOTER_RIGHT :
+ {
throw lang::IllegalArgumentException();
- //break;
+ break;
+ }
+
default:
- lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl,
- GetBasePool(), GetDoc(), GetFamily());
+ {
+ //UUUU
+ lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily());
+ break;
+ }
}
}
else if(IsDescriptor())
{
- if(!GetPropImpl()->SetProperty(pNames[nProp], pValues[nProp]))
+ if(!GetPropImpl()->SetProperty(rPropName, pValues[nProp]))
throw lang::IllegalArgumentException();
}
else
+ {
throw uno::RuntimeException();
+ }
}
+
if(aBaseImpl.HasItemSet())
{
::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
+
if (undoGuard.UndoWasEnabled())
{
// Fix i64460: as long as Undo of page styles with header/footer causes trouble...
GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
- aBaseImpl.mxNewBase->SetItemSet(aBaseImpl.GetItemSet());
+
+ aBaseImpl.getNewBase()->SetItemSet(aBaseImpl.GetItemSet());
}
}
void SwXPageStyle::setPropertyValues(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3686,9 +3874,10 @@ void SwXPageStyle::setPropertyValues(
/* -----------------------------04.11.03 13:50--------------------------------
---------------------------------------------------------------------------*/
-static uno::Reference<text::XText>
-lcl_makeHeaderFooter(
- const sal_uInt16 nRes, const bool bHeader, SwFrmFmt const*const pFrmFmt)
+static uno::Reference<text::XText> lcl_makeHeaderFooter(
+ const sal_uInt16 nRes,
+ const bool bHeader,
+ SwFrmFmt const*const pFrmFmt)
{
if (!pFrmFmt) { return 0; }
@@ -3710,8 +3899,8 @@ lcl_makeHeaderFooter(
}
uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
- const uno::Sequence< OUString >& rPropertyNames )
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+const uno::Sequence< OUString >& rPropertyNames )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
if(!GetDoc())
throw uno::RuntimeException();
@@ -3719,17 +3908,21 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
sal_Int32 nLength = rPropertyNames.getLength();
const OUString* pNames = rPropertyNames.getConstArray();
uno::Sequence< uno::Any > aRet ( nLength );
-
uno::Any* pRet = aRet.getArray();
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PAGE_STYLE);
const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap();
- SwStyleBase_Impl aBase(*GetDoc(), GetStyleName());
+ SwStyleBase_Impl aBase(*GetDoc(), GetStyleName(), &GetDoc()->GetDfltFrmFmt()->GetAttrSet()); //UUUU add pDfltFrmFmt as parent
SfxStyleSheetBase* pBase = 0;
+
for(sal_Int32 nProp = 0; nProp < nLength; nProp++)
{
- const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp] );
+ const String& rPropName = pNames[nProp];
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( rPropName );
+
if (!pEntry)
- throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
+ {
+ throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ }
if(GetBasePool())
{
@@ -3740,130 +3933,150 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
pBase = GetBasePool()->Find(GetStyleName());
GetBasePool()->SetSearchMask(GetFamily(), nSaveMask );
}
+
sal_uInt16 nRes = 0;
- bool bHeader = false;
sal_Bool bAll = sal_False, bLeft = sal_False, bRight = sal_False;
+ const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM));
+
switch(pEntry->nWID)
{
- case FN_UNO_HEADER_ON:
- case FN_UNO_HEADER_BACKGROUND:
- case FN_UNO_HEADER_BOX:
- case FN_UNO_HEADER_LR_SPACE:
- case FN_UNO_HEADER_SHADOW:
- case FN_UNO_HEADER_BODY_DISTANCE:
- case FN_UNO_HEADER_IS_DYNAMIC_DISTANCE:
- case FN_UNO_HEADER_SHARE_CONTENT:
- case FN_UNO_HEADER_HEIGHT:
- case FN_UNO_HEADER_EAT_SPACING:
-
- case FN_UNO_FOOTER_ON:
- case FN_UNO_FOOTER_BACKGROUND:
- case FN_UNO_FOOTER_BOX:
- case FN_UNO_FOOTER_LR_SPACE:
- case FN_UNO_FOOTER_SHADOW:
- case FN_UNO_FOOTER_BODY_DISTANCE:
- case FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE:
- case FN_UNO_FOOTER_SHARE_CONTENT:
- case FN_UNO_FOOTER_HEIGHT:
- case FN_UNO_FOOTER_EAT_SPACING:
+ case SID_ATTR_PAGE_ON:
+ case RES_BACKGROUND:
+ case RES_BOX:
+ case RES_LR_SPACE:
+ case RES_SHADOW:
+ case RES_UL_SPACE:
+ case SID_ATTR_PAGE_DYNAMIC:
+ case SID_ATTR_PAGE_SHARED:
+ case SID_ATTR_PAGE_SIZE:
+ case RES_HEADER_FOOTER_EAT_SPACING:
{
- SfxStyleSheetBasePool* pBasePool2 = ((SwXPageStyle*)this)->GetBasePool();
- pBasePool2->SetSearchMask(GetFamily());
- SfxStyleSheetBase* pBase2 = pBasePool2->Find(GetStyleName());
- if(pBase2)
+ // These slots are used for Header, Footer and (partially) for PageStyle directly.
+ // Check for Header/Footer entry
+ const bool bHeader(rPropName.EqualsAscii("Header", 0, 6));
+ const bool bFooter(rPropName.EqualsAscii("Footer", 0, 6));
+
+ if(bHeader || bFooter)
{
+ // slot is a Header/Footer slot
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
const SfxItemSet& rSet = xStyle->GetItemSet();
- sal_Bool bFooter = sal_False;
+ const SvxSetItem* pSetItem;
+
+ if(SFX_ITEM_SET == rSet.GetItemState(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, sal_False, (const SfxPoolItem**)&pSetItem))
+ {
+ // get from SfxItemSet of the corresponding SfxSetItem
+ const SfxItemSet& rSetSet = pSetItem->GetItemSet();
+ SfxItemSet* pRememberItemSet = aBase.replaceItemSet(&const_cast< SfxItemSet& >(rSetSet));
+ pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() );
+ aBase.replaceItemSet(pRememberItemSet);
+ }
+ else if(pEntry->nWID == SID_ATTR_PAGE_ON)
+ {
+ // header/footer is not available, thus off. Default is sal_False, though
+ sal_Bool bRet = sal_False;
+ pRet[nProp].setValue(&bRet, ::getCppuBooleanType());
+ }
+ }
+ else
+ {
switch(pEntry->nWID)
{
- case FN_UNO_FOOTER_ON:
- bFooter = sal_True;
- // kein break!
- case FN_UNO_HEADER_ON:
+ case SID_ATTR_PAGE_DYNAMIC:
+ case SID_ATTR_PAGE_SHARED:
+ case SID_ATTR_PAGE_ON:
+ case RES_HEADER_FOOTER_EAT_SPACING:
+ {
+ // these slots are exclusive to Header/Footer, thus this is an error
+ throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ break;
+ }
+ default:
{
- //falls das SetItem nicht da ist, dann ist der Wert sal_False
- sal_Bool bRet = sal_False;
- pRet[nProp].setValue(&bRet, ::getCppuBooleanType());
- nRes = SID_ATTR_PAGE_ON;
+ // part of PageStyle, fallback to default
+ pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() );
}
- break;
- case FN_UNO_FOOTER_BACKGROUND: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_BACKGROUND: nRes = RES_BACKGROUND;
- break;
- case FN_UNO_FOOTER_BOX: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_BOX: nRes = RES_BOX;
- break;
- case FN_UNO_FOOTER_LR_SPACE: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_LR_SPACE: nRes = RES_LR_SPACE;
- break;
- case FN_UNO_FOOTER_SHADOW: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_SHADOW: nRes = RES_SHADOW;
- break;
- case FN_UNO_FOOTER_BODY_DISTANCE: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_BODY_DISTANCE: nRes = RES_UL_SPACE;
- break;
- case FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_IS_DYNAMIC_DISTANCE: nRes = SID_ATTR_PAGE_DYNAMIC;
- break;
- case FN_UNO_FOOTER_SHARE_CONTENT: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_SHARE_CONTENT: nRes = SID_ATTR_PAGE_SHARED;
- break;
- case FN_UNO_FOOTER_HEIGHT: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_HEIGHT: nRes = SID_ATTR_PAGE_SIZE;
- break;
- case FN_UNO_FOOTER_EAT_SPACING: bFooter = sal_True;
- // kein break;
- case FN_UNO_HEADER_EAT_SPACING: nRes = RES_HEADER_FOOTER_EAT_SPACING;
- break;
}
+ }
+
+ break;
+ }
+
+ case XATTR_FILLBMP_SIZELOG:
+ case XATTR_FILLBMP_TILEOFFSETX:
+ case XATTR_FILLBMP_TILEOFFSETY:
+ case XATTR_FILLBMP_POSOFFSETX:
+ case XATTR_FILLBMP_POSOFFSETY:
+ case XATTR_FILLBMP_POS:
+ case XATTR_FILLBMP_SIZEX:
+ case XATTR_FILLBMP_SIZEY:
+ case XATTR_FILLBMP_STRETCH:
+ case XATTR_FILLBMP_TILE:
+ case OWN_ATTR_FILLBMP_MODE:
+ case XATTR_FILLCOLOR:
+ case XATTR_FILLBACKGROUND:
+ case XATTR_FILLBITMAP:
+ case XATTR_GRADIENTSTEPCOUNT:
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_FILLSTYLE:
+ case XATTR_FILLTRANSPARENCE:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ case XATTR_SECONDARYFILLCOLOR:
+ {
+ // This DrawingLayer FillStyle attributes can be part of Header, Footer and PageStyle
+ // itself, so decide what to do using the name
+ const bool bHeader(rPropName.EqualsAscii("Header", 0, 6));
+ const bool bFooter(rPropName.EqualsAscii("Footer", 0, 6));
+
+ if(bHeader || bFooter)
+ {
+ rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
+ const SfxItemSet& rSet = xStyle->GetItemSet();
const SvxSetItem* pSetItem;
- if(SFX_ITEM_SET == rSet.GetItemState(
- bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
- sal_False, (const SfxPoolItem**)&pSetItem))
+
+ if(SFX_ITEM_SET == rSet.GetItemState(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, sal_False, (const SfxPoolItem**)&pSetItem))
{
- const SfxItemSet& rTmpSet = pSetItem->GetItemSet();
- const SfxPoolItem* pItem = 0;
- rTmpSet.GetItemState(nRes, sal_True, &pItem);
- if(!pItem && nRes != rTmpSet.GetPool()->GetSlotId(nRes))
- pItem = &rTmpSet.GetPool()->GetDefaultItem(nRes);
- if(pItem)
- pItem->QueryValue(pRet[nProp], pEntry->nMemberId);
+ // set at SfxItemSet of the corresponding SfxSetItem
+ const SfxItemSet& rSetSet = pSetItem->GetItemSet();
+ SfxItemSet* pRememberItemSet = aBase.replaceItemSet(&const_cast< SfxItemSet& >(rSetSet));
+ pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() );
+ aBase.replaceItemSet(pRememberItemSet);
}
}
+ else
+ {
+ // part of PageStyle, fallback to default
+ pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() );
+ }
+
+ break;
}
- break;
- case FN_UNO_HEADER :
- bAll = sal_True; goto Header;
- case FN_UNO_HEADER_LEFT :
- bLeft = sal_True; goto Header;
- case FN_UNO_HEADER_RIGHT :
- bRight = sal_True; goto Header;
-Header:
- bHeader = true;
- nRes = RES_HEADER; goto MakeObject;
- case FN_UNO_FOOTER :
- bAll = sal_True; goto Footer;
- case FN_UNO_FOOTER_LEFT :
- bLeft = sal_True; goto Footer;
- case FN_UNO_FOOTER_RIGHT :
- bRight = sal_True;
-Footer:
- nRes = RES_FOOTER;
-MakeObject:
+
+ case FN_UNO_HEADER:
+ case FN_UNO_HEADER_LEFT:
+ case FN_UNO_HEADER_RIGHT:
+ case FN_UNO_FOOTER:
+ case FN_UNO_FOOTER_LEFT:
+ case FN_UNO_FOOTER_RIGHT:
{
+ //UUUU cleanups for readability (undos removed, rearranged)
+ bool bHeader(false);
+
+ switch(pEntry->nWID)
+ {
+ case FN_UNO_HEADER: bHeader = true; nRes = RES_HEADER; bAll = sal_True; break;
+ case FN_UNO_HEADER_LEFT: bHeader = true; nRes = RES_HEADER; bLeft = sal_True; break;
+ case FN_UNO_HEADER_RIGHT: bHeader = true; nRes = RES_HEADER; bRight = sal_True; break;
+ case FN_UNO_FOOTER: bHeader = false; nRes = RES_FOOTER; bAll = sal_True; break;
+ case FN_UNO_FOOTER_LEFT: bHeader = false; nRes = RES_FOOTER; bLeft = sal_True; break;
+ case FN_UNO_FOOTER_RIGHT: bHeader = false; nRes = RES_FOOTER; bRight = sal_True; break;
+ default: break;
+ }
+
const SwPageDesc& rDesc = aBase.GetOldPageDesc();
const SwFrmFmt* pFrmFmt = 0;
- sal_Bool bShare = (bHeader && rDesc.IsHeaderShared())||
- (!bHeader && rDesc.IsFooterShared());
+ sal_Bool bShare = (bHeader && rDesc.IsHeaderShared()) || (!bHeader && rDesc.IsFooterShared());
// TextLeft returns the left content if there is one,
// Text and TextRight return the master content.
// TextRight does the same as Text and is for
@@ -3882,32 +4095,47 @@ MakeObject:
{
pRet[nProp] <<= xRet;
}
+
+ break;
}
- break;
+
case FN_PARAM_FTN_INFO :
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) );
const SfxItemSet& rSet = xStyle->GetItemSet();
const SfxPoolItem& rItem = rSet.Get(FN_PARAM_FTN_INFO);
- rItem.QueryValue(pRet[nProp], pEntry->nMemberId);
+ rItem.QueryValue(pRet[nProp], nMemberId);
+ break;
}
- break;
+
default:
- pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() );
+ {
+ //UUUU
+ pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() );
+ break;
+ }
}
}
else if(IsDescriptor())
{
uno::Any* pAny = 0;
- GetPropImpl()->GetProperty(pNames[nProp], pAny);
+ GetPropImpl()->GetProperty(rPropName, pAny);
+
if ( !pAny )
- GetPropImpl()->GetProperty ( pNames[nProp], mxStyleData, pRet[ nProp ] );
+ {
+ GetPropImpl()->GetProperty ( rPropName, mxStyleData, pRet[ nProp ] );
+ }
else
+ {
pRet[nProp] = *pAny;
+ }
}
else
+ {
throw uno::RuntimeException();
+ }
}
+
return aRet;
}
/* -----------------------------18.04.01 13:50--------------------------------
@@ -3915,7 +4143,7 @@ MakeObject:
---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXPageStyle::getPropertyValues(
const uno::Sequence< OUString >& rPropertyNames )
- throw(uno::RuntimeException)
+throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Sequence< uno::Any > aValues;
@@ -3939,26 +4167,27 @@ uno::Sequence< uno::Any > SwXPageStyle::getPropertyValues(
/*-- 17.12.98 08:43:36---------------------------------------------------
-----------------------------------------------------------------------*/
-uno::Any SwXPageStyle::getPropertyValue(const OUString& rPropertyName) throw(
- beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+uno::Any SwXPageStyle::getPropertyValue(
+ const OUString& rPropertyName)
+throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
+
return GetPropertyValues_Impl(aProperties).getConstArray()[0];
}
/*-- 17.12.98 08:43:36---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXPageStyle::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
- throw( beans::UnknownPropertyException,
- beans::PropertyVetoException,
- lang::IllegalArgumentException,
- lang::WrappedTargetException,
- uno::RuntimeException)
+void SwXPageStyle::setPropertyValue(
+ const OUString& rPropertyName,
+ const uno::Any& rValue)
+throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
const uno::Sequence<uno::Any> aValues(&rValue, 1);
+
SetPropertyValues_Impl( aProperties, aValues );
}
@@ -4156,57 +4385,220 @@ void SwXAutoStyleFamily::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNe
-----------------------------------------------------------------------*/
uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
const uno::Sequence< beans::PropertyValue >& Values )
- throw (uno::RuntimeException)
+throw (uno::RuntimeException)
{
if( !pDocShell )
+ {
throw uno::RuntimeException();
+ }
+
const sal_uInt16* pRange = 0;
const SfxItemPropertySet* pPropSet = 0;
+
switch( eFamily )
{
case IStyleAccess::AUTO_STYLE_CHAR:
{
pRange = aCharAutoFmtSetRange;
pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_CHAR_AUTO_STYLE);
+ break;
}
- break;
case IStyleAccess::AUTO_STYLE_RUBY:
{
pRange = 0;//aTxtNodeSetRange;
pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_RUBY_AUTO_STYLE);
+ break;
}
- break;
case IStyleAccess::AUTO_STYLE_PARA:
{
- pRange = aTxtNodeSetRange;
+ pRange = aTxtNodeSetRange; //UUUU checked, already added support for [XATTR_FILL_FIRST, XATTR_FILL_LAST]
pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARA_AUTO_STYLE);
+ break;
}
- break;
- default:
- ;
+ default: break;
}
+
SwAttrSet aSet( pDocShell->GetDoc()->GetAttrPool(), pRange );
const beans::PropertyValue* pSeq = Values.getConstArray();
sal_Int32 nLen = Values.getLength();
- for( sal_Int32 i = 0; i < nLen; ++i )
+ const bool bTakeCareOfDrawingLayerFillStyle(IStyleAccess::AUTO_STYLE_PARA == eFamily);
+
+ if(!bTakeCareOfDrawingLayerFillStyle)
{
- try
- {
- pPropSet->setPropertyValue( pSeq[i].Name, pSeq[i].Value, aSet );
- }
- catch (beans::UnknownPropertyException &)
+ for( sal_Int32 i = 0; i < nLen; ++i )
{
- ASSERT( false, "Unknown property" );
+ try
+ {
+ pPropSet->setPropertyValue( pSeq[i].Name, pSeq[i].Value, aSet );
+ }
+ catch (beans::UnknownPropertyException &)
+ {
+ ASSERT( false, "Unknown property" );
+ }
+ catch (lang::IllegalArgumentException &)
+ {
+ ASSERT( false, "Illegal argument" );
+ }
}
- catch (lang::IllegalArgumentException &)
+ }
+ else
+ {
+ //UUUU set parent to ItemSet to ensure XFILL_NONE as XFillStyleItem
+ // to make cases in RES_BACKGROUND work correct; target *is* a style
+ // where this is the case
+ aSet.SetParent(&pDocShell->GetDoc()->GetDfltTxtFmtColl()->GetAttrSet());
+
+ //UUUU here the used DrawingLayer FillStyles are imported when family is
+ // equal to IStyleAccess::AUTO_STYLE_PARA, thus we will need to serve the
+ // used slots functionality here to do this correctly
+ const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
+
+ for( sal_Int32 i = 0; i < nLen; ++i )
{
- ASSERT( false, "Illegal argument" );
+ const OUString& rPropName = pSeq[i].Name;
+ uno::Any aValue(pSeq[i].Value);
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(rPropName);
+
+ if(!pEntry)
+ {
+ throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ }
+
+ const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM));
+ bool bDone(false);
+
+ // check for needed metric translation
+ if(pEntry->nMemberId & SFX_METRIC_ITEM)
+ {
+ bool bDoIt(true);
+
+ if(XATTR_FILLBMP_SIZEX == pEntry->nWID || XATTR_FILLBMP_SIZEY == pEntry->nWID)
+ {
+ // exception: If these ItemTypes are used, do not convert when these are negative
+ // since this means they are intended as percent values
+ sal_Int32 nValue = 0;
+
+ if(aValue >>= nValue)
+ {
+ bDoIt = nValue > 0;
+ }
+ }
+
+ if(bDoIt)
+ {
+ const SfxItemPool& rPool = pDocShell->GetDoc()->GetAttrPool();
+ const SfxMapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
+
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ SvxUnoConvertFromMM(eMapUnit, aValue);
+ }
+ }
+ }
+
+ switch(pEntry->nWID)
+ {
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_FILLBITMAP:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ // not yet needed; activate when LineStyle support may be added
+ // case XATTR_LINESTART:
+ // case XATTR_LINEEND:
+ // case XATTR_LINEDASH:
+ {
+ if(MID_NAME == nMemberId)
+ {
+ //UUUU add set commands for FillName items
+ OUString aTempName;
+
+ if(!(aValue >>= aTempName))
+ {
+ throw lang::IllegalArgumentException();
+ }
+
+ SvxShape::SetFillAttribute(pEntry->nWID, aTempName, aSet);
+ bDone = true;
+ }
+ else if(MID_GRAFURL == nMemberId)
+ {
+ if(XATTR_FILLBITMAP == pEntry->nWID)
+ {
+ //UUUU Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
+ const Graphic aNullGraphic;
+ XFillBitmapItem aXFillBitmapItem(aSet.GetPool(), aNullGraphic);
+
+ aXFillBitmapItem.PutValue(aValue, nMemberId);
+ aSet.Put(aXFillBitmapItem);
+ bDone = true;
+ }
+ }
+
+ break;
+ }
+ case RES_BACKGROUND:
+ {
+ //UUUU
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(aSet, RES_BACKGROUND));
+ SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
+
+ aChangedBrushItem.PutValue(aValue, nMemberId);
+
+ if(!(aChangedBrushItem == aOriginalBrushItem))
+ {
+ setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, aSet);
+ }
+
+ bDone = true;
+ break;
+ }
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ //UUUU
+ drawing::BitmapMode eMode;
+
+ if(!(aValue >>= eMode))
+ {
+ sal_Int32 nMode = 0;
+
+ if(!(aValue >>= nMode))
+ {
+ throw lang::IllegalArgumentException();
+ }
+
+ eMode = (drawing::BitmapMode)nMode;
+ }
+
+ aSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode));
+ aSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode));
+
+ bDone = true;
+ break;
+ }
+ default: break;
+ }
+
+ if(!bDone)
+ {
+ pPropSet->setPropertyValue( rPropName, aValue, aSet );
+ }
}
+
+ //UUUU clear parent again
+ aSet.SetParent(0);
}
+ //UUUU need to ensure uniqueness of evtl. added NameOrIndex items
+ // currently in principle only needed when bTakeCareOfDrawingLayerFillStyle,
+ // but does not hurt and is easily forgotten later eventually, so keep it
+ // as common case
+ pDocShell->GetDoc()->CheckForUniqueItemForLineFillNameOrIndex(aSet);
+
+ // AutomaticStyle creation
SfxItemSet_Pointer_t pSet = pDocShell->GetDoc()->GetIStyleAccess().cacheAutomaticStyle( aSet, eFamily );
uno::Reference<style::XAutoStyle> xRet = new SwXAutoStyle(pDocShell->GetDoc(), pSet, eFamily);
+
return xRet;
}
/*-- 31.05.2006 11:24:02---------------------------------------------------
@@ -4328,38 +4720,48 @@ uno::Any SwXAutoStylesEnumerator::nextElement( )
}
return aRet;
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
- -----------------------------------------------------------------------*/
-SwXAutoStyle::SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam )
-: pSet( pInitSet ), eFamily( eFam )
+//////////////////////////////////////////////////////////////////////////////
+//UUUU SwXAutoStyle with the family IStyleAccess::AUTO_STYLE_PARA (or
+// PROPERTY_MAP_PARA_AUTO_STYLE) now uses DrawingLayer FillStyles to allow
+// unified paragraph background fill, thus the UNO API implementation has to
+// support the needed slots for these. This seems to be used only for reading
+// (no setPropertyValue implementation here), so maybe specialized for saving
+// the Writer Doc to ODF
+
+SwXAutoStyle::SwXAutoStyle(
+ SwDoc* pDoc,
+ SfxItemSet_Pointer_t pInitSet,
+ IStyleAccess::SwAutoStyleFamily eFam)
+: mpSet(pInitSet),
+ meFamily(eFam),
+ mrDoc(*pDoc)
{
// Register ourselves as a listener to the document (via the page descriptor)
- pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
+ mrDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoStyle::~SwXAutoStyle()
{
}
-void SwXAutoStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
+void SwXAutoStyle::Modify(
+ const SfxPoolItem* pOld,
+ const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
+
if(!GetRegisteredIn())
- pSet.reset();
+ {
+ mpSet.reset();
+ }
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( )
- throw (uno::RuntimeException)
+uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo()
+throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySetInfo > xRet;
- switch( eFamily )
+ switch( meFamily )
{
case IStyleAccess::AUTO_STYLE_CHAR:
{
@@ -4401,140 +4803,202 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( )
return xRet;
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXAutoStyle::setPropertyValue( const OUString& /*rPropertyName*/, const uno::Any& /*rValue*/ )
- throw( beans::UnknownPropertyException,
- beans::PropertyVetoException,
- lang::IllegalArgumentException,
- lang::WrappedTargetException,
- uno::RuntimeException)
+void SwXAutoStyle::setPropertyValue(
+ const OUString& /*rPropertyName*/,
+ const uno::Any& /*rValue*/ )
+throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-uno::Any SwXAutoStyle::getPropertyValue( const OUString& rPropertyName )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException )
+uno::Any SwXAutoStyle::getPropertyValue(
+ const OUString& rPropertyName )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
+
return GetPropertyValues_Impl(aProperties).getConstArray()[0];
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXAutoStyle::addPropertyChangeListener( const OUString& /*aPropertyName*/,
- const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException )
+void SwXAutoStyle::addPropertyChangeListener(
+ const OUString& /*aPropertyName*/,
+ const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXAutoStyle::removePropertyChangeListener( const OUString& /*aPropertyName*/,
- const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException )
+void SwXAutoStyle::removePropertyChangeListener(
+ const OUString& /*aPropertyName*/,
+ const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXAutoStyle::addVetoableChangeListener( const OUString& /*PropertyName*/,
- const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException )
+void SwXAutoStyle::addVetoableChangeListener(
+ const OUString& /*PropertyName*/,
+ const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXAutoStyle::removeVetoableChangeListener( const OUString& /*PropertyName*/,
- const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException )
+void SwXAutoStyle::removeVetoableChangeListener(
+ const OUString& /*PropertyName*/,
+ const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setPropertyValues(
- const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
- const uno::Sequence< uno::Any >& /*aValues*/ )
- throw (beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
+ const uno::Sequence< uno::Any >& /*aValues*/ )
+throw (beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl(
- const uno::Sequence< OUString > & rPropertyNames )
- throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
+ const uno::Sequence< OUString > & rPropertyNames )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- if( !pSet.get() )
+ if( !mpSet.get() )
+ {
throw uno::RuntimeException();
- // query_item
+ }
+ // query_item
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
- switch(eFamily)
+
+ switch(meFamily)
{
case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break;
case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break;
case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break;
- default:
- ;
+ default: ;
}
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
const OUString* pNames = rPropertyNames.getConstArray();
-
- sal_Int32 nLen = rPropertyNames.getLength();
+ const sal_Int32 nLen(rPropertyNames.getLength());
uno::Sequence< uno::Any > aRet( nLen );
uno::Any* pValues = aRet.getArray();
-
- SfxItemSet& rSet = *pSet.get();
+ const bool bTakeCareOfDrawingLayerFillStyle(IStyleAccess::AUTO_STYLE_PARA == meFamily);
for( sal_Int32 i = 0; i < nLen; ++i )
{
- const String& rPropName = pNames[i];
+ const OUString& rPropName = pNames[i];
const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(rPropName);
+
if(!pEntry)
+ {
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
- else if ( RES_TXTATR_AUTOFMT == pEntry->nWID || RES_AUTO_STYLE == pEntry->nWID )
+ }
+
+ uno::Any aTarget;
+ bool bDone(false);
+
+ if ( RES_TXTATR_AUTOFMT == pEntry->nWID || RES_AUTO_STYLE == pEntry->nWID )
{
- OUString sName(StylePool::nameOf( pSet ));
- pValues[i] <<= sName;
+ OUString sName(StylePool::nameOf( mpSet ));
+ aTarget <<= sName;
+ bDone = true;
}
- else
- pPropSet->getPropertyValue( *pEntry, rSet, pValues[i] );
+ else if(bTakeCareOfDrawingLayerFillStyle)
+ {
+ //UUUU add support for DrawingLayer FillStyle slots
+ switch(pEntry->nWID)
+ {
+ case RES_BACKGROUND:
+ {
+ const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(*mpSet, RES_BACKGROUND));
+ const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM));
+
+ if(!aOriginalBrushItem.QueryValue(aTarget, nMemberId))
+ {
+ OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
+ }
+
+ bDone = true;
+ break;
+ }
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ const XFillBmpStretchItem* pStretchItem = dynamic_cast< const XFillBmpStretchItem* >(&mpSet->Get(XATTR_FILLBMP_STRETCH));
+ const XFillBmpTileItem* pTileItem = dynamic_cast< const XFillBmpTileItem* >(&mpSet->Get(XATTR_FILLBMP_TILE));
+
+ if( pTileItem && pTileItem->GetValue() )
+ {
+ aTarget <<= drawing::BitmapMode_REPEAT;
+ }
+ else if( pStretchItem && pStretchItem->GetValue() )
+ {
+ aTarget <<= drawing::BitmapMode_STRETCH;
+ }
+ else
+ {
+ aTarget <<= drawing::BitmapMode_NO_REPEAT;
+ }
+
+ bDone = true;
+ break;
+ }
+ }
+ }
+
+ if(!bDone)
+ {
+ pPropSet->getPropertyValue( *pEntry, *mpSet, aTarget );
+ }
+
+ if(bTakeCareOfDrawingLayerFillStyle)
+ {
+ if(pEntry->pType && *(pEntry->pType) == ::getCppuType((const sal_Int16*)0) && *(pEntry->pType) != aTarget.getValueType())
+ {
+ // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
+ sal_Int32 nValue = 0;
+ aTarget >>= nValue;
+ aTarget <<= (sal_Int16)nValue;
+ }
+
+ // check for needed metric translation
+ if(pEntry->nMemberId & SFX_METRIC_ITEM)
+ {
+ bool bDoIt(true);
+
+ if(XATTR_FILLBMP_SIZEX == pEntry->nWID || XATTR_FILLBMP_SIZEY == pEntry->nWID)
+ {
+ // exception: If these ItemTypes are used, do not convert when these are negative
+ // since this means they are intended as percent values
+ sal_Int32 nValue = 0;
+
+ if(aTarget >>= nValue)
+ {
+ bDoIt = nValue > 0;
+ }
+ }
+
+ if(bDoIt)
+ {
+ const SfxItemPool& rPool = mrDoc.GetAttrPool();
+ const SfxMapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
+
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ SvxUnoConvertToMM(eMapUnit, aTarget);
+ }
+ }
+ }
+ }
+
+ // add value
+ pValues[i] = aTarget;
}
+
return aRet;
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXAutoStyle::getPropertyValues (
- const uno::Sequence< ::rtl::OUString >& rPropertyNames )
- throw (uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& rPropertyNames )
+throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Sequence< uno::Any > aValues;
@@ -4556,41 +5020,29 @@ uno::Sequence< uno::Any > SwXAutoStyle::getPropertyValues (
return aValues;
}
-/*-- 19.05.2006 11:24:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::addPropertiesChangeListener(
- const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
- const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
- throw (uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
+ const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
+throw (uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::removePropertiesChangeListener(
- const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
- throw (uno::RuntimeException)
+ const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
+throw (uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::firePropertiesChangeEvent(
- const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
- const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
- throw (uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
+ const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
+throw (uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-beans::PropertyState SwXAutoStyle::getPropertyState( const OUString& rPropertyName )
- throw( beans::UnknownPropertyException,
- uno::RuntimeException)
+beans::PropertyState SwXAutoStyle::getPropertyState(
+ const OUString& rPropertyName )
+throw( beans::UnknownPropertyException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -4601,106 +5053,179 @@ beans::PropertyState SwXAutoStyle::getPropertyState( const OUString& rPropertyNa
return aStates.getConstArray()[0];
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXAutoStyle::setPropertyToDefault( const OUString& /*PropertyName*/ )
- throw( beans::UnknownPropertyException,
- uno::RuntimeException )
+void SwXAutoStyle::setPropertyToDefault(
+ const OUString& /*PropertyName*/ )
+throw( beans::UnknownPropertyException, uno::RuntimeException )
{
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-uno::Any SwXAutoStyle::getPropertyDefault( const OUString& rPropertyName )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException)
+uno::Any SwXAutoStyle::getPropertyDefault(
+ const OUString& rPropertyName )
+throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
+
return getPropertyDefaults ( aSequence ).getConstArray()[0];
}
-/*-- 19.05.2006 11:24:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXAutoStyle::getPropertyStates(
- const uno::Sequence< ::rtl::OUString >& rPropertyNames )
- throw (beans::UnknownPropertyException, uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& rPropertyNames )
+throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- if( !pSet.get() )
+ if( !mpSet.get() )
+ {
throw uno::RuntimeException();
+ }
+
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength());
beans::PropertyState* pStates = aRet.getArray();
const OUString* pNames = rPropertyNames.getConstArray();
-
sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
- switch(eFamily)
+
+ switch(meFamily)
{
case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break;
case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break;
case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break;
- default:
- ;
+ default: ;
}
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
- SfxItemSet& rSet = *pSet.get();
+ const bool bTakeCareOfDrawingLayerFillStyle(IStyleAccess::AUTO_STYLE_PARA == meFamily);
+
for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++)
{
- const String& rPropName = pNames[i];
+ const OUString& rPropName = pNames[i];
const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(rPropName);
+
if(!pEntry)
+ {
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
- pStates[i] = pPropSet->getPropertyState(*pEntry, rSet );
+ }
+
+ bool bDone(false);
+
+ if(bTakeCareOfDrawingLayerFillStyle)
+ {
+ //UUUU DrawingLayer PropertyStyle support
+ switch(pEntry->nWID)
+ {
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ if(SFX_ITEM_SET == mpSet->GetItemState(XATTR_FILLBMP_STRETCH, false)
+ || SFX_ITEM_SET == mpSet->GetItemState(XATTR_FILLBMP_TILE, false))
+ {
+ pStates[i] = beans::PropertyState_DIRECT_VALUE;
+ }
+ else
+ {
+ pStates[i] = beans::PropertyState_AMBIGUOUS_VALUE;
+ }
+
+ bDone = true;
+ break;
+ }
+ case RES_BACKGROUND:
+ {
+ if(SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(*mpSet))
+ {
+ pStates[i] = beans::PropertyState_DIRECT_VALUE;
+ bDone = true;
+ }
+
+ break;
+ }
+ }
+ }
+
+ if(!bDone)
+ {
+ pStates[i] = pPropSet->getPropertyState(*pEntry, *mpSet );
+ }
}
+
return aRet;
}
-/*-- 19.05.2006 11:24:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setAllPropertiesToDefault( )
- throw (uno::RuntimeException)
+throw (uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setPropertiesToDefault(
- const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/ )
- throw (beans::UnknownPropertyException, uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& rPropertyNames )
+throw (beans::UnknownPropertyException, uno::RuntimeException)
{
-}
+ if( !mpSet.get() )
+ {
+ throw uno::RuntimeException();
+ }
-/*-- 19.05.2006 11:24:14---------------------------------------------------
+ const bool bTakeCareOfDrawingLayerFillStyle(IStyleAccess::AUTO_STYLE_PARA == meFamily);
+
+ if(!bTakeCareOfDrawingLayerFillStyle)
+ {
+ return;
+ }
+
+ //UUUU support DrawingLayer FillStyle slots from here on
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ const OUString* pNames = rPropertyNames.getConstArray();
+ sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE;
+
+ switch(meFamily)
+ {
+ case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break;
+ case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break;
+ case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break;
+ default: ;
+ }
+
+ const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
+ const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
+
+ for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++)
+ {
+ const OUString& rPropName = pNames[i];
+ const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(rPropName);
+
+ if(!pEntry)
+ {
+ throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) );
+ }
+
+ switch(pEntry->nWID)
+ {
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ mpSet->ClearItem(XATTR_FILLBMP_STRETCH);
+ mpSet->ClearItem(XATTR_FILLBMP_TILE);
+ }
+ }
+ }
+}
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXAutoStyle::getPropertyDefaults(
- const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/ )
- throw (beans::UnknownPropertyException, lang::WrappedTargetException,
- uno::RuntimeException)
+ const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/ )
+throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
uno::Sequence< uno::Any > aRet(0);
+
return aRet;
}
-/*-- 19.05.2006 11:24:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::RuntimeException)
+uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties()
+throw (uno::RuntimeException)
{
- if( !pSet.get() )
+ if( !mpSet.get() )
throw uno::RuntimeException();
vos::OGuard aGuard(Application::GetSolarMutex());
std::vector< beans::PropertyValue > aPropertyVector;
sal_Int8 nPropSetId = 0;
- switch(eFamily)
+ switch(meFamily)
{
case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break;
case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break;
@@ -4729,7 +5254,7 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
// ++aIt;
// }
- SfxItemSet& rSet = *pSet.get();
+ SfxItemSet& rSet = *mpSet.get();
SfxItemIter aIter(rSet);
const SfxPoolItem* pItem = aIter.FirstItem();
@@ -4787,3 +5312,6 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
return aRet;
}
+
+//////////////////////////////////////////////////////////////////////////////
+//eof
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 2d2d1fd32852..38be49a908e9 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1685,7 +1685,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
{
// todo: if the start/end is in a table then insert a paragraph
// before/after, move the start/end nodes, then convert and
- // remove the addtional paragraphs in the end
+ // remove the additional paragraphs in the end
if (pStartStartNode->GetStartNodeType() == SwTableBoxStartNode)
{
SwTableNode *const pSartTableNode(pStartStartNode->FindTableNode());
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index ac80cf40d4df..c3aecf8fcbeb 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -19,12 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svx/fmmodel.hxx>
#include <svx/svdpage.hxx>
#include <tools/shl.hxx>
@@ -34,15 +31,10 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <svx/svdlegacy.hxx>
-
-/// OD 29.08.2002 #102450#
-/// include <svx/svdoutl.hxx>
#include <svx/svdoutl.hxx>
-
#ifdef DBG_UTIL
#include <svx/fmglob.hxx>
#endif
-
#include "fesh.hxx"
#include "pagefrm.hxx"
#include "rootfrm.hxx"
@@ -54,9 +46,8 @@
#include "dview.hxx"
#include "flyfrm.hxx"
#include <vcl/svapp.hxx>
-
#include <IDocumentDrawModelAccess.hxx>
-
+#include <drawdoc.hxx>
/*************************************************************************
|*
@@ -148,7 +139,7 @@ void SwViewImp::UnlockPaint()
|*
|*************************************************************************/
// OD 29.08.2002 #102450#
-// add 3rd paramter <const Color* pPageBackgrdColor> for setting this
+// add 3rd parameter <const Color* pPageBackgrdColor> for setting this
// color as the background color at the outliner of the draw view.
// OD 09.12.2002 #103045# - add 4th parameter for the horizontal text direction
// of the page in order to set the default horizontal text direction at the
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 8e7dd6ecce69..0f01cea6d052 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -19,12 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include "crsrsh.hxx"
#include "rootfrm.hxx"
#include "pagefrm.hxx"
@@ -41,10 +38,7 @@
#include <swmodule.hxx>
#include <svx/svdpage.hxx>
#include <accmap.hxx>
-
-// OD 12.12.2002 #103492#
#include <pagepreviewlayout.hxx>
-
#include <comcore.hrc>
#include <svx/svdundo.hxx>
#include <IDocumentLayoutAccess.hxx>
@@ -52,6 +46,7 @@
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
/*************************************************************************
|*
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 4d7f95609d45..42560481d74b 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -72,6 +72,7 @@
#include <svx/sdrpaintwindow.hxx>
#include <svx/fmmodel.hxx>
#include <vcl/dibtools.hxx>
+#include <drawdoc.hxx>
sal_Bool ViewShell::bLstAct = sal_False;
ShellResource *ViewShell::pShellRes = 0;
@@ -852,7 +853,7 @@ void ViewShell::SetAddExtLeading( bool bNew )
{
SwWait aWait( *GetDoc()->GetDocShell(), true );
pIDSA->set(IDocumentSettingAccess::ADD_EXT_LEADING, bNew );
- SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
if ( pTmpDrawModel )
pTmpDrawModel->SetAddExtLeading( bNew );
const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
@@ -986,7 +987,7 @@ void ViewShell::Reformat()
void ViewShell::ChgNumberDigits()
{
- SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
if ( pTmpDrawModel )
pTmpDrawModel->ReformatAllTextObjects();
Reformat();
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 58547fc7b3f8..ae945c5fc374 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -199,7 +199,7 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::SwViewShell" );
// OD 2004-06-01 #i26791# - in order to suppress event handling in
- // <SwDrawContact::Notify> during contruction of <ViewShell> instance
+ // <SwDrawContact::Changed> during construction of <ViewShell> instance
mbInConstructor = true;
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
@@ -278,7 +278,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::SwViewShell" );
// OD 2004-06-01 #i26791# - in order to suppress event handling in
- // <SwDrawContact::Notify> during contruction of <ViewShell> instance
+ // <SwDrawContact::Changed> during construction of <ViewShell> instance
mbInConstructor = true;
bPaintWorks = bEnableSmooth = sal_True;
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 70843edf803f..b2b69b1e6e6b 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -190,14 +190,9 @@ void SwPaintQueue::Remove( ViewShell *pSh )
}
}
-/******************************************************************************
- * Methode : void SetSwVisArea( ViewShell *pSh, Point aPrtOffset, ...
- * Beschreibung:
- * Erstellt : OK 04.11.94 16:27
- * Aenderung :
- ******************************************************************************/
+// ******************************************************************************
-void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, sal_Bool /*bPDFExport*/ )
+void SetSwVisArea( ViewShell *pSh, const SwRect &rRect /*, sal_Bool bPDFExport*/ )
{
ASSERT( !pSh->GetWin(), "Drucken mit Window?" );
pSh->aVisArea = rRect;
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index b5f7fc283b8d..1c506f186ec8 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -206,7 +206,7 @@ sal_uLong SwASCIIParser::CallParser()
{
// Using the pool defaults for the font causes significant
// trouble for the HTML filter, because it is not able
- // to export the pool defaults (or to be more precice:
+ // to export the pool defaults (or to be more precise:
// the HTML filter is not able to detect whether a pool
// default has changed or not. Even a comparison with the
// HTMLi template does not work, because the defaults are
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index c205002aa4f2..f20152ebc69f 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -575,7 +575,7 @@ void SwRelNumRuleSpaces::SetNumLSpace( SwTxtNode& rNd, const SwNumRule& rRule )
nParaLeft -= nLeft;
else
//#83154#, Don't think any of the older #80856# bugfix code is
- //relevent anymore.
+ //relevant anymore.
nParaLeft = rLR.GetTxtLeft()+rLR.GetTxtFirstLineOfst();
aLR.SetTxtLeft( nParaLeft );
}
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 18ef2465cdc6..d53fd631aa92 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2014,7 +2014,7 @@ void HTMLEndPosLst::Insert( const SfxPoolItem& rItem,
}
// the hint starts before the next script change and ends behind
- // it, so we can insert a hint upto the next script change and
+ // it, so we can insert a hint up to the next script change and
// continue with the rest of the hint.
if( bDependsOnAnyScript || nScript == aScriptLst[i] )
InsertNoScript( rItem, nPos, nChgPos, rFmtInfos, bParaAttrs );
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx
index 388d48ce863d..de2b622e5dee 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldraw.cxx
@@ -59,6 +59,7 @@
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
#include <svx/sdrobjectfactory.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
@@ -396,7 +397,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
// Ein DrawTxtobj anlegen
// --> OD 2005-08-08 #i52858# - method name changed
- SdrModel* pModel = pDoc->GetOrCreateDrawModel();
+ SwDrawModel* pModel = pDoc->GetOrCreateDrawModel();
// <--
SdrPage* pPg = pModel->GetPage( 0 );
pMarquee = SdrObjFactory::MakeNewObject( *pModel, SdrObjectCreationInfo(OBJ_TEXT, SdrInventor));
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 74fe5b37ac8c..5ea1c18b39c7 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1297,7 +1297,7 @@ sal_Bool SwHTMLParser::HasCurrentParaBookmarks( sal_Bool bIgnoreStack ) const
if( !bHasMarks )
{
- // second step: when we didnt find a bookmark, check if there is one set already
+ // second step: when we didn't find a bookmark, check if there is one set already
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
ppMark != pMarkAccess->getAllMarksEnd();
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 7ee3f08c5fa1..6292eb3948dd 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -604,7 +604,7 @@ void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_cols) += '=')
+= ByteString::CreateFromInt32( pCol->GetNumCols() );
- // minumum gutter width
+ // minimum gutter width
sal_uInt16 nGutter = pCol->GetGutterWidth( sal_True );
if( nGutter!=USHRT_MAX )
{
@@ -678,7 +678,7 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd )
if( lcl_html_IsMultiColEnd( rHTMLWrt, nSectEndIdx-1 ) )
bEndTag = sal_False;
- //.is there a columned section arround this one?
+ //.is there a columned section around this one?
const SwStartNode *pSttNd = rSectNd.StartOfSectionNode();
if( pSttNd )
{
@@ -700,7 +700,7 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd )
}
// The surrounding section must be closed before the current one is
- // opended, except that it start immediatly before the current one or
+ // opended, except that it start immediately before the current one or
// another end immediately before the current one
if( pSurrCol && nSectSttIdx - pSurrSectNd->GetIndex() > 1 &&
!lcl_html_IsMultiColEnd( rHTMLWrt, nSectSttIdx-1 ) )
diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx
index 007e77f72694..91687f9f9685 100644
--- a/sw/source/filter/inc/msfilter.hxx
+++ b/sw/source/filter/inc/msfilter.hxx
@@ -199,7 +199,7 @@ namespace sw
alternative name for one of them..
And it needs to report to the importer if the style being mapped to
- was already in existance, for the cut and paste/insert file mode we
+ was already in existence, for the cut and paste/insert file mode we
should not modify the returned style if it is already in use as it
is does not belong to us to change.
@@ -259,7 +259,7 @@ namespace sw
alternative name for one of them..
And it needs to report to the importer if the style being mapped to
- was already in existance, for the cut and paste/insert file mode we
+ was already in existence, for the cut and paste/insert file mode we
should not modify the returned style if it is already in use as it
is does not belong to us to change.
@@ -495,7 +495,7 @@ namespace sw
Word generally requires characters which share the same direction,
the same script, and occasionally (depending on the format) the
- same charset to be exported in independant chunks.
+ same charset to be exported in independent chunks.
So this function finds these ranges and returns a STL container
of CharRuns
@@ -512,7 +512,7 @@ namespace sw
RTF format, not necessary for a unicode aware format like WW8+
@return STL container of CharRuns which describe the shared
- direction, script and optionally script of the contigious sequences
+ direction, script and optionally script of the contiguous sequences
of characters
@author
diff --git a/sw/source/filter/inc/wwstyles.hxx b/sw/source/filter/inc/wwstyles.hxx
index 95f82db1d6f2..699c5a01a2fe 100644
--- a/sw/source/filter/inc/wwstyles.hxx
+++ b/sw/source/filter/inc/wwstyles.hxx
@@ -143,7 +143,7 @@ namespace ww
/** Find the WinWord sti index of an english style name.
- When importing a RTF document we would like to treat styles as similiar
+ When importing a RTF document we would like to treat styles as similar
to how word does as possible, to this end word will treat some styles
with special names as inbuilt styles, and some as user defined styles.
@@ -169,7 +169,7 @@ namespace ww
/** Find the WinWord sti index of an old <= Word2 stc (style code)
When importing a Word 2 document we would like to treat styles as
- similiar to how word 8 does as possible, to this end word will treat
+ similar to how word 8 does as possible, to this end word will treat
some styles with special codes as inbuilt styles, and some as user
defined styles.
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 07530fc2f3ba..ff9840caac18 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
#include <hintids.hxx>
#include <tools/list.hxx>
@@ -61,18 +60,14 @@
#include <deque>
#include <map>
#include <utility>
-// --> OD 2004-06-30 #i27767#
#include <fmtwrapinfluenceonobjpos.hxx>
-// <--
#include <editeng/brshitem.hxx>
#include <fmtfollowtextflow.hxx>
-// --> OD, FLR 2006-02-16 #131205#
#include "dcontact.hxx"
-// <--
+#include <drawdoc.hxx>
#include <svx/svdpage.hxx>
#include <svx/fmmodel.hxx>
-
using namespace ::com::sun::star;
#define ANCHOR(p) ((SwFmtAnchor*)p)
@@ -322,7 +317,7 @@ void SwRTFParser::SetFlysInDoc()
{
// Take care for table nodes
pNd = pNd->GetNodes()[ pNd->GetIndex() - 2 ]->GetTableNode();
- if( pNd ) // if the table starts imediately before aRg -> expand aRg
+ if( pNd ) // if the table starts immediately before aRg -> expand aRg
aRg.aStart = *pNd;
if( bMakeEmptySection )
@@ -407,7 +402,7 @@ void SwRTFParser::SetFlysInDoc()
// THIS >>>>>
// if the section only contains one Node and this has a
- // border or backgorund, then put it to the frame
+ // border or background, then put it to the frame
// Not in our own RTF-Format!
// <<<<< DOES NOT MAKE SENSE TO ME (flr)
// #102781#. Added support for transparent frames.
@@ -541,7 +536,7 @@ void SwRTFParser::SetFlysInDoc()
aFlyArr.Remove(0, aFlyArr.Count());
}
-// clips the text box to the min or max position if it is outside our min or max boundry
+// clips the text box to the min or max position if it is outside our min or max boundary
long SwRTFParser::GetSafePos(long nPos)
{
if(nPos > SHRT_MAX)
@@ -1281,8 +1276,6 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
if( pFlySave->nEndNd == rIdx )
pFlySave->nEndNd = rIdx.GetIndex() - 1;
}
-
- pGrfNd->onGraphicChanged();
}
}
else
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 539626a74717..bbdf0de7b92e 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -19,15 +19,12 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
#include <hintids.hxx>
-
#include <stack>
-
#include <tools/errinf.hxx>
#include <tools/stream.hxx>
#include <svl/itemiter.hxx>
@@ -82,14 +79,11 @@
#include <statstr.hrc> // ResId fuer Statusleiste
#include <SwStyleNameMapper.hxx>
#include <tblsel.hxx> // SwSelBoxes
-
#include <docsh.hxx>
#include <fmtlsplt.hxx> // SwLayoutSplit
#include <editeng/keepitem.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdorect.hxx>
-
-
#include <fmtsrnd.hxx>
#include <fmtfollowtextflow.hxx>
#include <svx/svdmodel.hxx>
@@ -101,21 +95,18 @@
#include <svx/svdoutl.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/paperinf.hxx>
-
#include <tools/stream.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/range/b2drange.hxx>
#include <vcl/salbtype.hxx> // FRound
-
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
-
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
-
// einige Hilfs-Funktionen
// char
inline const SvxFontHeightItem& GetSize(const SfxItemSet& rSet,sal_Bool bInP=sal_True)
@@ -1034,7 +1025,7 @@ void rtfSections::InsertSegments(bool bNewDoc)
aSectPaM.GetCntntNode(), 0);
SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter);
- //The last section if continous is always unbalanced
+ //The last section if continuous is always unbalanced
if (aNext == aEnd && pRet)
pRet->SetFmtAttr(SwFmtNoBalancedColumns(true));
}
@@ -1334,7 +1325,7 @@ void SwRTFParser::InsertShpObject(SdrObject* pStroke, int _nZOrder)
aFlySet.Put(SvxOpaqueItem(RES_OPAQUE,false));
pDoc->GetOrCreateDrawModel();
- SdrModel* pDrawModel = pDoc->GetDrawModel();
+ SwDrawModel* pDrawModel = pDoc->GetDrawModel();
SdrPage* pDrawPg = pDrawModel->GetPage(0);
pDrawPg->InsertObjectToSdrObjList(*pStroke);
pDrawPg->SetNavigationPosition(pStroke->GetNavigationPosition(), _nZOrder);
@@ -3930,11 +3921,10 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, sal_uInt16 nPos,
if( !nPos )
{
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
- //pColl->SetOutlineLevel( nOutlineLevel ); //#outline level,removed by zhaojianwei
- if(nOutlineLevel < MAXLEVEL ) //->add by zhaojianwei
+ if ( nOutlineLevel < MAXLEVEL )
pColl->AssignToListLevelOfOutlineStyle( nOutlineLevel );
else
- pColl->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,zhaojianwei
+ pColl->DeleteAssignmentToListLevelOfOutlineStyle();
return pColl;
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5a1a80b76f92..a31b1459faef 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1149,7 +1149,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
TableBackgrounds( pTableTextNodeInfoInner );
- // Cell prefered width
+ // Cell preferred width
SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )[ pTableTextNodeInfoInner->getCell() ];
m_pSerializer->singleElementNS( XML_w, XML_tcW,
FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nWidth ) ).getStr( ),
@@ -1293,7 +1293,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
// Create the SwWriteTable instance to use col spans (and maybe other infos)
GetTablePageSize( pTableTextNodeInfoInner, nPageSize, bRelBoxSize );
- // Output the table prefered width
+ // Output the table preferred width
if ( nPageSize != 0 )
m_pSerializer->singleElementNS( XML_w, XML_tblW,
FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nPageSize ) ).getStr( ),
@@ -1696,7 +1696,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
bool bSwapInPage = false;
if ( !pSdrObj->GetPage() )
{
- if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() )
+ if ( SwDrawModel* pModel = m_rExport.pDoc->GetDrawModel() )
{
if ( SdrPage *pPage = pModel->GetPage( 0 ) )
{
diff --git a/sw/source/filter/ww8/dump/msvbasic.cxx b/sw/source/filter/ww8/dump/msvbasic.cxx
index a4167beb9dc5..20f7462c3e9e 100644
--- a/sw/source/filter/ww8/dump/msvbasic.cxx
+++ b/sw/source/filter/ww8/dump/msvbasic.cxx
@@ -204,7 +204,7 @@ int VBA_Impl::ReadVBAProject(const SvStorageRef &rxVBAStorage)
//most begin with */G , and sometimes with
//*/C. Those with G always have a trailer of 12 bytes, those
//with C come in pairs, the first with no trailer, and the
- //second with one of 12 bytes. The following code attemts
+ //second with one of 12 bytes. The following code attempts
//to read these strings and ends when it reaches a sequence of
//bytes which fails a test to be a valid string. So this
//while loop here is the particular piece of code which is
diff --git a/sw/source/filter/ww8/dump/ww8scan.cxx b/sw/source/filter/ww8/dump/ww8scan.cxx
index f8370983fc77..72716d4b2e07 100644
--- a/sw/source/filter/ww8/dump/ww8scan.cxx
+++ b/sw/source/filter/ww8/dump/ww8scan.cxx
@@ -4554,7 +4554,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart)
settings its end to the current start, then store the starting
position of the current range to clipstart. The pPcd sprms
will end as normal (albeit earlier than originally expected),
- and the existance of a clipstart will force the pPcd iterater
+ and the existence of a clipstart will force the pPcd iterater
to reread the current set of sprms instead of advancing to its
next set. Then the clipstart will be set as the starting
position which will force them to be applied directly after
@@ -4586,7 +4586,7 @@ void WW8PLCFMan::AdvNoSprm(short nIdx, bool bStart)
{
/*
For the case of a piece table we slave the piece table attribute iterator
- to the piece table and access it through that only. They are two seperate
+ to the piece table and access it through that only. They are two separate
structures, but act together as one logical one. The attributes only go
to the next entry when the piece changes
*/
@@ -5793,7 +5793,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
break;
nMax++;
nLeft -= nNextSiz;
- if( nLeft < 1 ) // can we read the given ammount of bytes ?
+ if( nLeft < 1 ) // can we read the given amount of bytes ?
break;
// increase p by nNextSiz Bytes
p = (WW8_FFN *)( ( (sal_uInt8*)p ) + nNextSiz );
@@ -5922,9 +5922,9 @@ WW8PLCF_HdFt::WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop )
footnote *and endnote!!* seperator,continuation seperator, and
continuation notice entry, the documentation does not mention the
endnote seperators, the documentation also gets the index numbers
- backwards when specifiying which bits to test. The bottom six bits
+ backwards when specifying which bits to test. The bottom six bits
of this value must be tested and skipped over. Each section's
- grpfIhdt is then tested for the existence of the appropiate headers
+ grpfIhdt is then tested for the existence of the appropriate headers
and footers, at the end of each section the nIdxOffset must be updated
to point to the beginning of the next section's group of headers and
footers in this PLCF, UpdateIndex does that task.
@@ -6574,7 +6574,7 @@ sal_uInt16 wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
nL = SVBT16ToShort( &pSprm[1 + mnDelta] ) + aSprm.nLen - 1;
break;
default:
- ASSERT(!this, "Unknown sprm varient");
+ ASSERT(!this, "Unknown sprm variant");
break;
}
break;
diff --git a/sw/source/filter/ww8/dump/ww8scan.hxx b/sw/source/filter/ww8/dump/ww8scan.hxx
index a7261c1aeedb..6c1b0ec5de92 100644
--- a/sw/source/filter/ww8/dump/ww8scan.hxx
+++ b/sw/source/filter/ww8/dump/ww8scan.hxx
@@ -1314,15 +1314,15 @@ public:
sal_uInt16 fWriteReservation : 1;
sal_uInt16 fLockRev : 1; // when 1, the current revision marking state is locked
sal_uInt16 fEmbedFonts : 1; // when 1, document contains embedded True Type fonts
- // compatability options
+ // compatibility options
sal_uInt16 copts_fNoTabForInd : 1; // when 1, don�t add automatic tab stops for hanging indent
sal_uInt16 copts_fNoSpaceRaiseLower : 1; // when 1, don�t add extra space for raised or lowered characters
- sal_uInt16 copts_fSupressSpbfAfterPgBrk : 1; // when 1, supress the paragraph Space Before and Space After options after a page break
+ sal_uInt16 copts_fSupressSpbfAfterPgBrk : 1; // when 1, suppress the paragraph Space Before and Space After options after a page break
sal_uInt16 copts_fWrapTrailSpaces : 1; // when 1, wrap trailing spaces at the end of a line to the next line
sal_uInt16 copts_fMapPrintTextColor : 1; // when 1, print colors as black on non-color printers
sal_uInt16 copts_fNoColumnBalance : 1; // when 1, don�t balance columns for Continuous Section starts
sal_uInt16 copts_fConvMailMergeEsc : 1;
- sal_uInt16 copts_fSupressTopSpacing : 1; // when 1, supress extra line spacing at top of page
+ sal_uInt16 copts_fSupressTopSpacing : 1; // when 1, suppress extra line spacing at top of page
sal_uInt16 copts_fOrigWordTableRules : 1; // when 1, combine table borders like Word 5.x for the Macintosh
sal_uInt16 copts_fTransparentMetafiles : 1; // when 1, don�t blank area between metafile pictures
sal_uInt16 copts_fShowBreaksInFrames : 1; // when 1, show hard page or column breaks in frames
@@ -1372,7 +1372,7 @@ public:
/*
bei nFib >= 103 gehts weiter:
*/
- sal_uInt32 fNoTabForInd :1; // see above in compatability options
+ sal_uInt32 fNoTabForInd :1; // see above in compatibility options
sal_uInt32 fNoSpaceRaiseLower :1; // see above
sal_uInt32 fSupressSpbfAfterPageBreak :1; // see above
sal_uInt32 fWrapTrailSpaces :1; // see above
diff --git a/sw/source/filter/ww8/dump/ww8struc.hxx b/sw/source/filter/ww8/dump/ww8struc.hxx
index 06bf9e1dc8dc..25082ef9875c 100644
--- a/sw/source/filter/ww8/dump/ww8struc.hxx
+++ b/sw/source/filter/ww8/dump/ww8struc.hxx
@@ -776,7 +776,7 @@ eigentlich muessten wir das jetzt in etwa *so* praezisieren:
};
*/
-// AnnoTation Refernce Descriptor (ATRD)
+// AnnoTation References Descriptor (ATRD)
struct WW8_ATRD // fuer die 8-Version
{
SVBT16 xstUsrInitl[ 10 ]; // pascal-style String holding initials
diff --git a/sw/source/filter/ww8/needed_cast.hxx b/sw/source/filter/ww8/needed_cast.hxx
index 90c7d77cebf0..5d16e4d4d532 100644
--- a/sw/source/filter/ww8/needed_cast.hxx
+++ b/sw/source/filter/ww8/needed_cast.hxx
@@ -44,7 +44,7 @@ namespace ww
/*
needed_cast is the same as static_cast except that there will be a compile
time assert when NDEBUG is not defined and the in and out types are the
- same. i.e. needed_cast catches unneccessary casts
+ same. i.e. needed_cast catches unnecessary casts
*/
template<typename Ret, typename Param> Ret needed_cast(Param in)
{
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 9f4dd360387c..05f9e05b7d7f 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -19,7 +19,8 @@
*
*************************************************************/
-
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
#include "rtfattributeoutput.hxx"
#include "rtfexport.hxx"
@@ -34,14 +35,10 @@
#include "fmtruby.hxx"
#include "charfmt.hxx"
#include "breakit.hxx"
-
#include <i18npool/mslangid.hxx>
-
#include <hintids.hxx>
-
#include <svl/poolitem.hxx>
#include <svtools/rtfkeywd.hxx>
-
#include <editeng/fontitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/adjitem.hxx>
@@ -86,7 +83,6 @@
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
#include <filter/msfilter/msoleexp.hxx>
-
#include <docufld.hxx>
#include <flddropdown.hxx>
#include <format.hxx>
@@ -116,23 +112,19 @@
#include <ndole.hxx>
#include <lineinfo.hxx>
#include <rtf.hxx>
-
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.hxx>
-
#include <tools/color.hxx>
-
#include <vcl/cvtgrf.hxx>
-
#include <com/sun/star/i18n/ScriptType.hdl>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNamed.hpp>
-
#include <osl/diagnose.h>
+#include <drawdoc.hxx>
using rtl::OString;
using rtl::OStringBuffer;
@@ -418,7 +410,7 @@ void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
OSL_TRACE("%s", OSL_THIS_FUNC);
/*
You would have thought that
- m_rExport.Strm() << (bIsRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here ,
+ m_rExport.Strm() << (bIsRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficient here ,
but looks like word needs to see the other directional token to be
satisified that all is kosher, otherwise it seems in ver 2003 to go and
semi-randomlyly stick strike through about the place. Perhaps
@@ -1730,14 +1722,14 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
if ( pSdrObj )
{
//bool bSwapInPage = false;
- //if ( !pSdrObj->getSdrPageFromSdrObject() )
+ //if ( !pSdrObj->GetPage() )
//{
- // if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() )
+ // if ( SwDrawModel* pModel = m_rExport.pDoc->GetDrawModel() )
// {
// if ( SdrPage *pPage = pModel->GetPage( 0 ) )
// {
// bSwapInPage = true;
- // //const_cast< SdrObject* >( pSdrObj )->SetPage( pPage );
+ // const_cast< SdrObject* >( pSdrObj )->SetPage( pPage );
// }
// }
//}
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index e4c0f2ec3643..91fe7010af5c 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -486,7 +486,7 @@ sal_Int32 RtfSdrExport::StartShape()
/*
#i13885#
When the object is actively being edited, that text is not set into
- the objects normal text object, but lives in a seperate object.
+ the objects normal text object, but lives in a separate object.
*/
if (pTxtObj->IsTextEditActive())
{
diff --git a/sw/source/filter/ww8/staticassert.hxx b/sw/source/filter/ww8/staticassert.hxx
index f5ed3fc0d466..ae793111be01 100644
--- a/sw/source/filter/ww8/staticassert.hxx
+++ b/sw/source/filter/ww8/staticassert.hxx
@@ -45,7 +45,7 @@ namespace ww
}
/*
- Similiar to assert, StaticAssert is only in operation when NDEBUG is not
+ Similar to assert, StaticAssert is only in operation when NDEBUG is not
defined. It will test its first argument at compile time and on failure
report the error message of the second argument, which must be a valid c++
classname. i.e. no spaces, punctuation or reserved keywords.
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index f96567ae768c..aa10ef059e9e 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -636,7 +636,7 @@ namespace sw
e.g. Page Anchored elements will not be. For the winword export we
need them to have something to be anchored to. So this method
returns all the floating elements in a document as a STL container
- of sw::Frames which are guaranteed to have an appropiate anchor.
+ of sw::Frames which are guaranteed to have an appropriate anchor.
@param rDoc
The SwDoc document to get the styles from
@@ -786,7 +786,7 @@ namespace sw
Word has the simple concept of a drawing object either in the
foreground and in the background. We have an additional complexity
- that form components live in a seperate layer, which seems
+ that form components live in a separate layer, which seems
unnecessarily complicated. So in the winword filter we set the
object's layer through this class with either SendObjectToHell for
the bottom layer and SendObjectToHeaven for the top and we don't
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 3b34697ce3e1..0f04d9c761ba 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -67,7 +67,7 @@ namespace myImplHelpers
/*
#98506#
The normal case for reexporting word docs is to have dynamic spacing,
- as this is word's only setting, and the reason for the existance of the
+ as this is word's only setting, and the reason for the existence of the
dynamic spacing features. If we have dynamic spacing active then we can
add its spacing to the value height of the h/f and get the wanted total
size for word.
@@ -116,7 +116,7 @@ namespace myImplHelpers
/*
SwTxtFmtColl and SwCharFmt are quite distinct types and how they are
gotten is also distinct, but the algorithm to match word's eqivalents into
- them is the same, so we put the different stuff into two seperate helper
+ them is the same, so we put the different stuff into two separate helper
implementations and a core template that uses the helpers that uses the
same algorithm to do the work. We'll make the helpers specializations of a
non existing template so I can let the compiler figure out the right one
@@ -615,7 +615,7 @@ namespace sw
if (bSplitOnCharSet)
{
- //Split unicode text into plausable 8bit ranges for export to
+ //Split unicode text into plausible 8bit ranges for export to
//older non unicode aware format
xub_StrLen nLen = rTxt.Len();
xub_StrLen nPos = 0;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 47c21884c4da..814b20a367f9 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -19,16 +19,12 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
#include <com/sun/star/embed/Aspects.hpp>
-
-
#include <hintids.hxx>
-
#define _SVSTDARR_ULONGSSORT
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
@@ -56,27 +52,21 @@
#include <editeng/editeng.hxx>
#ifndef _SVX_FLDITEM_HXX
//miserable hack to get around #98519#
-
#include <editeng/flditem.hxx>
#endif
-
#include <comphelper/seqstream.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <svtools/filter.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
#include <svx/unoapi.hxx>
-
-// #i71538#
#include <svx/svdview.hxx>
#include <fmtcnct.hxx>
#include <fmtanchr.hxx>
#include <fmtsrnd.hxx>
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
-// --> OD 2005-01-06 #i30669#
#include <fmtfollowtextflow.hxx>
-// <--
#include <dcontact.hxx>
#include <frmfmt.hxx>
#include <fmtcntnt.hxx>
@@ -98,9 +88,7 @@
#include "writerwordglue.hxx"
#include "wrtww8.hxx"
#include "escher.hxx"
-// --> OD 2007-07-24 #148096#
#include <ndtxt.hxx>
-// <--
#include "WW8FFData.hxx"
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
@@ -112,6 +100,7 @@
#include "sfx2/sfxsids.hrc"
#include <svl/urihelper.hxx>
#include <unotools/saveopt.hxx>
+#include <drawdoc.hxx>
using namespace com::sun::star;
using namespace sw::util;
@@ -867,7 +856,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
SwTwips nLeft = aRect.Left() + nThick;
SwTwips nRight = aRect.Right() - nThick;
- //Nasty swap for bidi if neccessary
+ //Nasty swap for bidi if necessary
rWrt.MiserableRTLFrmFmtHack(nLeft, nRight, rFrmFmt);
//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor
@@ -1070,7 +1059,7 @@ sal_uInt32 WW8Export::GetSdrOrdNum( const SwFrmFmt& rFmt ) const
SwFrmFmt* pFmt = (SwFrmFmt*)&rFmt;
nOrdNum = pDoc->GetSpzFrmFmts()->GetPos( pFmt );
- const SdrModel* pModel = pDoc->GetDrawModel();
+ const SwDrawModel* pModel = pDoc->GetDrawModel();
if( pModel )
nOrdNum += pModel->GetPage( 0 )->GetObjCount();
}
@@ -1421,7 +1410,7 @@ void WW8Export::WriteSdrTextObj(const SdrObject& rObj, sal_uInt8 nTyp)
/*
#i13885#
When the object is actively being edited, that text is not set into
- the objects normal text object, but lives in a seperate object.
+ the objects normal text object, but lives in a separate object.
*/
if (pTxtObj->IsTextEditActive())
{
@@ -2260,7 +2249,7 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeType
void SwBasicEscherEx::Init()
{
MapUnit eMap = MAP_TWIP;
- if (SdrModel *pModel = rWrt.pDoc->GetDrawModel())
+ if (SwDrawModel* pModel = rWrt.pDoc->GetDrawModel())
{
// PPT arbeitet nur mit Einheiten zu 576DPI
// WW hingegen verwendet twips, dh. 1440DPI.
@@ -2383,7 +2372,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
bool bSwapInPage = false;
if (!pSdrObj->getSdrPageFromSdrObject())
{
- if (SdrModel* pModel = rWrt.pDoc->GetDrawModel())
+ if (SwDrawModel* pModel = rWrt.pDoc->GetDrawModel())
{
if (SdrPage *pPage = pModel->GetPage(0))
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 280327310a0f..3d7fb2593911 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -525,7 +525,7 @@ void WW8SwAttrIter::OutAttr( xub_StrLen nSwPos )
}
/*
- For #i24291# we need to explictly remove any properties from the
+ For #i24291# we need to explicitly remove any properties from the
aExportSet which a SwCharFmt would override, we can't rely on word doing
this for us like writer does
*/
@@ -1678,10 +1678,15 @@ bool MSWordExportBase::GetBookmarks(
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
sal_uLong nNd = rNd.GetIndex( );
- const sal_Int32 nMarks = pMarkAccess->getCommonMarksCount();
+ const sal_Int32 nMarks = pMarkAccess->getAllMarksCount();
for ( sal_Int32 i = 0; i < nMarks; i++ )
{
- IMark* pMark = ( pMarkAccess->getCommonMarksBegin() + i )->get();
+ IMark* pMark = ( pMarkAccess->getAllMarksBegin() + i )->get();
+
+ if ( IDocumentMarkAccess::GetType( *(pMark) ) == IDocumentMarkAccess::ANNOTATIONMARK )
+ {
+ continue;
+ }
// Only keep the bookmarks starting or ending in this node
if ( pMark->GetMarkStart().nNode == nNd ||
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 7e2febdd18a1..7e1faa2a263b 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -402,7 +402,7 @@ void MSWordStyles::SetStyleDefaults( const SwFmt& rFmt, bool bPap )
{
//If we are a character property then see if it is one of the
//western/asian ones that must be collapsed together for export to
- //word. If so default to the western varient.
+ //word. If so default to the western variant.
if ( bPap || m_rExport.CollapseScriptsforWordOk(
i18n::ScriptType::LATIN, n) )
{
@@ -1582,7 +1582,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
AttrOutput().OutputStyleItemSet( aSet, true, bOutPgDscSet );
// <--
- //Cannot export as normal page framedir, as continous sections
+ //Cannot export as normal page framedir, as continuous sections
//cannot contain any grid settings like proper sections
AttrOutput().SectionBiDi( FRMDIR_HORI_RIGHT_TOP == TrueFrameDirection( *rSepInfo.pSectionFmt ) );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 1946c1924481..5ce03c9d2ee2 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -19,31 +19,23 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
#include <iostream>
-
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <unotools/ucbstreamhelper.hxx>
-
#include <algorithm>
-
#include <map>
#include <set>
-
#include <hintids.hxx>
#include <string.h> // memcpy()
#include <osl/endian.h>
#include <docsh.hxx>
-
#define _SVSTDARR_BOOLS
#include <svl/svstdarr.hxx>
-
#include <unotools/fltrcfg.hxx>
#include <vcl/salbtype.hxx>
#include <sot/storage.hxx>
@@ -97,19 +89,14 @@
#include <comphelper/extract.hxx>
#include <comphelper/stlunosequence.hxx>
#include <writerfilter/doctok/sprmids.hxx>
-
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
#include "ww8attributeoutput.hxx"
-
#include <IDocumentMarkAccess.hxx>
#include <xmloff/odffields.hxx>
-
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
-
#include "dbgoutsw.hxx"
-
#include <sfx2/docfile.hxx>
#include <sfx2/request.hxx>
#include <sfx2/frame.hxx>
@@ -123,9 +110,8 @@
#include <editeng/charrotateitem.hxx>
#include "WW8FibData.hxx"
#include "numrule.hxx"
-
#include <boost/scoped_ptr.hpp>
-
+#include <drawdoc.hxx>
using namespace sw::util;
using namespace sw::types;
@@ -349,7 +335,7 @@ static void WriteDop( WW8Export& rWrt )
{
WW8Dop& rDop = *rWrt.pDop;
- // i#78951#, store the value of unknown compatability options
+ // i#78951#, store the value of unknown compatibility options
rDop.SetCompatabilityOptions( rWrt.pDoc->Getn32DummyCompatabilityOptions1());
rDop.SetCompatabilityOptions2( rWrt.pDoc->Getn32DummyCompatabilityOptions2());
@@ -2868,7 +2854,7 @@ void WW8Export::WriteFkpPlcUsw()
if (pEscher || pDoc->ContainsMSVBasic())
{
/*
- #82587# Everytime MS 2000 creates an escher stream there is always
+ #82587# Every time MS 2000 creates an escher stream there is always
an ObjectPool dir (even if empty). It turns out that if a copy of
MS 2000 is used to open a document that contains escher graphics
exported from StarOffice without this empty dir then *if* that
@@ -2884,7 +2870,7 @@ void WW8Export::WriteFkpPlcUsw()
some magic. cmc
*/
/*
- #10570# Similiarly having msvbasic storage seems to also trigger
+ #10570# Similarly having msvbasic storage seems to also trigger
creating this stream
*/
GetWriter().GetStorage().OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool),
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index a62146fc17a3..a545e7cf0e75 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1106,7 +1106,7 @@ public:
SwTwips CurrentPageWidth(SwTwips &rLeft, SwTwips &rRight) const;
- /// Nasty swap for bidi if neccessary
+ /// Nasty swap for bidi if necessary
bool MiserableRTLFrmFmtHack(SwTwips &rLeft, SwTwips &rRight,
const sw::Frame &rFrmFmt);
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index d33cf4cc2932..5063a768e0b8 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -19,29 +19,21 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-
#if OSL_DEBUG_LEVEL > 0
# include <cstdio>
#endif
-
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <rtl/math.hxx>
#include <svtools/filter.hxx>
#include <svl/itemiter.hxx>
#include "svl/urihelper.hxx"
-
#include <svtools/embedhlp.hxx>
-
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
-
#include <hintids.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/shaditem.hxx>
@@ -51,7 +43,6 @@
#include <editeng/ulspitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <svx/svdoole2.hxx>
-
#include <unotools/ucbstreamhelper.hxx>
#include <fmtanchr.hxx>
#include <ndgrf.hxx>
@@ -61,10 +52,8 @@
#include <ndtxt.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
-
#include <writerfilter/doctok/sprmids.hxx>
#include <svx/fmmodel.hxx>
-
#include <doc.hxx>
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
@@ -72,14 +61,12 @@
#include "wrtww8.hxx"
#include "ww8par.hxx"
#include "escher.hxx"
-//Added for i120568
#include "ww8attributeoutput.hxx"
#include "fmturl.hxx"
-//End
#include "docsh.hxx"
#include <cstdio>
-
#include <stdio.h>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace nsFieldFlags;
@@ -125,7 +112,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
switch (pItem->Which())
{
/*
- For an inline object these properties are irrelevent because they
+ For an inline object these properties are irrelevant because they
will be the same as the defaults that msword applies in their
absence, so if that is all that there is for these inline objects
then if there turns out to be enough information in the object
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d93e0fd2fb4b..2e9c99a75ab1 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1128,7 +1128,7 @@ void WW8AttributeOutput::CharFontCJK( const SvxFontItem& rFont )
void WW8AttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
{
- //Can only export in 8+, in 7- export as normal varient and expect that
+ //Can only export in 8+, in 7- export as normal variant and expect that
//upperlevel code has blocked exporting clobbering attributes
if (m_rWW8Export.bWrtWW8)
{
@@ -1142,7 +1142,7 @@ void WW8AttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
void WW8AttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture )
{
- // Can only export in 8+, in 7- export as normal varient and expect that
+ // Can only export in 8+, in 7- export as normal variant and expect that
// upperlevel code has blocked exporting clobbering attributes
if (m_rWW8Export.bWrtWW8)
{
@@ -3325,7 +3325,7 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines )
sal_Unicode cEnd = rTwoLines.GetEndBracket();
/*
- As per usual we have problems. We can have seperate left and right brackets
+ As per usual we have problems. We can have separate left and right brackets
in OOo, it doesn't appear that you can in word. Also in word there appear
to only be a limited number of possibilities, we can use pretty much
anything.
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 1689cd552748..6ea7c12ab433 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
#include <svl/urihelper.hxx>
#include <hintids.hxx>
@@ -89,7 +88,6 @@
#include <fmtinfmt.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
-// OD 30.09.2003 #i18732#
#include <fmtfollowtextflow.hxx>
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
@@ -98,13 +96,12 @@
#include <editeng/editobj.hxx>
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
-
#include <math.h>
-
#include <fmturl.hxx>
#include <svx/hlnkitem.hxx>
#include <svl/whiter.hxx>
#include "ww8par2.hxx"
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace sw::types;
@@ -637,7 +634,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp,
Save and create new plcxman for this drawing object, of the type that
will include the para end mark inside a paragraph property range, as
drawing boxes have real paragraph marks as part of their text, while
- normal writer has seperate nodes for each paragraph and so has no actual
+ normal writer has separate nodes for each paragraph and so has no actual
paragraph mark as part of the paragraph text.
*/
WW8ReaderSave aSave(this);
@@ -1914,7 +1911,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
bool bBrushItemOk = false;
sal_uInt8 nTrans = 0;
- //Seperate transparency
+ //Separate transparency
eState = rOldSet.GetItemState(XATTR_FILLTRANSPARENCE, true, &pItem);
if (eState == SFX_ITEM_SET)
{
@@ -2104,7 +2101,7 @@ void SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord,
So given that the size of the values remains pretty much the
same despite the size of the graphic, we can tell that the
- polygon is measured in units that are independant of the
+ polygon is measured in units that are independent of the
graphic. But why does the left corner move a different value
to the left each time, and why does the bottom move upwards
each time, when the right and top remain at the same value ?
@@ -2146,7 +2143,7 @@ void SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord,
aPoly.Scale(aMapPolyX, aMapPolyY);
// --> OD 2005-05-19 #i47277# - contour is already in unit of the
- // graphic prefered unit. Thus, call method <SetContour(..)>
+ // graphic preferred unit. Thus, call method <SetContour(..)>
pNd->SetContour(&aPoly);
// <--
}
diff --git a/sw/source/filter/ww8/ww8graf.hxx b/sw/source/filter/ww8/ww8graf.hxx
index dec60c9bc74e..792893c0f7ab 100644
--- a/sw/source/filter/ww8/ww8graf.hxx
+++ b/sw/source/filter/ww8/ww8graf.hxx
@@ -84,8 +84,8 @@ public:
const SvxMSDffShapeOrders *pShapeOrders);
void InsertTextLayerObject(SdrObject* pObject);
/*
- cmc: We should have have seperate ZOrder classes for 95- and 97+ and
- instantiate the appropiate one at run time.
+ cmc: We should have have separate ZOrder classes for 95- and 97+ and
+ instantiate the appropriate one at run time.
*/
void InsertDrawingObject(SdrObject* pObj, short nWwHeight);
// --> OD 2004-12-13 #117915# - new parameter <_bInHeaderFooter>, indicating
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 2c6b8131fbbc..ad0990f88734 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -572,7 +572,7 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
##835##
Disable use of main stream as fallback stream for inline direct
blips as it is known that they are directly after the record
- header, testing for existance in main stream may lead to an
+ header, testing for existence in main stream may lead to an
incorrect fallback graphic being found if other escher graphics
have been inserted in the document
*/
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index de3f0fe89604..d159cd4bbb69 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1701,7 +1701,7 @@ void SwWW8ImplReader::ImportDop()
// COMPATIBILITY FLAGS START
//
- // #i78951# - remember the unknown compatability options
+ // #i78951# - remember the unknown compatibility options
// so as to export them out
rDoc.Setn32DummyCompatabilityOptions1( pWDop->GetCompatabilityOptions());
rDoc.Setn32DummyCompatabilityOptions2( pWDop->GetCompatabilityOptions2());
@@ -3051,7 +3051,7 @@ bool SwWW8ImplReader::HandlePageBreakChar()
/*
If its a 0x0c without a paragraph end before it, act like a
paragraph end, but nevertheless, numbering (and perhaps other
- similiar constructs) do not exist on the para.
+ similar constructs) do not exist on the para.
*/
//xushanchuan add for issue106569
if (!bWasParaEnd && IsTemp)
@@ -3740,8 +3740,9 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage,
, nIdctHint(0)
, bBidi(false)
, bReadTable(false)
- , mbLoadingTOCCache(false)
- , mbLoadingTOCHyperlink(false)
+ , mbLoadingTOXCache(false)
+ , mnEmbeddedTOXLevel(0)
+ , mbLoadingTOXHyperlink(false)
, mpPosAfterTOC(0)
, mbCareFirstParaEndInToc(false)
, mbCareLastParaEndInToc(false)
@@ -3807,7 +3808,6 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage,
mpDrawEditEngine = 0;
pWWZOrder = 0;
pFormImpl = 0;
- mpChosenOutlineNumRule = 0;
pNumFldType = 0;
nFldNum = 0;
@@ -4124,10 +4124,10 @@ void wwSectionManager::InsertSegments()
//End getting the bounds of this section, quite a job eh ?
SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter);
- //The last section if continous is always unbalanced
+ //The last section if continuous is always unbalanced
if (pRet)
{
- //Set the columns to be UnBalanced if that compatability option
+ //Set the columns to be UnBalanced if that compatibility option
//is set
if (mrReader.pWDop->fNoColumnBalance)
pRet->SetFmtAttr(SwFmtNoBalancedColumns(true));
@@ -4464,7 +4464,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
pStyles->PostProcessStyles();
if (pCollA)
- SetOutLineStyles();
+ SetOutlineStyles();
pSBase = new WW8ScannerBase(pStrm,pTableStream,pDataStream,pWwFib);
@@ -4571,13 +4571,13 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
}
else //ordinary case
{
- //Modify here for #119405, by easyfan, 2012-05-24
- mbOnLoadingMain = true;
- //End of modification, by easyfan
- ReadText(0, pWwFib->ccpText, MAN_MAINTEXT);
- //Modify here for #119405, by easyfan, 2012-05-24
- mbOnLoadingMain = false;
- //End of modification, by easyfan
+ //Modify here for #119405, by easyfan, 2012-05-24
+ mbOnLoadingMain = true;
+ //End of modification, by easyfan
+ ReadText( 0, pWwFib->ccpText, MAN_MAINTEXT );
+ //Modify here for #119405, by easyfan, 2012-05-24
+ mbOnLoadingMain = false;
+ //End of modification, by easyfan
}
::SetProgressState(nProgress, mpDocShell); // Update
@@ -5201,178 +5201,137 @@ public:
}
};
-void SwWW8ImplReader::SetOutLineStyles()
+
+void SwWW8ImplReader::SetOutlineStyles()
{
- /*
- #i3674# - Load new document and insert document cases.
- */
- SwNumRule aOutlineRule(*rDoc.GetOutlineNumRule());
- // #i53044,i53213#
- // <mpChosenOutlineNumRule> has to be set to point to local variable
- // <aOutlineRule>, because its used below to be compared this <&aOutlineRule>.
- // But at the end of the method <mpChosenOutlineNumRule> has to be set to
- // <rDoc.GetOutlineNumRule()>, because <aOutlineRule> will be destroyed.
- mpChosenOutlineNumRule = &aOutlineRule;
-
- sw::ParaStyles aOutLined(sw::util::GetParaStyles(rDoc));
- // #i98791# - sorting algorithm adjusted
- sw::util::SortByAssignedOutlineStyleListLevel(aOutLined);
-
- typedef sw::ParaStyleIter myParaStyleIter;
- /*
- If we are inserted into a document then don't clobber existing existing
- levels.
- */
- sal_uInt16 nFlagsStyleOutlLevel = 0;
- if (!mbNewDoc)
+
+ // If we are inserted into a document then don't clobber existing outline levels.
+ sal_uInt16 nOutlineStyleListLevelWithAssignment = 0;
+ if ( !mbNewDoc )
{
- // #i70748# - backward iteration needed due to the outline level attribute
+ sw::ParaStyles aOutLined( sw::util::GetParaStyles( rDoc ) );
+ sw::util::SortByAssignedOutlineStyleListLevel( aOutLined );
sw::ParaStyles::reverse_iterator aEnd = aOutLined.rend();
- for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
+ for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter )
{
- if ((*aIter)->IsAssignedToListLevelOfOutlineStyle())
- nFlagsStyleOutlLevel |= 1 << (*aIter)->GetAssignedOutlineStyleLevel();
+ if ( ( *aIter )->IsAssignedToListLevelOfOutlineStyle() )
+ nOutlineStyleListLevelWithAssignment |= 1 << ( *aIter )->GetAssignedOutlineStyleLevel();
else
break;
}
}
- else
+
+ // Check applied WW8 list styles at WW8 Built-In Heading Styles
+ // - Choose the list style which occurs most often as the one which provides
+ // the list level properties for the Outline Style.
+ // - Populate temporary list of WW8 Built-In Heading Styles for further iteration
+ std::vector< SwWW8StyInf* > aWW8BuiltInHeadingStyles;
+ const SwNumRule* pChosenWW8ListStyle = NULL;
{
- /*
- Only import *one* of the possible multiple outline numbering rules, so
- pick the one that affects most styles. If we're not importing a new
- document, we got to stick with what is already there.
- */
- // use index in text format collection
- // array <pCollA> as key of the outline numbering map <aRuleMap>
- // instead of the memory pointer of the outline numbering rule
- // to assure that, if two outline numbering rule affect the same
- // count of text formats, always the same outline numbering rule is chosen.
- std::map<sal_uInt16, int>aRuleMap;
- typedef std::map<sal_uInt16, int>::iterator myIter;
- for (sal_uInt16 nI = 0; nI < nColls; ++nI)
+ std::map< const SwNumRule*, int > aWW8ListStyleCounts;
+ for ( sal_uInt16 nI = 0; nI < nColls; ++nI )
{
- SwWW8StyInf& rSI = pCollA[ nI ];
- if (
- (MAXLEVEL > rSI.nOutlineLevel) && rSI.pOutlineNumrule &&
- rSI.pFmt
- )
+ SwWW8StyInf& rSI = pCollA[nI];
+
+ if ( !rSI.IsWW8BuiltInHeadingStyle()
+ || !rSI.HasWW8OutlineLevel() )
{
- myIter aIter = aRuleMap.find(nI);
- if (aIter == aRuleMap.end())
+ continue;
+ }
+
+ aWW8BuiltInHeadingStyles.push_back( &rSI );
+
+ const SwNumRule* pWW8ListStyle = rSI.GetOutlineNumrule();
+ if ( pWW8ListStyle != NULL )
+ {
+ std::map< const SwNumRule*, int >::iterator aCountIter =
+ aWW8ListStyleCounts.find( pWW8ListStyle );
+ if ( aCountIter == aWW8ListStyleCounts.end() )
{
- aRuleMap[nI] = 1;
+ aWW8ListStyleCounts[pWW8ListStyle] = 1;
}
else
- ++(aIter->second);
+ {
+ ++(aCountIter->second);
+ }
}
}
- int nMax = 0;
- myIter aEnd2 = aRuleMap.end();
- for (myIter aIter = aRuleMap.begin(); aIter != aEnd2; ++aIter++)
+ int nCurrentMaxCount = 0;
+ std::map< const SwNumRule*, int >::iterator aCountIterEnd =
+ aWW8ListStyleCounts.end();
+ for ( std::map< const SwNumRule*, int >::iterator aIter = aWW8ListStyleCounts.begin();
+ aIter != aCountIterEnd;
+ ++aIter )
{
- if (aIter->second > nMax)
+ if ( aIter->second > nCurrentMaxCount )
{
- nMax = aIter->second;
- mpChosenOutlineNumRule = pCollA[ aIter->first ].pOutlineNumrule;
+ nCurrentMaxCount = aIter->second;
+ pChosenWW8ListStyle = aIter->first;
}
}
+ }
- ASSERT(mpChosenOutlineNumRule, "Impossible");
- if (mpChosenOutlineNumRule)
- aOutlineRule = *mpChosenOutlineNumRule;
-
- if (mpChosenOutlineNumRule != &aOutlineRule)
+ // - set list level properties of Outline Style - ODF's list style applied by default to headings
+ // - assign corresponding Heading Paragraph Styles to the Outline Style
+ // - If a heading Paragraph Styles is not applying the WW8 list style which had been chosen as
+ // the one which provides the list level properties for the Outline Style, its assignment to
+ // the Outline Style is removed. A potential applied WW8 list style is assigned directly and
+ // its default outline level is applied.
+ SwNumRule aOutlineRule( *rDoc.GetOutlineNumRule() );
+ bool bAppliedChangedOutlineStyle = false;
+ std::vector< SwWW8StyInf* >::iterator aStylesIterEnd =
+ aWW8BuiltInHeadingStyles.end();
+ for ( std::vector< SwWW8StyInf* >::iterator aStyleIter = aWW8BuiltInHeadingStyles.begin();
+ aStyleIter != aStylesIterEnd;
+ ++aStyleIter )
+ {
+ SwWW8StyInf* pStyleInf = (*aStyleIter);
+
+ const sal_uInt16 nOutlineStyleListLevelOfWW8BuiltInHeadingStyle = 1 << pStyleInf->mnWW8OutlineLevel;
+ if ( nOutlineStyleListLevelOfWW8BuiltInHeadingStyle & nOutlineStyleListLevelWithAssignment )
{
- // #i70748# - backward iteration needed due to the outline level attribute
- sw::ParaStyles::reverse_iterator aEnd = aOutLined.rend();
- for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
- {
- if((*aIter)->IsAssignedToListLevelOfOutlineStyle())
- (*aIter)->DeleteAssignmentToListLevelOfOutlineStyle();
-
- else
- break;
- }
+ continue;
}
- }
- sal_uInt16 nOldFlags = nFlagsStyleOutlLevel;
+ if ( pChosenWW8ListStyle != NULL
+ && pStyleInf->mnWW8OutlineLevel == pStyleInf->nListLevel )
+ {
+ const SwNumFmt& rRule = pChosenWW8ListStyle->Get( pStyleInf->mnWW8OutlineLevel );
+ aOutlineRule.Set( pStyleInf->mnWW8OutlineLevel, rRule );
+ bAppliedChangedOutlineStyle = true;
+ }
- for (sal_uInt16 nI = 0; nI < nColls; ++nI)
- {
- SwWW8StyInf& rSI = pCollA[nI];
+ // in case that there are more styles on this level ignore them
+ nOutlineStyleListLevelWithAssignment |= nOutlineStyleListLevelOfWW8BuiltInHeadingStyle;
- if (rSI.IsOutlineNumbered())
+ SwTxtFmtColl* pTxtFmtColl = static_cast<SwTxtFmtColl*>(pStyleInf->pFmt);
+ if ( pStyleInf->GetOutlineNumrule() != pChosenWW8ListStyle
+ || ( pStyleInf->nListLevel < WW8ListManager::nMaxLevel
+ && pStyleInf->mnWW8OutlineLevel != pStyleInf->nListLevel ) )
{
- sal_uInt16 nAktFlags = 1 << rSI.nOutlineLevel;
- if (
- (nAktFlags & nFlagsStyleOutlLevel) ||
- (rSI.pOutlineNumrule != mpChosenOutlineNumRule)
- )
+ // WW8 Built-In Heading Style does not apply the chosen one.
+ // --> delete assignment to OutlineStyle, but keep its current outline level
+ pTxtFmtColl->DeleteAssignmentToListLevelOfOutlineStyle( false );
+ // Apply existing WW8 list style a normal list style at the Paragraph Style
+ if ( pStyleInf->GetOutlineNumrule() != NULL )
{
- /*
- If our spot is already taken by something we can't replace
- then don't insert and remove our outline level.
- */
- rSI.pFmt->SetFmtAttr(
- SwNumRuleItem( rSI.pOutlineNumrule->GetName() ) );
- //((SwTxtFmtColl*)rSI.pFmt)->SetOutlineLevel(NO_NUMBERING);
- ((SwTxtFmtColl*)rSI.pFmt)->DeleteAssignmentToListLevelOfOutlineStyle();//#outline level,zhaojianwei
- }
- else
- {
- /*
- If there is a style already set for this outline
- numbering level and its not a style set by us already
- then we can remove it outline numbering.
- (its one of the default headings in a new document
- so we can clobber it)
- Of course if we are being inserted into a document that
- already has some set we can't do this, thats covered by
- the list of level in nFlagsStyleOutlLevel to ignore.
- */
- outlineeq aCmp(rSI.nOutlineLevel);
- myParaStyleIter aResult = std::find_if(aOutLined.begin(),
- aOutLined.end(), aCmp);
-
- myParaStyleIter aEnd = aOutLined.end();
- while (aResult != aEnd && aCmp(*aResult))
- {
- //(*aResult)->SetOutlineLevel(NO_NUMBERING);//#outline level,zhaojianwei
- (*aResult)->DeleteAssignmentToListLevelOfOutlineStyle();
- ++aResult;
- }
-
- /*
- #i1886#
- I believe that when a list is registered onto a winword
- style which is an outline numbering style (i.e.
- nOutlineLevel is set) that the style of numbering is for
- the level is indexed by the *list* level that was
- registered on that style, and not the outlinenumbering
- level, which is probably a logical sequencing, and not a
- physical mapping into the list style reged on that outline
- style.
- */
- sal_uInt8 nFromLevel = rSI.nListLevel;
- sal_uInt8 nToLevel = rSI.nOutlineLevel;
- const SwNumFmt& rRule=rSI.pOutlineNumrule->Get(nFromLevel);
- aOutlineRule.Set(nToLevel, rRule);
- // Set my outline level
- //((SwTxtFmtColl*)rSI.pFmt)->SetOutlineLevel(nToLevel);//#outline level,zhaojianwei
- ((SwTxtFmtColl*)rSI.pFmt)->AssignToListLevelOfOutlineStyle(nToLevel); //<-end,zhaojianwei
- // If there are more styles on this level ignore them
- nFlagsStyleOutlLevel |= nAktFlags;
+ pTxtFmtColl->SetFmtAttr( SwNumRuleItem( pStyleInf->GetOutlineNumrule()->GetName() ) );
}
+ // apply default outline level of WW8 Built-in Heading Style
+ const sal_uInt8 nOutlineLevel =
+ SwWW8StyInf::WW8OutlineLevelToOutlinelevel( pStyleInf->mnWW8OutlineLevel );
+ pTxtFmtColl->SetFmtAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL, nOutlineLevel ) );
+ }
+ else
+ {
+ pTxtFmtColl->AssignToListLevelOfOutlineStyle( pStyleInf->mnWW8OutlineLevel );
}
}
- if (nOldFlags != nFlagsStyleOutlLevel)
- rDoc.SetOutlineNumRule(aOutlineRule);
- if ( mpChosenOutlineNumRule == &aOutlineRule )
+
+ if ( bAppliedChangedOutlineStyle )
{
- mpChosenOutlineNumRule = rDoc.GetOutlineNumRule();
+ rDoc.SetOutlineNumRule(aOutlineRule);
}
}
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 3f1eec42d77b..fb2ea3b58bf6 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -301,7 +301,12 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr);
- virtual void SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, sal_Bool bTstEnde=sal_True, long nHand=LONG_MAX, sal_Bool consumedByField=sal_False);
+ virtual void SetAttr(
+ const SwPosition& rPos,
+ sal_uInt16 nAttrId = 0,
+ sal_Bool bTstEnde = sal_True,
+ long nHand = LONG_MAX,
+ sal_Bool consumedByField = sal_False );
void SetToggleAttr(sal_uInt8 nId, bool bOn)
{
@@ -886,8 +891,8 @@ struct ApoTestResults
struct ANLDRuleMap
{
- SwNumRule* mpOutlineNumRule; // WinWord 6 numbering, varient 1
- SwNumRule* mpNumberingNumRule; // WinWord 6 numbering, varient 2
+ SwNumRule* mpOutlineNumRule; // WinWord 6 numbering, variant 1
+ SwNumRule* mpNumberingNumRule; // WinWord 6 numbering, variant 2
SwNumRule* GetNumRule(sal_uInt8 nNumType);
void SetNumRule(SwNumRule*, sal_uInt8 nNumType);
ANLDRuleMap() : mpOutlineNumRule(0), mpNumberingNumRule(0) {}
@@ -1032,14 +1037,6 @@ private:
std::stack<rtl_TextEncoding> maFontSrcCharSets;
std::stack<rtl_TextEncoding> maFontSrcCJKCharSets;
- /*
- Winword numbering gets imported as SwNumRules, there is a problem that
- winword can have multiple outline numberings, only one gets chosen as
- the writer outline numbering rule. The one that gets chosen is set here
- as mpChosenOutlineNumRule
- */
- SwNumRule *mpChosenOutlineNumRule;
-
SwMSConvertControls *pFormImpl; // Control-Implementierung
SwFlyFrmFmt* pFlyFmtOfJustInsertedGraphic;
@@ -1216,10 +1213,12 @@ private:
boost::shared_ptr<SwPaM> mpTableEndPaM;
WW8PLCFx_Cp_FKP* pFirstTablePap;
- // Indicate that currently on loading a TOC, managed by Read_F_TOX() and End_Field()
- bool mbLoadingTOCCache;
- // Indicate that current on loading a hyperlink, which is inside a TOC; Managed by Read_F_Hyperlink() and End_Field()
- bool mbLoadingTOCHyperlink;
+ // Indicate that currently on loading a TOX, managed by Read_F_TOX() and End_Field()
+ bool mbLoadingTOXCache;
+ int mnEmbeddedTOXLevel;
+
+ // Indicate that current on loading a hyperlink, which is inside a TOX; Managed by Read_F_Hyperlink() and End_Field()
+ bool mbLoadingTOXHyperlink;
// a document position recorded the after-position of TOC section, managed by Read_F_TOX() and End_Field()
SwPaM* mpPosAfterTOC;
@@ -1289,12 +1288,10 @@ private:
void ImportTox( int nFldId, String aStr );
void EndSprm( sal_uInt16 nId );
- // --> OD 2010-05-06 #i103711#
- // --> OD 2010-05-11 #i105414#
+
void NewAttr( const SfxPoolItem& rAttr,
const bool bFirstLineOfStSet = false,
const bool bLeftIndentSet = false );
- // <--
bool GetFontParams(sal_uInt16, FontFamily&, String&, FontPitch&,
rtl_TextEncoding&);
@@ -1500,8 +1497,11 @@ private:
// Ver8-Listen
- void RegisterNumFmtOnTxtNode(sal_uInt16 nActLFO, sal_uInt8 nActLevel,
- bool bSetAttr = true);
+ void RegisterNumFmtOnTxtNode(
+ sal_uInt16 nActLFO,
+ sal_uInt8 nActLevel,
+ const bool bSetAttr = true );
+
void RegisterNumFmtOnStyle(sal_uInt16 nStyle);
void SetStylesList(sal_uInt16 nStyle, sal_uInt16 nActLFO,
sal_uInt8 nActLevel);
@@ -1537,7 +1537,7 @@ private:
SwTwips MoveOutsideFly(SwFrmFmt *pFlyFmt, const SwPosition &rPos,
bool bTableJoin = true);
- void SetOutLineStyles();
+ void SetOutlineStyles();
bool SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper);
bool SetUpperSpacing(SwPaM &pMyPam, int nSpace);
@@ -1700,7 +1700,6 @@ public: // eigentlich private, geht aber leider nur public
eF_ResT Read_F_NoteReference( WW8FieldDesc* pF, String& rStr );
eF_ResT Read_F_Tox( WW8FieldDesc* pF, String& rStr );
- bool AddExtraOutlinesAsExtraStyles(SwTOXBase& rBase);
eF_ResT Read_F_Symbol( WW8FieldDesc*, String& rStr );
eF_ResT Read_F_Embedd( WW8FieldDesc*, String& rStr );
eF_ResT Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr);
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c25ec260c2a3..419a8ef51ee0 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -402,7 +402,7 @@ sal_uInt16 SwWW8ImplReader::End_Ftn()
bFtnEdn = bOld;
ASSERT(sChar.Len()==1 && ((rDesc.mbAutoNum == (sChar.GetChar(0) == 2))),
- "footnote autonumbering must be 0x02, and everthing else must not be");
+ "footnote autonumbering must be 0x02, and everything else must not be");
// If no automatic numbering use the following char from the main text
// as the footnote number
@@ -540,7 +540,7 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd,
/*
#i1140#
If I have a table and apply a style to one of its frames that should cause
- a paragraph that its applied to it to only exist as a seperate floating
+ a paragraph that its applied to it to only exist as a separate floating
frame, then the behavour depends on which cell that it has been applied
to. If its the first cell of a row then the whole table row jumps into the
new frame, if its not then then the paragraph attributes are applied
@@ -636,28 +636,35 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd,
// Hilfroutinen fuer Kapitelnummerierung und Aufzaehlung / Gliederung
//---------------------------------------------------------------------
-static void SetBaseAnlv(SwNumFmt &rNum, WW8_ANLV &rAV, sal_uInt8 nSwLevel )
+static void SetBaseAnlv(
+ SwNumFmt &rNum,
+ WW8_ANLV &rAV,
+ sal_uInt8 nSwLevel )
{
- static SvxExtNumType eNumA[8] = { SVX_NUM_ARABIC, SVX_NUM_ROMAN_UPPER, SVX_NUM_ROMAN_LOWER,
- SVX_NUM_CHARS_UPPER_LETTER_N, SVX_NUM_CHARS_LOWER_LETTER_N, SVX_NUM_ARABIC,
- SVX_NUM_ARABIC, SVX_NUM_ARABIC };
+ static SvxExtNumType eNumA[8] =
+ { SVX_NUM_ARABIC, SVX_NUM_ROMAN_UPPER, SVX_NUM_ROMAN_LOWER,
+ SVX_NUM_CHARS_UPPER_LETTER_N, SVX_NUM_CHARS_LOWER_LETTER_N,
+ SVX_NUM_ARABIC, SVX_NUM_ARABIC, SVX_NUM_ARABIC };
- static SvxAdjust eAdjA[4] = { SVX_ADJUST_LEFT,
- SVX_ADJUST_RIGHT, SVX_ADJUST_LEFT, SVX_ADJUST_LEFT };
-// eigentlich folgende 2, aber Writer-UI bietet es nicht an
-// SVX_ADJUST_CENTER, SVX_ADJUST_BLOCKLINE };
+ static SvxAdjust eAdjA[4] =
+ { SVX_ADJUST_LEFT, SVX_ADJUST_RIGHT, SVX_ADJUST_LEFT, SVX_ADJUST_LEFT };
+
+ rNum.SetNumberingType(
+ static_cast< sal_Int16 >(( SVBT8ToByte( rAV.nfc ) < 8 )
+ ? eNumA[SVBT8ToByte( rAV.nfc ) ]
+ : SVX_NUM_NUMBER_NONE) );
- rNum.SetNumberingType( static_cast< sal_Int16 >(( SVBT8ToByte( rAV.nfc ) < 8 ) ?
- eNumA[SVBT8ToByte( rAV.nfc ) ] : SVX_NUM_NUMBER_NONE) );
if ((SVBT8ToByte(rAV.aBits1 ) & 0x4) >> 2)
+ {
rNum.SetIncludeUpperLevels(nSwLevel + 1);
+ }
rNum.SetStart( SVBT16ToShort( rAV.iStartAt ) );
-// rNum.eNumAdjust = eAdjA[rAV.jc];
+
rNum.SetNumAdjust( eAdjA[SVBT8ToByte( rAV.aBits1 ) & 0x3] );
rNum.SetCharTextDistance( SVBT16ToShort( rAV.dxaSpace ) );
- sal_Int16 nIndent = Abs((sal_Int16)SVBT16ToShort( rAV.dxaIndent ));
- if( SVBT8ToByte( rAV.aBits1 ) & 0x08 ) //fHang
+ sal_Int16 nIndent = Abs( (sal_Int16) SVBT16ToShort( rAV.dxaIndent ) );
+ if ( SVBT8ToByte( rAV.aBits1 ) & 0x08 ) //fHang
{
rNum.SetFirstLineOffset( -nIndent );
rNum.SetLSpace( nIndent );
@@ -833,8 +840,7 @@ void SwWW8ImplReader::Read_ANLevelNo( sal_uInt16, const sal_uInt8* pData, short
{
nSwNumLevel = *pData - 1;
if (!bNoAttrImport)
- //((SwTxtFmtColl*)pAktColl)->SetOutlineLevel( nSwNumLevel ); //#outline level,zhaojianwei
- ((SwTxtFmtColl*)pAktColl)->AssignToListLevelOfOutlineStyle( nSwNumLevel ); //<-end,zhaojianwei
+ ( (SwTxtFmtColl*) pAktColl )->AssignToListLevelOfOutlineStyle( nSwNumLevel );
// Bei WW-NoNumbering koennte auch NO_NUMBERING gesetzt
// werden. ( Bei normaler Nummerierung muss NO_NUM gesetzt
// werden: NO_NUM : Nummerierungs-Pause,
@@ -878,11 +884,9 @@ void SwWW8ImplReader::Read_ANLevelDesc( sal_uInt16, const sal_uInt8* pData, shor
pAktColl->SetFmtAttr( SwNumRuleItem() );
String aName(CREATE_CONST_ASC( "Outline" ));
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aNR( rDoc.GetUniqueNumRuleName( &aName ),
SvxNumberFormat::LABEL_WIDTH_AND_POSITION,
OUTLINE_RULE );
- // <--
aNR = *rDoc.GetOutlineNumRule();
SetAnld(&aNR, (WW8_ANLD*)pData, nSwNumLevel, true);
@@ -2088,7 +2092,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
ApoTestResults aApo = pIo->TestApo(pIo->nInTable + 1, false, pTabPos);
/*
- ##513##, #79474# If this is not sufficent, then we should look at
+ ##513##, #79474# If this is not sufficient, then we should look at
sprmPD{y|x}aAbs as our indicator that the following set of rows is not
part of this table, but instead is an absolutely positioned table
outside of this one
@@ -2266,7 +2270,7 @@ void WW8TabDesc::CalcDefaults()
}
}
/*
- Similiar to graphics and other elements word does not totally
+ Similar to graphics and other elements word does not totally
factor the width of the border into its calculations of size, we
do so we must adjust out widths and other dimensions to fit. It
appears that what occurs is that the last cell's right margin if
@@ -2336,7 +2340,7 @@ void WW8TabDesc::CalcDefaults()
#96345#
If the last cell was "false" then there is no valid cell following it,
so the default mapping forward wont't work. So map it (and
- contigious invalid cells backwards to the last valid cell instead.
+ contiguous invalid cells backwards to the last valid cell instead.
*/
if (i && pR->bExist[i-1] == false)
{
@@ -4036,7 +4040,10 @@ bool WW8RStyle::PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisSty
rSI.eCJKFontSrcCharSet = pj->eCJKFontSrcCharSet;
rSI.n81Flags = pj->n81Flags;
rSI.n81BiDiFlags = pj->n81BiDiFlags;
- rSI.nOutlineLevel = pj->nOutlineLevel;
+ if ( !rSI.IsWW8BuiltInHeadingStyle() )
+ {
+ rSI.mnWW8OutlineLevel = pj->mnWW8OutlineLevel;
+ }
rSI.bParaAutoBefore = pj->bParaAutoBefore;
rSI.bParaAutoAfter = pj->bParaAutoAfter;
diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx
index afdc94032fc0..81c500eef733 100644
--- a/sw/source/filter/ww8/ww8par2.hxx
+++ b/sw/source/filter/ww8/ww8par2.hxx
@@ -129,6 +129,8 @@ class SwWW8StyInf
{
String sWWStyleName;
sal_uInt16 nWWStyleId;
+
+
public:
rtl_TextEncoding eLTRFontSrcCharSet; // rtl_TextEncoding fuer den Font
rtl_TextEncoding eRTLFontSrcCharSet; // rtl_TextEncoding fuer den Font
@@ -141,7 +143,15 @@ public:
sal_uInt16 nFollow;
sal_uInt16 nLFOIndex;
sal_uInt8 nListLevel;
- sal_uInt8 nOutlineLevel; // falls Gliederungs-Style
+
+ // WW8 outline level is zero-based:
+ // 0: outline level 1
+ // 1: outline level 2
+ // ...
+ // 8: outline level 9
+ // 9: body text
+ sal_uInt8 mnWW8OutlineLevel;
+
sal_uInt16 n81Flags; // Fuer Bold, Italic, ...
sal_uInt16 n81BiDiFlags; // Fuer Bold, Italic, ...
SvxLRSpaceItem maWordLR;
@@ -155,7 +165,7 @@ public:
//been explicitly set, it's set to the value
//of pFmt->GetItemState(RES_LR_SPACE, false)
//if it was possible to get the ItemState
- //for L of the LR space independantly
+ //for L of the LR space independently
bool bParaAutoBefore; // For Auto spacing before a paragraph
bool bParaAutoAfter; // For Auto Spacing after a paragraph
@@ -173,7 +183,7 @@ public:
nFollow( 0 ),
nLFOIndex( USHRT_MAX ),
nListLevel(WW8ListManager::nMaxLevel),
- nOutlineLevel( MAXLEVEL ),
+ mnWW8OutlineLevel( MAXLEVEL ),
n81Flags( 0 ),
n81BiDiFlags(0),
maWordLR( RES_LR_SPACE ),
@@ -198,26 +208,68 @@ public:
{
sWWStyleName = rName;
nWWStyleId = nId;
+
+ // apply default WW8 outline level to WW8 Built-in Heading styles
+ if ( IsWW8BuiltInHeadingStyle() )
+ {
+ mnWW8OutlineLevel = nWWStyleId - 1;
+ }
}
- sal_uInt16 GetWWStyleId() const { return nWWStyleId; }
+
const String& GetOrgWWName() const
{
return sWWStyleName;
}
- bool IsOutline() const
+
+ bool HasWW8OutlineLevel() const
{
- return (pFmt && (MAXLEVEL > nOutlineLevel));
+ return ( pFmt != NULL && (MAXLEVEL > mnWW8OutlineLevel) );
}
+
bool IsOutlineNumbered() const
{
- return pOutlineNumrule && IsOutline();
+ return pOutlineNumrule != NULL && HasWW8OutlineLevel();
}
+
const SwNumRule* GetOutlineNumrule() const
{
return pOutlineNumrule;
}
+
CharSet GetCharSet() const;
CharSet GetCJKCharSet() const;
+
+ inline sal_uInt16 GetWWStyleId() const
+ {
+ return nWWStyleId;
+ }
+
+ inline bool IsWW8BuiltInHeadingStyle()
+ {
+ return GetWWStyleId() >= 1 && GetWWStyleId() <= 9;
+ }
+
+ inline bool IsWW8BuiltInDefaultStyle()
+ {
+ return GetWWStyleId() == 0;
+ }
+
+ static sal_uInt8 WW8OutlineLevelToOutlinelevel( const sal_uInt8 nWW8OutlineLevel )
+ {
+ if ( nWW8OutlineLevel < MAXLEVEL )
+ {
+ if ( nWW8OutlineLevel == 9 )
+ {
+ return 0; // no outline level --> body text
+ }
+ else
+ {
+ return nWW8OutlineLevel + 1; // outline level 1..9
+ }
+ }
+
+ return 0;
+ }
};
class WW8RStyle: public WW8Style
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 8f417a4a52c1..2040c2e1adea 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -530,10 +530,14 @@ void lcl_CopyGreaterEight(String &rDest, String &rSrc,
}
}
-bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
- sal_uInt16 nLevelStyle, bool bSetStartNo,
- std::deque<bool> &rNotReallyThere, sal_uInt16 nLevel,
- ww::bytes &rParaSprms)
+bool WW8ListManager::ReadLVL(
+ SwNumFmt& rNumFmt,
+ SfxItemSet*& rpItemSet,
+ sal_uInt16 nLevelStyle,
+ bool bSetStartNo,
+ std::deque< bool > &rNotReallyThere,
+ sal_uInt16 nLevel,
+ ww::bytes &rParaSprms )
{
sal_uInt8 aBits1;
sal_uInt16 nStartNo = 0; // Start-Nr. fuer den Writer
@@ -1219,7 +1223,7 @@ WW8ListManager::WW8ListManager(
i.e. create a simple list in 2000 and open it in 97 and 97 will
claim (correctly) that it is an outline list. We can set our
- continous flag in these lists to store this information.
+ continuous flag in these lists to store this information.
*/
SwNumRule* pMyNumRule = CreateNextRule(
aLST.bSimpleList || (aBits1 & 0x10));
@@ -1639,7 +1643,7 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition,
#i1869#
If this list has had its bits set in word 2000 to pretend that it is a
simple list from the point of view of the user, then it is almost
- certainly a simple continous list, and we will try to keep it like that.
+ certainly a simple continuous list, and we will try to keep it like that.
Otherwise when we save again it will be shown as the true outline list
that it is, confusing the user that just wanted what they thought was a
simple list. On the otherhand it is possible that some of the other levels
@@ -1738,46 +1742,28 @@ bool SwWW8ImplReader::SetTxtFmtCollAndListLevel(
bool bRes = true;
if( rStyleInfo.pFmt && rStyleInfo.bColl )
{
- bRes = rDoc.SetTxtFmtColl(rRg, (SwTxtFmtColl*)rStyleInfo.pFmt)
- ? true : false;
+ bRes = rDoc.SetTxtFmtColl(rRg, (SwTxtFmtColl*)rStyleInfo.pFmt) ? true : false;
SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode();
- ASSERT( pTxtNode, "No Text-Node at PaM-Position" );
- // --> OD 2006-10-19 #134160# - make code robust
- if ( !pTxtNode )
+ ASSERT( pTxtNode != NULL, "No Text-Node at PaM-Position" );
+ if ( pTxtNode == NULL )
{
+ // make code robust
return bRes;
}
- // <--
-
- SwNumRule * pNumRule = pTxtNode->GetNumRule(); // #i27610#
- if( !IsInvalidOrToBeMergedTabCell() &&
- ! (pNumRule && pNumRule->IsOutlineRule()) ) // #i27610#
- pTxtNode->ResetAttr( RES_PARATR_NUMRULE );
+ const SwNumRule * pNumRule = pTxtNode->GetNumRule(); // #i27610#
- if( !rStyleInfo.pOutlineNumrule )
+ if( !IsInvalidOrToBeMergedTabCell()
+ && ! (pNumRule && pNumRule->IsOutlineRule()) ) // #i27610#
{
- if (
- (USHRT_MAX > rStyleInfo.nLFOIndex) &&
- (WW8ListManager::nMaxLevel > rStyleInfo.nListLevel)
- )
- {
- RegisterNumFmtOnTxtNode(rStyleInfo.nLFOIndex,
- rStyleInfo.nListLevel, false);
- }
+ pTxtNode->ResetAttr( RES_PARATR_NUMRULE );
}
- else
+
+ if ( USHRT_MAX > rStyleInfo.nLFOIndex
+ && WW8ListManager::nMaxLevel > rStyleInfo.nListLevel )
{
- // --> OD 2005-11-07 #127520#
- // Use outline level set at the style info <rStyleInfo> instead of
- // the outline level at the text format, because the WW8 document
- // could contain more than one outline numbering rule and the one
- // of the text format isn't the one, which a chosen as the Writer
- // outline rule.
-// pTxtNode->
-// SetLevel(((SwTxtFmtColl*) rStyleInfo.pFmt)->GetOutlineLevel());
- pTxtNode->SetAttrListLevel( rStyleInfo.nOutlineLevel );
- // <--
+ const bool bApplyListStyle = false;
+ RegisterNumFmtOnTxtNode( rStyleInfo.nLFOIndex, rStyleInfo.nListLevel, bApplyListStyle );
}
}
return bRes;
@@ -1865,25 +1851,27 @@ void SwWW8ImplReader::RegisterNumFmtOnStyle( sal_uInt16 nStyle )
// Phase 2: aktualisieren der StyleDef nach einlesen aller Listen
SwNumRule* pNmRule = 0;
- sal_uInt16 nLFO = rStyleInf.nLFOIndex;
- sal_uInt8 nLevel = rStyleInf.nListLevel;
+ const sal_uInt16 nLFO = rStyleInf.nLFOIndex;
+ const sal_uInt8 nLevel = rStyleInf.nListLevel;
if (
(USHRT_MAX > nLFO) &&
(WW8ListManager::nMaxLevel > nLevel)
)
{
std::vector<sal_uInt8> aParaSprms;
- pNmRule = pLstManager->GetNumRuleForActivation(nLFO, nLevel,
- aParaSprms);
+ pNmRule =
+ pLstManager->GetNumRuleForActivation( nLFO, nLevel, aParaSprms );
- if (pNmRule)
+ if ( pNmRule != NULL )
{
- if( MAXLEVEL > rStyleInf.nOutlineLevel )
+ if ( rStyleInf.IsWW8BuiltInHeadingStyle()
+ && rStyleInf.HasWW8OutlineLevel() )
+ {
rStyleInf.pOutlineNumrule = pNmRule;
+ }
else
{
- rStyleInf.pFmt->SetFmtAttr(
- SwNumRuleItem( pNmRule->GetName() ) );
+ rStyleInf.pFmt->SetFmtAttr( SwNumRuleItem( pNmRule->GetName() ) );
rStyleInf.bHasStyNumRule = true;
}
}
@@ -1897,7 +1885,7 @@ void SwWW8ImplReader::RegisterNumFmtOnStyle( sal_uInt16 nStyle )
void SwWW8ImplReader::RegisterNumFmtOnTxtNode(
sal_uInt16 nActLFO,
sal_uInt8 nActLevel,
- bool bSetAttr)
+ const bool bSetAttr)
{
// beachte: die Methode haengt die NumRule an den Text Node, falls
// bSetAttr (dann muessen natuerlich vorher die Listen gelesen sein)
@@ -1910,44 +1898,18 @@ void SwWW8ImplReader::RegisterNumFmtOnTxtNode(
SwTxtNode* pTxtNd = pPaM->GetNode()->GetTxtNode();
ASSERT(pTxtNd, "Kein Text-Node an PaM-Position");
- const SwNumRule* pRule = bSetAttr ?
- pLstManager->GetNumRuleForActivation( nActLFO, nActLevel,
- aParaSprms, pTxtNd) : 0;
+ const SwNumRule* pRule =
+ bSetAttr
+ ? pLstManager->GetNumRuleForActivation( nActLFO, nActLevel, aParaSprms, pTxtNd)
+ : 0;
- if (pRule || !bSetAttr)
+ if ( pRule != NULL || !bSetAttr)
{
- //#i24136# old is the same as new, and its the outline numbering,
- //then we don't set the numrule again, and we just take the num node
- //(the actual outline numbering gets set in SetOutlineNum)
- using namespace sw::util;
- bool bUnchangedOutlineNumbering = false;
- /*
- If the node is outline numbered, and the new numbering to apply
- is the one that was chosen to be the outline numbering then all
- is unchanged
- */
- // --> OD 2005-11-04 #???# - correct condition according to the
- // above given comment.
- if ( pTxtNd->GetNumRule() == rDoc.GetOutlineNumRule() &&
- pRule == mpChosenOutlineNumRule )
- // <--
+ if ( bSetAttr
+ && pTxtNd->GetNumRule() != pRule
+ && pTxtNd->GetNumRule() != rDoc.GetOutlineNumRule() )
{
- bUnchangedOutlineNumbering = true;
- }
- if (!bUnchangedOutlineNumbering)
- {
- //If its normal numbering, see if its the same as it already
- //was, if its not, and we have been asked to set it, then set
- //it to the new one
- if (bSetAttr)
- {
- const SwNumRule *pNormal = pTxtNd->GetNumRule();
- if (pNormal != pRule)
- {
- pTxtNd->SetAttr
- (SwNumRuleItem(pRule->GetName()));
- }
- }
+ pTxtNd->SetAttr( SwNumRuleItem( pRule->GetName() ) );
}
pTxtNd->SetAttrListLevel(nActLevel);
@@ -1960,16 +1922,16 @@ void SwWW8ImplReader::RegisterNumFmtOnTxtNode(
// Direct application of the list level formatting no longer
// needed for list levels of mode LABEL_ALIGNMENT
bool bApplyListLevelIndentDirectlyAtPara( true );
- if ( pTxtNd->GetNumRule() && nActLevel < MAXLEVEL )
{
- const SwNumFmt& rFmt = pTxtNd->GetNumRule()->Get( nActLevel );
- if ( rFmt.GetPositionAndSpaceMode() ==
- SvxNumberFormat::LABEL_ALIGNMENT )
+ if ( pTxtNd->GetNumRule() && nActLevel < MAXLEVEL )
{
- bApplyListLevelIndentDirectlyAtPara = false;
+ const SwNumFmt& rFmt = pTxtNd->GetNumRule()->Get( nActLevel );
+ if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ bApplyListLevelIndentDirectlyAtPara = false;
+ }
}
}
-
if ( bApplyListLevelIndentDirectlyAtPara )
{
SfxItemSet aListIndent(rDoc.GetAttrPool(), RES_LR_SPACE,
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 0ec81accf785..3b97661761ca 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -19,11 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+
#include <doc.hxx>
#include "writerhelper.hxx"
#include <com/sun/star/embed/XClassifiedObject.hpp>
@@ -54,10 +52,10 @@
#include <svtools/filter.hxx>
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
-
#include "ww8scan.hxx"
#include "ww8par.hxx"
#include "ww8par2.hxx" // WWFlyPara::BoxUpWidth()
+#include <drawdoc.hxx>
struct OLE_MFP
{
@@ -516,7 +514,7 @@ void SwWW8ImplReader::Read_CRevisionMark(RedlineType_t eType,
#101578#
It is possible to have a number of date stamps for the created time
of the change, (possibly a word bug) so we must use the "get a full
- list" varient of HasCharSprm and take the last one as the true one.
+ list" variant of HasCharSprm and take the last one as the true one.
*/
std::vector<const sal_uInt8 *> aResult;
bool bIns = (nsRedlineType_t::REDLINE_INSERT == eType);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index cad23eb55cb2..2afa4f1adcfe 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -406,7 +406,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
}
//e.g. inserting bookmark around field result, so we need to put
- //it around the entire writer field, as we don't have the seperation
+ //it around the entire writer field, as we don't have the separation
//of field and field result of word, see #i16941#
SwPosition aStart(*pPaM->GetPoint());
if (!maFieldStack.empty())
@@ -706,41 +706,48 @@ sal_uInt16 SwWW8ImplReader::End_Field()
}
}
break;
- // Doing corresponding status management for TOC field, index field, hyperlink field and page reference field
+ // Doing corresponding status management for TOX field, index field, hyperlink field and page reference field
case 13://TOX
case 8://index
- if (mbLoadingTOCCache)
+ if ( mbLoadingTOXCache )
{
- maTOXEndCps.insert(nCP);
- mbLoadingTOCCache = false;
- if ( pPaM->End() &&
- pPaM->End()->nNode.GetNode().GetTxtNode() &&
- pPaM->End()->nNode.GetNode().GetTxtNode()->Len() == 0 )
+ if ( mnEmbeddedTOXLevel > 0 )
{
- JoinNode(*pPaM);
+ --mnEmbeddedTOXLevel;
}
else
{
+ maTOXEndCps.insert( nCP );
+ mbLoadingTOXCache = false;
+ if ( pPaM->End()
+ && pPaM->End()->nNode.GetNode().GetTxtNode()
+ && pPaM->End()->nNode.GetNode().GetTxtNode()->Len() == 0 )
+ {
+ JoinNode( *pPaM );
+ }
+ else
+ {
mbCareLastParaEndInToc = true;
- }
+ }
- if (mpPosAfterTOC)
- {
- *pPaM = *mpPosAfterTOC;
- delete mpPosAfterTOC;
- mpPosAfterTOC = 0;
+ if ( mpPosAfterTOC )
+ {
+ *pPaM = *mpPosAfterTOC;
+ delete mpPosAfterTOC;
+ mpPosAfterTOC = 0;
+ }
}
}
break;
case 37://REF
- if (mbLoadingTOCCache && !mbLoadingTOCHyperlink)
+ if (mbLoadingTOXCache && !mbLoadingTOXHyperlink)
{
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT);
}
break;
case 88:
- if (mbLoadingTOCHyperlink)
- mbLoadingTOCHyperlink = false;
+ if (mbLoadingTOXHyperlink)
+ mbLoadingTOXHyperlink = false;
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT);
break;
case 36:
@@ -1271,7 +1278,7 @@ bookmarks were set with SET or ASK. (See SwWW8FltRefStack)
The other piece of the puzzle is that refs that point to the "location" of the
bookmark will in word actually point to the last location where the bookmark
-was set with SET or ASK, not the actual bookmark. This is only noticable when
+was set with SET or ASK, not the actual bookmark. This is only noticeable when
a document sets the bookmark more than once. This is because word places the
true bookmark at the location of the last set, but the refs will display the
position of the first set before the ref.
@@ -1298,7 +1305,7 @@ the field, which gives the same effect and meaning, to do so we must
get any bookmarks in the field range, and begin them immediately before
the set/ask field, and end them directly afterwards. MapBookmarkVariables
returns an identifier of the bookmark attribute to close after inserting
-the appropiate set/ask field.
+the appropriate set/ask field.
*/
long SwWW8ImplReader::MapBookmarkVariables(const WW8FieldDesc* pF,
String &rOrigName, const String &rData)
@@ -2170,13 +2177,13 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr )
const String sName(GetMappedBookmark(sOrigName));
- // loading page reference field in TOC
- if (mbLoadingTOCCache )
+ // loading page reference field in TOX
+ if (mbLoadingTOXCache )
{
// insert page ref representation as plain text --> return FLD_TEXT
// if there is no hyperlink settings for current toc and referenced bookmark is available,
// assign link to current ref area
- if ( !mbLoadingTOCHyperlink && sName.Len() > 0 )
+ if ( !mbLoadingTOXHyperlink && sName.Len() > 0 )
{
// #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
String sBookmarkName;
@@ -2861,38 +2868,6 @@ void lcl_toxMatchACSwitch( SwWW8ImplReader& /*rReader*/,
}
}
-//For all outline styles that are not in the outline numbering add them here as
-//custom extra styles
-bool SwWW8ImplReader::AddExtraOutlinesAsExtraStyles(SwTOXBase& rBase)
-{
- bool bExtras = false;
- //This is the case if the winword outline numbering is set while the
- //writer one is not
- for (sal_uInt16 nI = 0; nI < nColls; ++nI)
- {
- SwWW8StyInf& rSI = pCollA[nI];
- if (rSI.IsOutline())
- {
- const SwTxtFmtColl *pFmt = (const SwTxtFmtColl*)(rSI.pFmt);
- sal_uInt16 nStyleLevel = rSI.nOutlineLevel;
- sal_uInt16 nMaxLevel = rBase.GetLevel();
- if (
- //nStyleLevel != pFmt->GetOutlineLevel() && //#outline level,zhaojianwei
- nStyleLevel != (pFmt->GetAttrOutlineLevel()-1) && //<-end,zhaojianwei
- nStyleLevel < nMaxLevel
- )
- {
- String sStyles(rBase.GetStyleNames(rSI.nOutlineLevel));
- if( sStyles.Len())
- sStyles += TOX_STYLE_DELIMITER;
- sStyles += pFmt->GetName();
- rBase.SetStyleNames(sStyles, rSI.nOutlineLevel);
- bExtras = true;
- }
- }
- }
- return bExtras;
-}
static void EnsureMaxLevelForTemplates(SwTOXBase& rBase)
{
@@ -3024,7 +2999,16 @@ sal_uInt16 lcl_GetMaxValidWordTOCLevel(const SwForm &rForm)
eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
{
- mbLoadingTOCCache = true;
+ if ( !mbLoadingTOXCache )
+ {
+ mbLoadingTOXCache = true;
+ }
+ else
+ {
+ // Embedded TOX --> continue reading its content, but no further TOX field
+ ++mnEmbeddedTOXLevel;
+ return FLD_TEXT;
+ }
if (pF->nLRes < 3)
return FLD_TEXT; // ignore (#i25440#)
@@ -3369,18 +3353,14 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
{
case TOX_CONTENT:
{
- //If we would be created from outlines, either explictly or by default
+ //If we would be created from outlines, either explicitly or by default
//then see if we need extra styles added to the outlines
sal_uInt16 eEffectivelyFrom = eCreateFrom ? eCreateFrom : nsSwTOXElement::TOX_OUTLINELEVEL;
if (eEffectivelyFrom & nsSwTOXElement::TOX_OUTLINELEVEL)
{
- if (AddExtraOutlinesAsExtraStyles(*pBase))
- eCreateFrom |= (nsSwTOXElement::TOX_TEMPLATE | nsSwTOXElement::TOX_OUTLINELEVEL);
-
- // --> FME 2004-12-16 #i19683# Insert a text token " " between the
- // number and entry token. In an ideal world we could handle the
- // tab stop between the number and the entry correctly, but I
- // currently have no clue how to obtain the tab stop position.
+ // #i19683# Insert a text token " " between the number and entry token.
+ // In an ideal world we could handle the tab stop between the number and
+ // the entry correctly, but I currently have no clue how to obtain the tab stop position.
// It is _not_ set at the paragraph style.
SwForm* pForm = 0;
for (sal_uInt16 nI = 0; nI < nColls; ++nI)
@@ -3388,7 +3368,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
const SwWW8StyInf& rSI = pCollA[nI];
if (rSI.IsOutlineNumbered())
{
- sal_uInt16 nStyleLevel = rSI.nOutlineLevel;
+ sal_uInt16 nStyleLevel = rSI.mnWW8OutlineLevel;
const SwNumFmt& rFmt = rSI.GetOutlineNumrule()->Get( nStyleLevel );
if ( SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType() )
{
@@ -3446,16 +3426,11 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
for(sal_uInt16 nLevel = 1; nLevel <= nEnd; ++nLevel)
{
SwFormTokens aPattern = aOldForm.GetPattern(nLevel);
-
- SwFormTokens::iterator new_end=remove_if(aPattern.begin(), aPattern.end(),
- SwFormTokenEqualToFormTokenType(TOKEN_ENTRY_NO));
-
- aPattern.erase (new_end, aPattern.end() ); // #124710#: table index imported with wrong page number format
-
- aForm.SetPattern(nLevel, aPattern);
-
- aForm.SetTemplate( nLevel,
- aOldForm.GetTemplate(nLevel));
+ SwFormTokens::iterator new_end =
+ remove_if(aPattern.begin(), aPattern.end(), SwFormTokenEqualToFormTokenType(TOKEN_ENTRY_NO));
+ aPattern.erase(new_end, aPattern.end() ); // #124710#: table index imported with wrong page number format
+ aForm.SetPattern( nLevel, aPattern );
+ aForm.SetTemplate( nLevel, aOldForm.GetTemplate(nLevel) );
}
// <- #i21237#
@@ -3475,17 +3450,10 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
break;
} // ToxBase fertig
- // no Update of TOC anymore as its actual content is imported and kept.
- //rDoc.SetUpdateTOX(true);
-
- // #i21237#
- // propagate tab stops from paragraph styles used in TOX to
- // patterns of the TOX
- pBase->AdjustTabStops(rDoc, sal_True);
-
- //#i10028# inserting a toc implicltly acts like a parabreak
- //in word and writer
+ // #i21237# - propagate tab stops from paragraph styles used in TOX to patterns of the TOX
+ pBase->AdjustTabStops( rDoc );
+ //#i10028# inserting a toc implicltly acts like a parabreak in word and writer
if ( pPaM->End() &&
pPaM->End()->nNode.GetNode().GetTxtNode() &&
pPaM->End()->nNode.GetNode().GetTxtNode()->Len() != 0 )
@@ -3622,9 +3590,9 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
pReffedStck->aReferencedTOCBookmarks.insert( sMark );
}
- if (mbLoadingTOCCache)
+ if (mbLoadingTOXCache)
{
- mbLoadingTOCHyperlink = true;//on loading a TOC field nested hyperlink field
+ mbLoadingTOXHyperlink = true;//on loading a TOX field nested hyperlink field
}
}
break;
@@ -3651,8 +3619,8 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
( sURL += INET_MARK_TOKEN ) += sMark;
SwFmtINetFmt aURL( sURL, sTarget );
- // If on loading TOC field, change the default style into the "index link"
- if (mbLoadingTOCCache)
+ // If on loading TOX field, change the default style into the "index link"
+ if (mbLoadingTOXCache)
{
String sLinkStyle = String::CreateFromAscii("Index Link");
sal_uInt16 nPoolId =
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 2329ea99ea49..36751a7cb300 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -277,8 +277,9 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrmFmt &rFmt, const wwSection &rSection)
sal_uInt32 nCharWidth=240;
for (sal_uInt16 nI = 0; nI < pStyles->GetCount(); ++nI)
{
- if (pCollA[nI].bValid && pCollA[nI].pFmt &&
- pCollA[nI].GetWWStyleId() == 0)
+ if (pCollA[nI].bValid
+ && pCollA[nI].pFmt != NULL
+ && pCollA[nI].IsWW8BuiltInDefaultStyle())
{
nCharWidth = ItemGet<SvxFontHeightItem>(*(pCollA[nI].pFmt),
RES_CHRATR_CJK_FONTSIZE).GetHeight();
@@ -921,7 +922,14 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
// sprmSFBiDi
aNewSection.maSep.fBiDi = eVer >= ww::eWW8 ? ReadBSprm(pSep, 0x3228, 0) : 0;
+ // Reading section property sprmSCcolumns - one less than the number of columns in the section.
+ // It must be less than MAX_NO_OF_SEP_COLUMNS according the WW8 specification.
aNewSection.maSep.ccolM1 = ReadSprm(pSep, pIds[3], 0 );
+ if ( aNewSection.maSep.ccolM1 >= MAX_NO_OF_SEP_COLUMNS )
+ {
+ // fallback to one column
+ aNewSection.maSep.ccolM1 = 0;
+ }
//sprmSDxaColumns - Default-Abstand 1.25 cm
aNewSection.maSep.dxaColumns = ReadUSprm( pSep, pIds[4], 708 );
@@ -932,34 +940,36 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
if (eVer >= ww::eWW6)
{
// sprmSFEvenlySpaced
- aNewSection.maSep.fEvenlySpaced =
- ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) ? true : false;
+ aNewSection.maSep.fEvenlySpaced = ReadBSprm( pSep, ( eVer <= ww::eWW7 ? 138 : 0x3005 ), 1 ) ? true : false;
- if (aNewSection.maSep.ccolM1 > 0 && !aNewSection.maSep.fEvenlySpaced)
+ if ( aNewSection.maSep.ccolM1 > 0 && !aNewSection.maSep.fEvenlySpaced )
{
- aNewSection.maSep.rgdxaColumnWidthSpacing[0] = 0;
- int nCols = aNewSection.maSep.ccolM1 + 1;
- int nIdx = 0;
- for (int i = 0; i < nCols; ++i)
+ int nColumnDataIdx = 0;
+ aNewSection.maSep.rgdxaColumnWidthSpacing[nColumnDataIdx] = 0;
+
+ const sal_uInt16 nColumnWidthSprmId = ( eVer <= ww::eWW7 ? 136 : 0xF203 );
+ const sal_uInt16 nColumnSpacingSprmId = ( eVer <= ww::eWW7 ? 137 : 0xF204 );
+ const sal_uInt8 nColumnCount = static_cast< sal_uInt8 >(aNewSection.maSep.ccolM1 + 1);
+ for ( sal_uInt8 nColumn = 0; nColumn < nColumnCount; ++nColumn )
{
//sprmSDxaColWidth
- const sal_uInt8* pSW = pSep->HasSprm( (eVer <= ww::eWW7 ? 136 : 0xF203), sal_uInt8( i ) );
+ const sal_uInt8* pSW = pSep->HasSprm( nColumnWidthSprmId, nColumn );
- ASSERT( pSW, "+Sprm 136 (bzw. 0xF203) (ColWidth) fehlt" );
- sal_uInt16 nWidth = pSW ? SVBT16ToShort(pSW + 1) : 1440;
+ ASSERT( pSW != NULL, "+Sprm 136 (bzw. 0xF203) (ColWidth) fehlt" );
+ sal_uInt16 nWidth = pSW != NULL ? SVBT16ToShort( pSW + 1 ) : 1440;
- aNewSection.maSep.rgdxaColumnWidthSpacing[++nIdx] = nWidth;
+ aNewSection.maSep.rgdxaColumnWidthSpacing[++nColumnDataIdx] = nWidth;
- if (i < nCols-1)
+ if ( nColumn < nColumnCount - 1 )
{
//sprmSDxaColSpacing
- const sal_uInt8* pSD = pSep->HasSprm( (eVer <= ww::eWW7 ? 137 : 0xF204), sal_uInt8( i ) );
+ const sal_uInt8* pSD = pSep->HasSprm( nColumnSpacingSprmId, nColumn );
ASSERT( pSD, "+Sprm 137 (bzw. 0xF204) (Colspacing) fehlt" );
- if( pSD )
+ if ( pSD )
{
- nWidth = SVBT16ToShort(pSD + 1);
- aNewSection.maSep.rgdxaColumnWidthSpacing[++nIdx] = nWidth;
+ nWidth = SVBT16ToShort( pSD + 1 );
+ aNewSection.maSep.rgdxaColumnWidthSpacing[++nColumnDataIdx] = nWidth;
}
}
}
@@ -1569,7 +1579,7 @@ bool SwWW8ImplReader::SetBorder(SvxBoxItem& rBox, const WW8_BRC* pbrc,
nSetBorders has a bit set for each location that a sprm set a
border, so with a sprm set, but no border, then disable the
- appropiate border
+ appropriate border
*/
rBox.SetLine( 0, aIdArr[ i+1 ] );
}
@@ -1946,7 +1956,7 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM& rPaM,
/*
#95905#, #83307# seems to have gone away now, so reenable parallel
wrapping support for frames in headers/footers. I don't know if we truly
- have an explictly specified behaviour for these circumstances.
+ have an explicitly specified behaviour for these circumstances.
*/
nHeight = rWW.nSp45;
@@ -2600,12 +2610,12 @@ void SwWW8ImplReader::StopApo()
stack of attributes normally only places them into the document when
the current insertion point has passed them by. Otherwise the end
point of the attribute gets pushed along with the insertion point. The
- insertion point is moved and the properties commited during
+ insertion point is moved and the properties committed during
MoveOutsideFly. We also may want to remove the final paragraph in the
frame, but we need to wait until the properties for that frame text
- have been commited otherwise they will be lost. So we first get a
+ have been committed otherwise they will be lost. So we first get a
handle to the last the filter inserted. After the attributes are
- commited, if that paragraph exists we join it with the para after it
+ committed, if that paragraph exists we join it with the para after it
that comes with the frame by default so that as normal we don't end up
with one more paragraph than we wanted.
*/
@@ -2854,20 +2864,34 @@ void SwWW8ImplReader::Read_PicLoc(sal_uInt16 , const sal_uInt8* pData, short nLe
}
}
+
void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const sal_uInt8* pData, short nLen )
{
- if (pAktColl && (0 < nLen))
+ if ( nLen < 0 )
{
- if (SwWW8StyInf* pSI = GetStyle(nAktColl))
+ pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_PARATR_OUTLINELEVEL );
+ return;
+ }
+
+ if ( pAktColl != NULL )
+ {
+ SwWW8StyInf* pSI = GetStyle( nAktColl );
+ if ( pSI != NULL )
{
- pSI->nOutlineLevel = static_cast< sal_uInt8 >(
- ( (1 <= pSI->GetWWStyleId()) && (9 >= pSI->GetWWStyleId()) )
- ? pSI->GetWWStyleId()-1
- : (pData ? *pData : 0) );
+ pSI->mnWW8OutlineLevel =
+ static_cast< sal_uInt8 >( ( pData ? *pData : 0 ) );
+ NewAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL, SwWW8StyInf::WW8OutlineLevelToOutlinelevel( pSI->mnWW8OutlineLevel ) ) );
}
}
+ else if ( pPaM != NULL )
+ {
+ const sal_uInt8 nOutlineLevel =
+ SwWW8StyInf::WW8OutlineLevelToOutlinelevel( static_cast< sal_uInt8 >( ( pData ? *pData : 0 ) ) );
+ NewAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL, nOutlineLevel ) );
+ }
}
+
void SwWW8ImplReader::Read_Symbol(sal_uInt16, const sal_uInt8* pData, short nLen )
{
if( !bIgnoreText )
@@ -2940,7 +2964,7 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const sal_uInt8* pData, shor
nI = nContigiousWestern; // The out of sequence western id
else
{
- // The contigious western ids
+ // The contiguous western ids
if (eVersion <= ww::eWW2)
nI = static_cast< sal_uInt8 >(nId - 60);
else if (eVersion < ww::eWW8)
@@ -3431,7 +3455,7 @@ void SwWW8ImplReader::Read_DoubleLine_Rotate( sal_uInt16, const sal_uInt8* pData
void SwWW8ImplReader::Read_TxtColor( sal_uInt16, const sal_uInt8* pData, short nLen )
{
- //Has newer colour varient, ignore this old varient
+ //Has newer colour variant, ignore this old variant
if (!bVer67 && pPlcxMan && pPlcxMan->GetChpPLCF()->HasSprm(0x6870))
return;
@@ -3900,11 +3924,11 @@ void SwWW8ImplReader::Read_CColl( sal_uInt16, const sal_uInt8* pData, short nLen
|| pCollA[nId].bColl ) // oder Para-Style ?
return; // dann ignorieren
- // if current on loading a TOC field, and current trying to apply a hyperlink character style,
- // just ignore. For the hyperlinks inside TOC in MS Word is not same with a common hyperlink
+ // if current on loading a TOX field, and current trying to apply a hyperlink character style,
+ // just ignore. For the hyperlinks inside TOX in MS Word is not same with a common hyperlink
// Character styles: without underline and blue font color. And such type style will be applied in others
// processes.
- if (mbLoadingTOCCache && pCollA[nId].GetWWStyleId() == ww::stiHyperlink)
+ if (mbLoadingTOXCache && pCollA[nId].GetWWStyleId() == ww::stiHyperlink)
{
return;
}
@@ -3937,7 +3961,7 @@ void SwWW8ImplReader::Read_FontKern( sal_uInt16, const sal_uInt8* , short nLen )
void SwWW8ImplReader::Read_CharShadow( sal_uInt16, const sal_uInt8* pData, short nLen )
{
- //Has newer colour varient, ignore this old varient
+ //Has newer colour variant, ignore this old variant
if (!bVer67 && pPlcxMan && pPlcxMan->GetChpPLCF()->HasSprm(0xCA71))
return;
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 12052d8bf316..72c77f0273a3 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5001,7 +5001,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart)
settings its end to the current start, then store the starting
position of the current range to clipstart. The pPcd sprms
will end as normal (albeit earlier than originally expected),
- and the existance of a clipstart will force the pPcd iterater
+ and the existence of a clipstart will force the pPcd iterater
to reread the current set of sprms instead of advancing to its
next set. Then the clipstart will be set as the starting
position which will force them to be applied directly after
@@ -5033,7 +5033,7 @@ void WW8PLCFMan::AdvNoSprm(short nIdx, bool bStart)
{
/*
For the case of a piece table we slave the piece table attribute iterator
- to the piece table and access it through that only. They are two seperate
+ to the piece table and access it through that only. They are two separate
structures, but act together as one logical one. The attributes only go
to the next entry when the piece changes
*/
@@ -6457,7 +6457,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
break;
nMax++;
nLeft -= nNextSiz;
- if( nLeft < 1 ) // can we read the given ammount of bytes ?
+ if( nLeft < 1 ) // can we read the given amount of bytes ?
break;
// increase p by nNextSiz Bytes
p = (WW8_FFN *)( ( (sal_uInt8*)p ) + nNextSiz );
@@ -6626,9 +6626,9 @@ WW8PLCF_HdFt::WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop )
footnote *and endnote!!* seperator,continuation seperator, and
continuation notice entry, the documentation does not mention the
endnote seperators, the documentation also gets the index numbers
- backwards when specifiying which bits to test. The bottom six bits
+ backwards when specifying which bits to test. The bottom six bits
of this value must be tested and skipped over. Each section's
- grpfIhdt is then tested for the existence of the appropiate headers
+ grpfIhdt is then tested for the existence of the appropriate headers
and footers, at the end of each section the nIdxOffset must be updated
to point to the beginning of the next section's group of headers and
footers in this PLCF, UpdateIndex does that task.
@@ -7461,7 +7461,7 @@ sal_uInt16 wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
nL = static_cast< sal_uInt16 >(SVBT16ToShort( &pSprm[1 + mnDelta] ) + aSprm.nLen - 1);
break;
default:
- ASSERT(!this, "Unknown sprm varient");
+ ASSERT(!this, "Unknown sprm variant");
break;
}
break;
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 2ca49778aa62..23538d34e910 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -73,7 +73,7 @@ namespace SL
}
/**
- winword strings are typically Belt and Braces strings preceeded with a
+ winword strings are typically Belt and Braces strings preceded with a
pascal style count, and ending with a c style 0 terminator. 16bit chars
and count for ww8+ and 8bit chars and count for ww7-. The count and 0
can be checked for integrity to catch errors (e.g. lotus created documents)
@@ -483,7 +483,7 @@ public:
sal_uInt8* mpData;
sal_uInt16 mnLen;
- sal_uInt16 mnIStd; // only for Fkp.Papx (actualy Style-Nr)
+ sal_uInt16 mnIStd; // only for Fkp.Papx (actually Style-Nr)
bool mbMustDelete;
explicit Entry(WW8_FC nFC) : mnFC(nFC), mpData(0), mnLen(0),
@@ -1564,15 +1564,15 @@ public:
sal_uInt16 fWriteReservation : 1;
sal_uInt16 fLockRev : 1; // when 1, the current revision marking state is locked
sal_uInt16 fEmbedFonts : 1; // when 1, document contains embedded True Type fonts
- // compatability options
+ // compatibility options
sal_uInt16 copts_fNoTabForInd : 1; // when 1, don�t add automatic tab stops for hanging indent
sal_uInt16 copts_fNoSpaceRaiseLower : 1; // when 1, don�t add extra space for raised or lowered characters
- sal_uInt16 copts_fSupressSpbfAfterPgBrk : 1; // when 1, supress the paragraph Space Before and Space After options after a page break
+ sal_uInt16 copts_fSupressSpbfAfterPgBrk : 1; // when 1, suppress the paragraph Space Before and Space After options after a page break
sal_uInt16 copts_fWrapTrailSpaces : 1; // when 1, wrap trailing spaces at the end of a line to the next line
sal_uInt16 copts_fMapPrintTextColor : 1; // when 1, print colors as black on non-color printers
sal_uInt16 copts_fNoColumnBalance : 1; // when 1, don�t balance columns for Continuous Section starts
sal_uInt16 copts_fConvMailMergeEsc : 1;
- sal_uInt16 copts_fSupressTopSpacing : 1; // when 1, supress extra line spacing at top of page
+ sal_uInt16 copts_fSupressTopSpacing : 1; // when 1, suppress extra line spacing at top of page
sal_uInt16 copts_fOrigWordTableRules : 1; // when 1, combine table borders like Word 5.x for the Macintosh
sal_uInt16 copts_fTransparentMetafiles : 1; // when 1, don�t blank area between metafile pictures
sal_uInt16 copts_fShowBreaksInFrames : 1; // when 1, show hard page or column breaks in frames
@@ -1625,7 +1625,7 @@ public:
/*
bei nFib >= 103 gehts weiter:
*/
- sal_uInt32 fNoTabForInd :1; // see above in compatability options
+ sal_uInt32 fNoTabForInd :1; // see above in compatibility options
sal_uInt32 fNoSpaceRaiseLower :1; // see above
sal_uInt32 fSupressSpbfAfterPageBreak :1; // see above
sal_uInt32 fWrapTrailSpaces :1; // see above
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index 7591e04ea758..602396521609 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -818,7 +818,7 @@ struct WW8_PCD
// properties of the piece.
};
-// AnnoTation Refernce Descriptor (ATRD)
+// AnnoTation References Descriptor (ATRD)
struct WW8_ATRD // fuer die 8-Version
{
SVBT16 xstUsrInitl[ 10 ]; // pascal-style String holding initials
@@ -968,6 +968,9 @@ struct WW8_WKB
# pragma pack()
#endif
+// Maximum number of columns according the WW8 specification
+static const sal_uInt8 MAX_NO_OF_SEP_COLUMNS = 44;
+
struct SEPr
{
SEPr();
@@ -1027,7 +1030,7 @@ struct SEPr
sal_uInt32 dzaGutter;
sal_uInt32 dyaHdrTop;
sal_uInt32 dyaHdrBottom;
- sal_Int16 ccolM1;
+ sal_Int16 ccolM1; // have to be less than MAX_NO_OF_SEP_COLUMNS according the WW8 specification
sal_Int8 fEvenlySpaced;
sal_Int8 reserved3;
sal_uInt8 fBiDi;
@@ -1035,7 +1038,13 @@ struct SEPr
sal_uInt8 fRTLGutter;
sal_uInt8 fRTLAlignment;
sal_Int32 dxaColumns;
- sal_Int32 rgdxaColumnWidthSpacing[89];
+
+ // Fixed array - two entries for each SEP column to store width of column and spacing to next column.
+ // At odd index values [1,3,5,...] the column widths are stored.
+ // At even index values [2,4,6,...] the spacings to the next columns are stored.
+ // Value at index 0 is initialized with 0 and used for easier interation on the array
+ sal_Int32 rgdxaColumnWidthSpacing[MAX_NO_OF_SEP_COLUMNS*2 + 1];
+
sal_Int32 dxaColumnWidth;
sal_uInt8 dmOrientFirst;
sal_uInt8 fLayout;
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index d9dba00051e0..86bc243962b9 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -19,14 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#define _SVSTDARR_STRINGS
#include <rsc/rscsfx.hxx>
#include <tools/urlobj.hxx>
@@ -57,7 +52,6 @@
#include <svx/xmleohlp.hxx>
#include <comphelper/genericpropertyset.hxx>
#include <rtl/logfile.hxx>
-
#include <sfx2/frame.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <swerror.h>
@@ -69,34 +63,22 @@
#include <swmodule.hxx>
#include <SwXMLSectionList.hxx>
#include <svx/svdlegacy.hxx>
-
#include <statstr.hrc>
-
-// --> OD 2005-09-06 #i44177#
#include <SwStyleNameMapper.hxx>
#include <poolfmt.hxx>
#include <numrule.hxx>
#include <paratr.hxx>
-// <--
-
-// --> OD 2006-02-22 #b6382898#
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdograf.hxx>
-// <--
-
-// --> OD 2008-12-17 #i70748#
#include <sfx2/docfilt.hxx>
-// <--
-
#include <istyleaccess.hxx>
#define LOGFILE_AUTHOR "mb93740"
-
#include <sfx2/DocumentMetadataAccess.hxx>
#include <svx/fmmodel.hxx>
-
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -338,7 +320,7 @@ sal_Int32 ReadThroughComponent(
if (!bContainsStream )
{
// stream name not found! Then try the compatibility name.
- // if no stream can be opened, return immediatly with OK signal
+ // if no stream can be opened, return immediately with OK signal
// do we even have an alternative name?
if ( NULL == pCompatibilityStreamName )
@@ -406,7 +388,7 @@ sal_Int32 ReadThroughComponent(
return ERR_SWG_READ_ERROR;
}
-// --> OD 2005-09-06 #i44177#
+
void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
{
// array containing the names of the default outline styles ('Heading 1',
@@ -465,18 +447,15 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
const SwNumRule* pOutlineRule = _rDoc.GetOutlineNumRule();
for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
{
- // --> OD 2007-01-11 #i73361#
+ // #i73361#
// Do not change assignment of already created default outline style
// to a certain outline level.
-// if ( aCreatedDefaultOutlineStyles[ i ] != 0 && !aOutlineLevelAssigned[ i ] )
if ( !aOutlineLevelAssigned[ i ] &&
aCreatedDefaultOutlineStyles[ i ] != 0 &&
! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() )
- // <--
{
// apply outline level at created default outline style
- //aCreatedDefaultOutlineStyles[ i ]->SetOutlineLevel( i );
- aCreatedDefaultOutlineStyles[ i ]->AssignToListLevelOfOutlineStyle(i);//#outline level added by zhaojianwei
+ aCreatedDefaultOutlineStyles[i]->AssignToListLevelOfOutlineStyle( i ); //#outline level added by zhaojianwei
// apply outline numbering rule, if none is set.
const SfxPoolItem& rItem =
@@ -490,9 +469,8 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
}
}
-// <--
-// --> OD 2006-02-22 #b6382898#
+
void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SwDoc& _rDoc )
{
if ( _rDoc.GetDrawModel() &&
@@ -535,7 +513,6 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SwDoc& _rDoc )
}
}
}
-// <--
sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, const String & rName )
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 037d69384cd3..0fcc51c4979a 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -59,12 +57,10 @@
#include <editeng/unolingu.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <ForbiddenCharactersEnum.hxx>
-
-// for locking SolarMutex: svapp + mutex
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
-
#include <pausethreadstarting.hxx>
+#include <drawdoc.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -322,6 +318,15 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
}
}
+ // TTTT: Not needed for aw080, always updated
+ // if((getExportFlags() & (EXPORT_MASTERSTYLES | EXPORT_CONTENT)) != 0)
+ // {
+ // //Auf die Korrektheit der OrdNums sind wir schon angewiesen.
+ // SwDrawModel* pModel = pDoc->GetDrawModel();
+ // if(pModel)
+ // pModel->GetPage(0)->RecalcObjOrdNums();
+ // }
+
// adjust document class (eClass)
if (pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT))
{
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index b104923237e4..07a7f61a8bb9 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -61,15 +59,13 @@
#include <tools/diagnose_ex.h>
#include <hash_set>
#include <stringhash.hxx>
-
-// for locking SolarMutex: svapp + mutex
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <unotxdoc.hxx> // for initXForms()
-
#include <xmloff/xmlmetai.hxx>
#include <xmloff/xformsimport.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using ::rtl::OUString;
@@ -744,7 +740,7 @@ void SwXMLImport::startDocument( void )
// <--
// SJ: #i49801# locking the modell to disable repaints
- SdrModel* pDrawModel = pDoc->GetDrawModel();
+ SwDrawModel* pDrawModel = pDoc->GetDrawModel();
if ( pDrawModel )
pDrawModel->setLock( sal_True );
@@ -950,7 +946,7 @@ void SwXMLImport::endDocument( void )
// SJ: #i49801# -> now permitting repaints
if ( pDoc )
{
- SdrModel* pDrawModel = pDoc->GetDrawModel();
+ SwDrawModel* pDrawModel = pDoc->GetDrawModel();
if ( pDrawModel )
pDrawModel->setLock( sal_False );
}
@@ -1407,7 +1403,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
// SO8. Unfortunately, only part of it and by using the same compatibility option
// like in SO8. Therefore documents generated with SO7pp4, containing
// numbered paragraphs with first line indent differ between SO7pp4 and
- // SO8. In order to fix this for SO8pp1, I introduce a new compatiblity
+ // SO8. In order to fix this for SO8pp1, I introduce a new compatibility
// flag 'bIgnoreFirstLineIndentInNumbering'. This flag has to be set for all
// documents < SO8, but not for SO8. So if the property is not present, the
// flag will be set to 'true'. SO8 documents surely have the
diff --git a/sw/source/filter/xml/xmlitmap.hxx b/sw/source/filter/xml/xmlitmap.hxx
index 843f8723cf0c..4bc737e11345 100644
--- a/sw/source/filter/xml/xmlitmap.hxx
+++ b/sw/source/filter/xml/xmlitmap.hxx
@@ -48,14 +48,14 @@ namespace rtl { class OUString; }
struct SvXMLItemMapEntry
{
- sal_uInt16 nNameSpace; // declares the Namespace in wich this item
+ sal_uInt16 nNameSpace; // declares the Namespace in which this item
// exists
enum ::xmloff::token::XMLTokenEnum eLocalName;
// the local name for the item inside
// the Namespace (as an XMLTokenEnum)
sal_uInt16 nWhichId; // the WichId to identify the item
// in the pool
- sal_uInt32 nMemberId; // the memberid specifies wich part
+ sal_uInt32 nMemberId; // the memberid specifies which part
// of the item should be imported or
// exported with this Namespace
// and localName
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 504a34886730..8b4c1d785bf3 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2525,7 +2525,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
sal_Int32 nExtraRel = nRelWidth - (nRelCols * nMinRelColWidth);
// The absolute space that may be distributed in addition to
- // minumum widthed columns.
+ // minimum widthed columns.
sal_Int32 nMinAbs = nRelCols * MINLAY;
sal_Int32 nExtraAbs =
nAbsForRelWidth > nMinAbs ? nAbsForRelWidth - nMinAbs : (sal_Int32)0L;
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 84c980f1d92d..edc81d7383e4 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -211,31 +211,33 @@ SwXMLTextParagraphExport::~SwXMLTextParagraphExport()
}
void SwXMLTextParagraphExport::setTextEmbeddedGraphicURL(
- const Reference < XPropertySet >& rPropSet,
- OUString& rURL) const
-{
- if( !rURL.getLength() )
+ const Reference< XPropertySet >& rPropSet,
+ OUString& rURL ) const
+ {
+ if ( !rURL.getLength() )
return;
SwGrfNode *pGrfNd = GetNoTxtNode( rPropSet )->GetGrfNode();
- if( !pGrfNd->IsGrfLink() )
+ if ( !pGrfNd->IsGrfLink() )
{
- String aNewURL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.Package:") );
- aNewURL += String(rURL);
- pGrfNd->SetNewStreamName( aNewURL );
+ // Apply new embedded stream name, only if graphic node already has one.
+ // - The saving of recovery information triggers this method, but for a newly created
+ // document the new embedded stream name shall not be applied.
+ // - The saving of a newly created document to own format (ODF) triggers this method,
+ // but the embedded stream name is not needed as its original inserted data is still in use.
+ if ( pGrfNd->HasEmbeddedStreamName() )
+ {
+ String aNewURL( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.Package:" ) );
+ aNewURL += String( rURL );
+ pGrfNd->ApplyNewEmbeddedStreamName( aNewURL );
+ }
// #i15411# save-as will swap all graphics in; we need to swap
// them out again, to prevent excessive memory use
pGrfNd->SwapOut();
}
}
-/*
-static void lcl_addParam ( SvXMLExport &rExport, const SvCommand &rCommand )
-{
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rCommand.GetCommand() );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_VALUE, rCommand.GetArgument() );
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_PARAM, sal_False, sal_True );
-}*/
+
static void lcl_addURL ( SvXMLExport &rExport, const String &rURL,
sal_Bool bToRel = sal_True )
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 39b6b06d7b07..80baf675bf44 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -172,7 +172,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
*ppRdr = pPaM ? new SwReader( rMedium, aFileName, *pPaM ) :
pCrsrShell ?
new SwReader( rMedium, aFileName, *pCrsrShell->GetCrsr() )
- : new SwReader( rMedium, aFileName, pDoc );
+ : new SwReader( rMedium, aFileName, mpDoc );
}
else
return 0;
@@ -206,7 +206,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
// #i30171# set the UpdateDocMode at the SwDocShell
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
- nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
+ mnUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
if( pFlt->GetDefaultTemplate().Len() )
pRead->SetTemplateName( pFlt->GetDefaultTemplate() );
@@ -250,26 +250,26 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
pRdr->GetDoc()->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this));
- /* #106748# Restore the pool default if reading a saved document. */
- pDoc->RemoveAllFmtLanguageDependencies();
+ // Restore the pool default if reading a saved document.
+ mpDoc->RemoveAllFmtLanguageDependencies();
sal_uLong nErr = pRdr->Read( *pRead );
// Evtl. ein altes Doc weg
- if ( pDoc != pRdr->GetDoc() )
+ if ( mpDoc != pRdr->GetDoc() )
{
- if( pDoc )
+ if( mpDoc )
RemoveLink();
- pDoc = pRdr->GetDoc();
+ mpDoc = pRdr->GetDoc();
AddLink();
if ( !mxBasePool.is() )
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
}
UpdateFontList();
- InitDraw();
+ InitDrawModelAndDocShell(this, mpDoc ? mpDoc->GetDrawModel() : 0);
delete pRdr;
@@ -278,22 +278,27 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
sal_Bool bOk = !IsError( nErr );
- // --> OD 2006-11-07 #i59688#
-// // StartFinishedLoading rufen. Nicht bei asynchronen Filtern!
-// // Diese muessen das selbst rufen!
-// if( bOk && !pDoc->IsInLoadAsynchron() )
-// StartLoadFinishedTimer();
- if ( bOk && !pDoc->IsInLoadAsynchron() )
+ if ( bOk && !mpDoc->IsInLoadAsynchron() )
{
LoadingFinished();
}
- // <--
pRead->setSotStorageRef(pStg); // #i45333# save sot storage ref in case of recursive calls
return bOk;
}
+
+void SwDocShell::BeforeLoading( SfxMedium&, const ::rtl::OUString &, const ::rtl::OUString & )
+{
+ if ( mpDoc == NULL )
+ {
+ return;
+ }
+
+ mpDoc->RemoveAllFmtLanguageDependencies();
+}
+
/*--------------------------------------------------------------------
Beschreibung: Sichern des Default-Formats, Stg vorhanden
--------------------------------------------------------------------*/
@@ -303,18 +308,18 @@ sal_Bool SwDocShell::Save()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::Save" );
//#i3370# remove quick help to prevent saving of autocorrection suggestions
- if(pView)
- pView->GetEditWin().StopQuickHelp();
+ if(mpView)
+ mpView->GetEditWin().StopQuickHelp();
SwWait aWait( *this, true );
CalcLayoutForOLEObjects(); // format for OLE objets
// --> OD 2006-03-17 #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
- if ( pWrtShell && pDoc &&
- pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
- docfunc::AllDrawObjsOnPage( *pDoc ) )
+ if ( mpWrtShell && mpDoc &&
+ mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
+ docfunc::AllDrawObjsOnPage( *mpDoc ) )
{
- pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
+ mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
// <--
@@ -332,7 +337,7 @@ sal_Bool SwDocShell::Save()
WriterRef xWrt;
::GetXMLWriter( aEmptyStr, GetMedium()->GetBaseURL( true ), xWrt );
xWrt->SetOrganizerMode( sal_True );
- SwWriter aWrt( *GetMedium(), *pDoc );
+ SwWriter aWrt( *GetMedium(), *mpDoc );
nErr = aWrt.Write( xWrt );
xWrt->SetOrganizerMode( sal_False );
}
@@ -347,35 +352,35 @@ sal_Bool SwDocShell::Save()
case SFX_CREATE_MODE_PREVIEW:
default:
{
- if( pDoc->ContainsMSVBasic() )
+ if( mpDoc->ContainsMSVBasic() )
{
//TODO/MBA: it looks as that this code can be removed!
//SvxImportMSVBasic aTmp( *this, pIo->GetStorage() );
//aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr );
if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) );
- pDoc->SetContainsMSVBasic( sal_False );
+ mpDoc->SetContainsMSVBasic( sal_False );
}
// TabellenBox Edit beenden!
- if( pWrtShell )
- pWrtShell->EndAllTblBoxEdit();
+ if( mpWrtShell )
+ mpWrtShell->EndAllTblBoxEdit();
WriterRef xWrt;
::GetXMLWriter( aEmptyStr, GetMedium()->GetBaseURL( true ), xWrt );
sal_Bool bLockedView(sal_False);
- if ( pWrtShell )
+ if ( mpWrtShell )
{
- bLockedView = pWrtShell->IsViewLocked();
- pWrtShell->LockView( sal_True ); //lock visible section
+ bLockedView = mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( sal_True ); //lock visible section
}
- SwWriter aWrt( *GetMedium(), *pDoc );
+ SwWriter aWrt( *GetMedium(), *mpDoc );
nErr = aWrt.Write( xWrt );
- if ( pWrtShell )
- pWrtShell->LockView( bLockedView );
+ if ( mpWrtShell )
+ mpWrtShell->LockView( bLockedView );
}
break;
}
@@ -383,7 +388,7 @@ sal_Bool SwDocShell::Save()
}
SetError( nErr ? nErr : nVBWarning, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
- SfxViewFrame* pFrm = pWrtShell ? pWrtShell->GetView().GetViewFrame() : 0;
+ SfxViewFrame* pFrm = mpWrtShell ? mpWrtShell->GetView().GetViewFrame() : 0;
if( pFrm )
{
pFrm->GetBindings().SetState( SfxStringItem( SID_DOC_MODIFIED, ' ' ));
@@ -400,7 +405,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SaveAs" );
- pDoc->setDocAccTitle(String());
+ mpDoc->setDocAccTitle(String());
SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this );
if (pFrame1)
{
@@ -416,19 +421,19 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
}
SwWait aWait( *this, true );
//#i3370# remove quick help to prevent saving of autocorrection suggestions
- if(pView)
- pView->GetEditWin().StopQuickHelp();
+ if(mpView)
+ mpView->GetEditWin().StopQuickHelp();
//#i91811# mod if we have an active margin window, write back the text
- if ( pView &&
- pView->GetPostItMgr() &&
- pView->GetPostItMgr()->HasActiveSidebarWin() )
+ if ( mpView &&
+ mpView->GetPostItMgr() &&
+ mpView->GetPostItMgr()->HasActiveSidebarWin() )
{
- pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
+ mpView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
}
- if( pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) &&
- !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) )
+ if( mpDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) &&
+ !mpDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) )
RemoveOLEObjects();
{
@@ -455,11 +460,11 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
CalcLayoutForOLEObjects(); // format for OLE objets
// --> OD 2006-03-17 #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
- if ( pWrtShell && pDoc &&
- pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
- docfunc::AllDrawObjsOnPage( *pDoc ) )
+ if ( mpWrtShell && mpDoc &&
+ mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
+ docfunc::AllDrawObjsOnPage( *mpDoc ) )
{
- pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
+ mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
// <--
@@ -485,26 +490,26 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
xDocSh->DoClose();
}
- if( pDoc->ContainsMSVBasic() )
+ if( mpDoc->ContainsMSVBasic() )
{
//TODO/MBA: it looks as that this code can be removed!
//SvxImportMSVBasic aTmp( *this, pIo->GetStorage() );
//aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr );
if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this );
- pDoc->SetContainsMSVBasic( sal_False );
+ mpDoc->SetContainsMSVBasic( sal_False );
}
// TabellenBox Edit beenden!
- if( pWrtShell )
- pWrtShell->EndAllTblBoxEdit();
+ if( mpWrtShell )
+ mpWrtShell->EndAllTblBoxEdit();
// Modified-Flag merken und erhalten ohne den Link zu Callen
// (fuer OLE; nach Anweisung von MM)
- sal_Bool bIsModified = pDoc->IsModified();
- pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
- Link aOldOLELnk( pDoc->GetOle2Link() );
- pDoc->SetOle2Link( Link() );
+ sal_Bool bIsModified = mpDoc->IsModified();
+ mpDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
+ Link aOldOLELnk( mpDoc->GetOle2Link() );
+ mpDoc->SetOle2Link( Link() );
// SfxProgress unterdruecken, wenn man Embedded ist
SW_MOD()->SetEmbeddedLoadSave(
@@ -514,24 +519,24 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
::GetXMLWriter( aEmptyStr, rMedium.GetBaseURL( true ), xWrt );
sal_Bool bLockedView(sal_False);
- if ( pWrtShell )
+ if ( mpWrtShell )
{
- bLockedView = pWrtShell->IsViewLocked();
- pWrtShell->LockView( sal_True ); //lock visible section
+ bLockedView = mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( sal_True ); //lock visible section
}
- SwWriter aWrt( rMedium, *pDoc );
+ SwWriter aWrt( rMedium, *mpDoc );
nErr = aWrt.Write( xWrt );
- if ( pWrtShell )
- pWrtShell->LockView( bLockedView );
+ if ( mpWrtShell )
+ mpWrtShell->LockView( bLockedView );
if( bIsModified )
{
- pDoc->SetModified();
- pDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
+ mpDoc->SetModified();
+ mpDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
}
- pDoc->SetOle2Link( aOldOLELnk );
+ mpDoc->SetOle2Link( aOldOLELnk );
SW_MOD()->SetEmbeddedLoadSave( sal_False );
}
@@ -568,20 +573,20 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
//#i3370# remove quick help to prevent saving of autocorrection suggestions
- if(pView)
- pView->GetEditWin().StopQuickHelp();
+ if(mpView)
+ mpView->GetEditWin().StopQuickHelp();
//#i91811# mod if we have an active margin window, write back the text
- if ( pView &&
- pView->GetPostItMgr() &&
- pView->GetPostItMgr()->HasActiveSidebarWin() )
+ if ( mpView &&
+ mpView->GetPostItMgr() &&
+ mpView->GetPostItMgr()->HasActiveSidebarWin() )
{
- pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
+ mpView->GetPostItMgr()->UpdateDataOnActiveSidebarWin();
}
sal_uLong nVBWarning = 0;
- if( pDoc->ContainsMSVBasic() )
+ if( mpDoc->ContainsMSVBasic() )
{
sal_Bool bSave = pFlt->GetUserData().EqualsAscii( "CWW8" )
&& SvtFilterOptions::Get()->IsLoadWordBasicStorage();
@@ -594,14 +599,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
{
nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, String::CreateFromAscii("Macros") );
xStg->Commit();
- pDoc->SetContainsMSVBasic( sal_True );
+ mpDoc->SetContainsMSVBasic( sal_True );
}
}
}
// TabellenBox Edit beenden!
- if( pWrtShell )
- pWrtShell->EndAllTblBoxEdit();
+ if( mpWrtShell )
+ mpWrtShell->EndAllTblBoxEdit();
if( pFlt->GetUserData().EqualsAscii( "HTML") )
{
@@ -631,17 +636,17 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
// --> FME 2007-5-7 #i76360# Update document statistics
- SwDocStat aDocStat( pDoc->GetDocStat() );;
- pDoc->UpdateDocStat( aDocStat );
+ SwDocStat aDocStat( mpDoc->GetDocStat() );;
+ mpDoc->UpdateDocStat( aDocStat );
// <--
CalcLayoutForOLEObjects(); // format for OLE objets
// --> OD 2006-03-17 #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
- if ( pWrtShell && pDoc &&
- pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
- docfunc::AllDrawObjsOnPage( *pDoc ) )
+ if ( mpWrtShell && mpDoc &&
+ mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
+ docfunc::AllDrawObjsOnPage( *mpDoc ) )
{
- pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
+ mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
// <--
@@ -715,7 +720,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
if( pFlt->GetUserData().EqualsAscii( FILTER_TEXT_DLG ) &&
- ( pWrtShell || !::lcl_GetSourceView( this ) ))
+ ( mpWrtShell || !::lcl_GetSourceView( this ) ))
{
SwAsciiOptions aOpt;
String sItemOpt;
@@ -742,25 +747,25 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
String aFileName( rMedium.GetName() );
//Keine View also das ganze Dokument!
- if ( pWrtShell )
+ if ( mpWrtShell )
{
SwWait aWait( *this, true );
// --> OD 2009-12-31 #i106906#
- const sal_Bool bFormerLockView = pWrtShell->IsViewLocked();
- pWrtShell->LockView( sal_True );
+ const sal_Bool bFormerLockView = mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( sal_True );
// <--
- pWrtShell->StartAllAction();
- pWrtShell->Push();
- SwWriter aWrt( rMedium, *pWrtShell, sal_True );
+ mpWrtShell->StartAllAction();
+ mpWrtShell->Push();
+ SwWriter aWrt( rMedium, *mpWrtShell, sal_True );
nErrno = aWrt.Write( xWriter, &aFileName );
//JP 16.05.97: falls der SFX uns die View waehrend des speicherns
// entzieht
- if( pWrtShell )
+ if( mpWrtShell )
{
- pWrtShell->Pop(sal_False);
- pWrtShell->EndAllAction();
+ mpWrtShell->Pop(sal_False);
+ mpWrtShell->EndAllAction();
// --> OD 2009-12-31 #i106906#
- pWrtShell->LockView( bFormerLockView );
+ mpWrtShell->LockView( bFormerLockView );
// <--
}
}
@@ -775,7 +780,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
else
{
- SwWriter aWrt( rMedium, *pDoc );
+ SwWriter aWrt( rMedium, *mpDoc );
nErrno = aWrt.Write( xWriter, &aFileName );
}
}
@@ -806,21 +811,21 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
{
// erst hier entscheiden, ob das Speichern geklappt hat oder nicht
if( IsModified() )
- pDoc->SetModified();
+ mpDoc->SetModified();
else
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
- if( pOLEChildList )
+ if( mpOLEChildList )
{
sal_Bool bResetModified = IsEnableSetModified();
if( bResetModified )
EnableSetModified( sal_False );
- uno::Sequence < rtl::OUString > aNames = pOLEChildList->GetObjectNames();
+ uno::Sequence < rtl::OUString > aNames = mpOLEChildList->GetObjectNames();
for( sal_Int32 n = aNames.getLength(); n; n-- )
{
- if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
+ if ( !mpOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
{
DBG_ERROR( "Copying of objects didn't work!" );
}
@@ -830,7 +835,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
//pPersist->Move( &aRef, aRef->GetStorageName() );
}
- DELETEZ( pOLEChildList );
+ DELETEZ( mpOLEChildList );
if( bResetModified )
EnableSetModified( sal_True );
}
@@ -868,10 +873,10 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
JobSetup *pOrig = 0;
if ( rSetup.GetPrinterName().Len() && ASPECT_THUMBNAIL != nAspect )
{
- pOrig = const_cast<JobSetup*>(pDoc->getJobsetup());
+ pOrig = const_cast<JobSetup*>(mpDoc->getJobsetup());
if( pOrig ) // dann kopieren wir uns den
pOrig = new JobSetup( *pOrig );
- pDoc->setJobsetup( rSetup );
+ mpDoc->setJobsetup( rSetup );
}
Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
@@ -883,12 +888,12 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
pDev->SetBackground();
sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell* >( this);
SwPrintData aOpts;
- ViewShell::PrtOle2( pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect );
+ ViewShell::PrtOle2( mpDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect );
pDev->Pop();
if( pOrig )
{
- pDoc->setJobsetup( *pOrig );
+ mpDoc->setJobsetup( *pOrig );
delete pOrig;
}
if ( bResetModified )
@@ -899,9 +904,9 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
void SwDocShell::SetVisArea( const Rectangle &rRect )
{
Rectangle aRect( rRect );
- if ( pView )
+ if ( mpView )
{
- Size aSz( pView->GetDocSz() );
+ Size aSz( mpView->GetDocSz() );
aSz.Width() += DOCUMENTBORDER; aSz.Height() += DOCUMENTBORDER;
long nMoveX = 0, nMoveY = 0;
if ( aRect.Right() > aSz.Width() )
@@ -914,7 +919,7 @@ void SwDocShell::SetVisArea( const Rectangle &rRect )
aRect.Move( nMoveX, nMoveY );
//Ruft das SfxInPlaceObject::SetVisArea()!
- pView->SetVisArea( aRect, sal_True );
+ mpView->SetVisArea( aRect, sal_True );
}
else
SfxObjectShell::SetVisArea( aRect );
@@ -926,8 +931,8 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
if ( nAspect == ASPECT_THUMBNAIL )
{
//PreView: VisArea auf die erste Seite einstellen.
- SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 1 );
- SwCntntNode* pNd = pDoc->GetNodes().GoNext( &aIdx );
+ SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfExtras(), 1 );
+ SwCntntNode* pNd = mpDoc->GetNodes().GoNext( &aIdx );
const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False );
return aPageRect.SVRect();
@@ -937,12 +942,12 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
Printer *SwDocShell::GetDocumentPrinter()
{
- return pDoc->getPrinter( false );
+ return mpDoc->getPrinter( false );
}
OutputDevice* SwDocShell::GetDocumentRefDev()
{
- return pDoc->getReferenceDevice( false );
+ return mpDoc->getReferenceDevice( false );
}
void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter )
@@ -1001,12 +1006,12 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
void SwDocShell::GetState(SfxItemSet& rSet)
{
- SfxWhichIter aIter(rSet);
- sal_uInt16 nWhich = aIter.FirstWhich();
+ SfxWhichIter aIter( rSet );
+ sal_uInt16 nWhich = aIter.FirstWhich();
while (nWhich)
{
- switch (nWhich)
+ switch ( nWhich )
{
case SID_PRINTPREVIEW:
{
@@ -1014,16 +1019,16 @@ void SwDocShell::GetState(SfxItemSet& rSet)
// Disable "multiple layout"
if ( !bDisable )
{
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this);
+ SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this );
while (pTmpFrm) // Preview suchen
{
if ( dynamic_cast< SwView* >(pTmpFrm->GetViewShell()) &&
- ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
+ ( (SwView*) pTmpFrm->GetViewShell() )->GetWrtShell().GetViewOptions()->getBrowseMode() )
{
bDisable = sal_True;
break;
}
- pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this);
+ pTmpFrm = pTmpFrm->GetNext( *pTmpFrm, this );
}
}
// End of disabled "multiple layout"
@@ -1031,49 +1036,53 @@ void SwDocShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( SID_PRINTPREVIEW );
else
{
- SfxBoolItem aBool( SID_PRINTPREVIEW, false);
- if( dynamic_cast< SwPagePreView* >( SfxViewShell::Current()) )
- aBool.SetValue( true );
+ SfxBoolItem aBool( SID_PRINTPREVIEW, sal_False );
+ if ( dynamic_cast< SwPagePreView* >( SfxViewShell::Current()) )
+ aBool.SetValue( sal_True );
rSet.Put( aBool );
}
}
break;
+
case SID_SOURCEVIEW:
{
- SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView()
- : SfxViewShell::Current();
+ SfxViewShell* pCurrView = GetView() ? (SfxViewShell*) GetView()
+ :
+ SfxViewShell::Current();
sal_Bool bSourceView = 0 != dynamic_cast< SwSrcView* >( pCurrView);
- rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView));
+ rSet.Put( SfxBoolItem( SID_SOURCEVIEW, bSourceView ) );
}
break;
+
case SID_HTML_MODE:
- rSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this)));
- break;
+ rSet.Put( SfxUInt16Item( SID_HTML_MODE, ::GetHtmlMode( this ) ) );
+ break;
case FN_ABSTRACT_STARIMPRESS:
case FN_OUTLINE_TO_IMPRESS:
- {
- SvtModuleOptions aMOpt;
- if ( !aMOpt.IsImpress() )
- rSet.DisableItem( nWhich );
- }
- /* no break here */
+ {
+ SvtModuleOptions aMOpt;
+ if ( !aMOpt.IsImpress() )
+ rSet.DisableItem( nWhich );
+ }
+ /* no break here */
case FN_ABSTRACT_NEWDOC:
case FN_OUTLINE_TO_CLIPBOARD:
- {
- if ( !GetDoc()->GetNodes().GetOutLineNds().Count() )
- rSet.DisableItem( nWhich );
- }
- break;
+ {
+ if ( !GetDoc()->GetNodes().GetOutLineNds().Count() )
+ rSet.DisableItem( nWhich );
+ }
+ break;
+
case SID_BROWSER_MODE:
case FN_PRINT_LAYOUT:
- {
- sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE);
- if(FN_PRINT_LAYOUT == nWhich)
- bState = !bState;
- rSet.Put( SfxBoolItem( nWhich, bState));
- }
- break;
+ {
+ sal_Bool bState = GetDoc()->get( IDocumentSettingAccess::BROWSE_MODE );
+ if ( FN_PRINT_LAYOUT == nWhich )
+ bState = !bState;
+ rSet.Put( SfxBoolItem( nWhich, bState ) );
+ }
+ break;
case FN_NEW_GLOBAL_DOC:
if ( dynamic_cast< SwGlobalDocShell* >(this) )
@@ -1081,29 +1090,32 @@ void SwDocShell::GetState(SfxItemSet& rSet)
break;
case FN_NEW_HTML_DOC:
- if( dynamic_cast< SwWebDocShell* >(this) )
+ if ( dynamic_cast< SwWebDocShell* >(this) )
rSet.DisableItem( nWhich );
break;
case SID_ATTR_YEAR2000:
- {
- const SvNumberFormatter* pFmtr = pDoc->GetNumberFormatter(sal_False);
- rSet.Put( SfxUInt16Item( nWhich,
- static_cast< sal_uInt16 >(
- pFmtr ? pFmtr->GetYear2000()
- : ::utl::MiscCfg().GetYear2000() )));
- }
- break;
+ {
+ const SvNumberFormatter* pFmtr = mpDoc->GetNumberFormatter( sal_False );
+ rSet.Put( SfxUInt16Item( nWhich,
+ static_cast< sal_uInt16 >(
+ pFmtr ? pFmtr->GetYear2000()
+ :
+ ::utl::MiscCfg().GetYear2000() ) ) );
+ }
+ break;
+
case SID_ATTR_CHAR_FONTLIST:
{
- rSet.Put( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
+ rSet.Put( SvxFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST ) );
}
break;
+
case SID_MAIL_PREPAREEXPORT:
{
//check if linked content or possibly hidden content is available
//pDoc->UpdateFlds( NULL, false );
- sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager();
+ sfx2::LinkManager& rLnkMgr = mpDoc->GetLinkManager();
const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
sal_Bool bRet = sal_False;
if( rLnks.Count() )
@@ -1111,13 +1123,14 @@ void SwDocShell::GetState(SfxItemSet& rSet)
else
{
//sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields
- bRet = pDoc->HasInvisibleContent();
+ bRet = mpDoc->HasInvisibleContent();
}
rSet.Put( SfxBoolItem( nWhich, bRet ) );
}
break;
- default: DBG_ASSERT(!this,"Hier darfst Du nicht hinein!");
+ default:
+ DBG_ASSERT( !this, "Hier darfst Du nicht hinein!" );
}
nWhich = aIter.NextWhich();
@@ -1153,20 +1166,20 @@ SfxStyleSheetBasePool* SwDocShell::GetStyleSheetPool()
void SwDocShell::SetView(SwView* pVw)
{
- if(0 != (pView = pVw))
+ if(0 != (mpView = pVw))
{
- pWrtShell = &pView->GetWrtShell();
+ mpWrtShell = &mpView->GetWrtShell();
}
else
{
- pWrtShell = 0;
+ mpWrtShell = 0;
}
}
void SwDocShell::PrepareReload()
{
- ::DelAllGrfCacheEntries( pDoc );
+ ::DelAllGrfCacheEntries( mpDoc );
}
// linked graphics are now loaded on demand.
@@ -1179,7 +1192,7 @@ void SwDocShell::LoadingFinished()
// enables the document modification again.
// Thus, manuell modify the document, if its modified and its links are updated
// before <FinishedLoading(..)> is called.
- const bool bHasDocToStayModified( pDoc->IsModified() && pDoc->LinksUpdated() );
+ const bool bHasDocToStayModified( mpDoc->IsModified() && mpDoc->LinksUpdated() );
FinishedLoading( SFX_LOADED_ALL );
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this);
if(pVFrame)
@@ -1189,9 +1202,9 @@ void SwDocShell::LoadingFinished()
((SwSrcView*)pShell)->Load(this);
}
- if ( bHasDocToStayModified && !pDoc->IsModified() )
+ if ( bHasDocToStayModified && !mpDoc->IsModified() )
{
- pDoc->SetModified();
+ mpDoc->SetModified();
}
}
@@ -1200,29 +1213,29 @@ void SwDocShell::CancelTransfers()
{
// alle Links vom LinkManager Canceln
aFinishedTimer.Stop();
- pDoc->GetLinkManager().CancelTransfers();
+ mpDoc->GetLinkManager().CancelTransfers();
SfxObjectShell::CancelTransfers();
}
SwFEShell* SwDocShell::GetFEShell()
{
- return pWrtShell;
+ return mpWrtShell;
}
void SwDocShell::RemoveOLEObjects()
{
- SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *mpDoc->GetDfltGrfFmtColl() );
for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
pOLENd->IsInGlobalDocSection() ) )
{
- if( !pOLEChildList )
- pOLEChildList = new comphelper::EmbeddedObjectContainer;
+ if( !mpOLEChildList )
+ mpOLEChildList = new comphelper::EmbeddedObjectContainer;
::rtl::OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
- GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *pOLEChildList );
+ GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *mpOLEChildList );
}
}
}
@@ -1236,16 +1249,16 @@ void SwDocShell::RemoveOLEObjects()
// saved, but of course only id there are OLE objects with bOLESizeInvalid set.
void SwDocShell::CalcLayoutForOLEObjects()
{
- if( !pWrtShell )
+ if( !mpWrtShell )
return;
- SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *mpDoc->GetDfltGrfFmtColl() );
for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && pOLENd->IsOLESizeInvalid() )
{
- pWrtShell->CalcLayout();
+ mpWrtShell->CalcLayout();
break;
}
}
@@ -1281,34 +1294,36 @@ uno::Reference< frame::XController >
---------------------------------------------------------------------------*/
void SwDocShell::setDocAccTitle( const String& rTitle )
{
- if (pDoc )
+ if ( mpDoc )
{
- pDoc->setDocAccTitle( rTitle );
+ mpDoc->setDocAccTitle( rTitle );
}
}
const String SwDocShell::getDocAccTitle() const
{
String sRet;
- if (pDoc)
+ if ( mpDoc )
{
- sRet = pDoc->getDocAccTitle();
+ sRet = mpDoc->getDocAccTitle();
}
return sRet;
}
-void SwDocShell::setDocReadOnly( sal_Bool bReadOnly)
+void SwDocShell::setDocReadOnly(
+ sal_Bool bReadOnly )
{
- if (pDoc )
+ if ( mpDoc )
{
- pDoc->setDocReadOnly( bReadOnly );
+ mpDoc->setDocReadOnly( bReadOnly );
}
}
+
sal_Bool SwDocShell::getDocReadOnly() const
{
- if (pDoc)
+ if ( mpDoc )
{
- return pDoc->getDocReadOnly();
+ return mpDoc->getDocReadOnly();
}
return sal_False;
@@ -1352,27 +1367,27 @@ rtl::OUString SwDocShell::GetEventName( sal_Int32 nIndex )
const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
{
- return pDoc ? &pDoc->GetXmlIdRegistry() : 0;
+ return mpDoc ? &mpDoc->GetXmlIdRegistry() : 0;
}
bool SwDocShell::IsChangeRecording() const
{
- return (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0;
+ return (mpWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0;
}
bool SwDocShell::HasChangeRecordProtection() const
{
- return pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0;
+ return mpWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0;
}
void SwDocShell::SetChangeRecording( bool bActivate )
{
sal_uInt16 nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0;
- sal_uInt16 nMode = pWrtShell->GetRedlineMode();
- pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn);
+ sal_uInt16 nMode = mpWrtShell->GetRedlineMode();
+ mpWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn);
}
@@ -1382,7 +1397,7 @@ bool SwDocShell::SetProtectionPassword( const String &rNewPassword )
const SfxItemSet* pArgs = &aSet;
const SfxPoolItem* pItem = NULL;
- IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess();
+ IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess();
Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword();
if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, sal_False, &pItem )
&& ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() > 0))
@@ -1418,7 +1433,7 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
const SfxItemSet* pArgs = &aSet;
const SfxPoolItem* pItem = NULL;
- IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess();
+ IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess();
Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() );
if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, sal_False, &pItem )
&& ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0))
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index ce7b00c98dfe..611a9469a763 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -196,21 +196,21 @@ void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
/// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
{
- if ( !pDoc ) return;
+ if ( !mpDoc ) return;
bool bUnlockView(true);
- if ( pWrtShell ) {
- bUnlockView = !pWrtShell->IsViewLocked();
- pWrtShell->LockView( sal_True ); // lock visible section
- pWrtShell->StartAllAction();
+ if ( mpWrtShell ) {
+ bUnlockView = !mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( sal_True ); // lock visible section
+ mpWrtShell->StartAllAction();
}
- pDoc->DocInfoChgd();
+ mpDoc->DocInfoChgd();
- if ( pWrtShell ) {
- pWrtShell->EndAllAction();
+ if ( mpWrtShell ) {
+ mpWrtShell->EndAllAction();
if ( bUnlockView ) {
- pWrtShell->LockView( sal_False );
+ mpWrtShell->LockView( sal_False );
}
}
}
@@ -244,13 +244,13 @@ void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventP
void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if( !pDoc )
+ if( !mpDoc )
{
return ;
}
#ifdef FUTURE_VBA
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor();
if( xVbaEvents.is() )
lcl_processCompatibleSfxHint( xVbaEvents, rHint );
#endif
@@ -271,16 +271,16 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if( nAction )
{
sal_Bool bUnlockView = sal_True; //initializing prevents warning
- if( pWrtShell )
+ if( mpWrtShell )
{
- bUnlockView = !pWrtShell->IsViewLocked();
- pWrtShell->LockView( sal_True ); //lock visible section
- pWrtShell->StartAllAction();
+ bUnlockView = !mpWrtShell->IsViewLocked();
+ mpWrtShell->LockView( sal_True ); //lock visible section
+ mpWrtShell->StartAllAction();
}
switch( nAction )
{
case 2:
- pDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds();
+ mpDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds();
break;
// own action for event LOADFINISHED in order to avoid a modified document.
@@ -291,23 +291,23 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
const bool bResetModified = IsEnableSetModified();
if ( bResetModified )
EnableSetModified( sal_False );
- const bool bIsDocModified = pDoc->IsModified();
+ const bool bIsDocModified = mpDoc->IsModified();
- pDoc->DocInfoChgd( );
+ mpDoc->DocInfoChgd( );
if ( !bIsDocModified )
- pDoc->ResetModified();
+ mpDoc->ResetModified();
if ( bResetModified )
EnableSetModified( sal_True );
}
break;
}
- if( pWrtShell )
+ if( mpWrtShell )
{
- pWrtShell->EndAllAction();
+ mpWrtShell->EndAllAction();
if( bUnlockView )
- pWrtShell->LockView( sal_False );
+ mpWrtShell->LockView( sal_False );
}
}
}
@@ -324,9 +324,9 @@ sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
EndListening( *this );
#ifdef FUTURE_VBA
- if( pDoc && IsInPrepareClose() )
+ if( mpDoc && IsInPrepareClose() )
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor();
if( xVbaEvents.is() )
{
using namespace com::sun::star::script::vba::VBAEventId;
@@ -385,7 +385,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
// dflt. PageDesc und StandardZeichenvorlage nie loeschen !!!
if( ( SFX_STYLE_FAMILY_PAGE == eOldFamily &&
- const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() ==
+ const_cast<const SwDoc *>(mpDoc)->GetPageDesc(0).GetName() ==
rOldName ) ||
( SFX_STYLE_FAMILY_CHAR == eOldFamily &&
rOldName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD -
@@ -396,7 +396,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
sal_uInt16 nMySrchMask = pMyPool->GetSearchMask();
SfxStyleSheetBase* pExist;
- if( ::FindPhyStyle( *pDoc, rOldName, eOldFamily ) )
+ if( ::FindPhyStyle( *mpDoc, rOldName, eOldFamily ) )
{
// Bug 20365: nur uebernehmen, wenn das gewuenscht ist!
if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError(
@@ -436,7 +436,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
// gesondert behandeln!!
SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc();
SwPageDesc* pCpyDsc = (SwPageDesc*)((SwDocStyleSheet*)pHisSheet)->GetPageDesc();
- pDoc->CopyPageDesc( *pCpyDsc, *pDestDsc );
+ mpDoc->CopyPageDesc( *pCpyDsc, *pDestDsc );
}
else
// die neue Vorlage mit den Attributen fuellen
@@ -536,7 +536,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
pMyPool->SetSearchMask( eMyOldFamily, nMySrchMask );
// Model geaendert
- ASSERT(pDoc, "Doc fehlt");
+ ASSERT(mpDoc, "Doc fehlt");
GetDoc()->SetModified();
bRet = sal_True;
@@ -584,7 +584,7 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
// dflt. PageDesc und StandardZeichenvorlage nie loeschen !!!
if( ( SFX_STYLE_FAMILY_PAGE == eFamily &&
- const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName()
+ const_cast<const SwDoc *>(mpDoc)->GetPageDesc(0).GetName()
== aName ) ||
( SFX_STYLE_FAMILY_CHAR == eFamily &&
aName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD -
@@ -626,7 +626,7 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
// Model geaendert
- ASSERT(pDoc, "Doc fehlt");
+ ASSERT(mpDoc, "Doc fehlt");
GetDoc()->SetModified();
return bRet;
@@ -1030,7 +1030,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
xDocSh->DoInitNew( 0 );
sal_Bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich;
- pDoc->Summary( pSmryDoc, nLevel, nPara, bImpress );
+ mpDoc->Summary( pSmryDoc, nLevel, nPara, bImpress );
if( bImpress )
{
WriterRef xWrt;
@@ -1174,24 +1174,24 @@ void SwDocShell::Execute(SfxRequest& rReq)
case SID_MAIL_PREPAREEXPORT:
{
//pWrtShell is not set in page preview
- if(pWrtShell)
- pWrtShell->StartAllAction();
- pDoc->UpdateFlds( NULL, false );
- pDoc->EmbedAllLinks();
- pDoc->RemoveInvisibleContent();
- if(pWrtShell)
- pWrtShell->EndAllAction();
+ if(mpWrtShell)
+ mpWrtShell->StartAllAction();
+ mpDoc->UpdateFlds( NULL, false );
+ mpDoc->EmbedAllLinks();
+ mpDoc->RemoveInvisibleContent();
+ if(mpWrtShell)
+ mpWrtShell->EndAllAction();
}
break;
case SID_MAIL_EXPORT_FINISHED:
{
- if(pWrtShell)
- pWrtShell->StartAllAction();
+ if(mpWrtShell)
+ mpWrtShell->StartAllAction();
//try to undo the removal of invisible content
- pDoc->RestoreInvisibleContent();
- if(pWrtShell)
- pWrtShell->EndAllAction();
+ mpDoc->RestoreInvisibleContent();
+ if(mpWrtShell)
+ mpWrtShell->EndAllAction();
}
break;
case FN_NEW_HTML_DOC:
@@ -1332,7 +1332,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
/////////////////////////////////////////////////////////////////////
bool bOutline[MAXLEVEL] = {false};
- const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
+ const SwOutlineNodes& rOutlNds = mpDoc->GetNodes().GetOutLineNds();
if( rOutlNds.Count() )
{
int nLevel;
@@ -1344,7 +1344,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
}
- const sal_uInt16 nStyleCount = pDoc->GetTxtFmtColls()->Count();
+ const sal_uInt16 nStyleCount = mpDoc->GetTxtFmtColls()->Count();
Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount);
OUString* pEntries = aListBoxEntries.getArray();
sal_Int32 nIdx = 0 ;
@@ -1360,7 +1360,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
for(sal_uInt16 i = 0; i < nStyleCount; ++i)
{
SwTxtFmtColl &rTxtColl =
- *pDoc->GetTxtFmtColls()->GetObject( i );
+ *mpDoc->GetTxtFmtColls()->GetObject( i );
if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() )
{
pEntries[nIdx++] = sStyle + rTxtColl.GetName();
@@ -1442,17 +1442,17 @@ void SwDocShell::Execute(SfxRequest& rReq)
if ( bCreateByOutlineLevel ) //add by zhaojianwei
{
bDone = bCreateHtml //#outline level,removed by zhaojianwei
- ? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel )
- : pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel );
+ ? mpDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel )
+ : mpDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel );
}
else
{
const SwTxtFmtColl* pSplitColl = 0;
if ( aTemplateName.Len() )
- pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
+ pSplitColl = mpDoc->FindTxtFmtCollByName(aTemplateName);
bDone = bCreateHtml //#outline level,removed by zhaojianwei
- ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
- : pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
+ ? mpDoc->GenerateHTMLDoc( aFileName, pSplitColl )
+ : mpDoc->GenerateGlobalDoc( aFileName, pSplitColl );
}
//<-end,zhaojianwei
if( bDone )
@@ -1514,7 +1514,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
pViewShell = pVFrame ? pVFrame->GetViewShell() : 0;
pCurrView = dynamic_cast<SwView*>( pViewShell );
}
- pDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K);
+ mpDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K);
}
break;
@@ -1530,7 +1530,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType,
uno::Any & rValue )
{
- return pDoc->GetData( rItem, rMimeType, rValue );
+ return mpDoc->GetData( rItem, rMimeType, rValue );
}
@@ -1541,7 +1541,7 @@ long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType,
long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType,
const uno::Any & rValue )
{
- return pDoc->SetData( rItem, rMimeType, rValue );
+ return mpDoc->SetData( rItem, rMimeType, rValue );
}
@@ -1551,7 +1551,7 @@ long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType,
::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem )
{
- return pDoc->CreateLinkSource( rItem );
+ return mpDoc->CreateLinkSource( rItem );
}
/*--------------------------------------------------------------------
@@ -1592,20 +1592,20 @@ void SwDocShell::SetModified( sal_Bool bSet )
SfxObjectShell::SetModified( bSet );
if( IsEnableSetModified())
{
- if (!pDoc->IsInCallModified() )
+ if (!mpDoc->IsInCallModified() )
{
EnableSetModified( sal_False );
if( bSet )
{
- sal_Bool bOld = pDoc->IsModified();
- pDoc->SetModified();
+ sal_Bool bOld = mpDoc->IsModified();
+ mpDoc->SetModified();
if( !bOld )
{
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
}
else
- pDoc->ResetModified();
+ mpDoc->ResetModified();
EnableSetModified( sal_True );
}
@@ -1698,7 +1698,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
"Loschen des Basics hat nicht geklappt" );
}
}
- sal_Bool bWasBrowseMode = pDoc->get(IDocumentSettingAccess::BROWSE_MODE);
+ sal_Bool bWasBrowseMode = mpDoc->get(IDocumentSettingAccess::BROWSE_MODE);
RemoveLink();
//jetzt muss auch das UNO-Model ueber das neue Doc informiert werden #51535#
@@ -1709,7 +1709,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
AddLink();
//#116402# update font list when new document is created
UpdateFontList();
- pDoc->set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode);
+ mpDoc->set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode);
pSrcView->SetPool(&GetPool());
@@ -1730,7 +1730,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
// the base URL has to be set to the filename of the document <rMedname>
// and not to the base URL of the temporary file <aMed> in order to get
// the URLs of the linked graphics correctly resolved.
- SwReloadFromHtmlReader aReader( aMed, rMedname, pDoc );
+ SwReloadFromHtmlReader aReader( aMed, rMedname, mpDoc );
// <--
aReader.Read( *ReadHTML );
@@ -1753,7 +1753,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
if(bModified && !IsReadOnly())
SetModified();
else
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
@@ -1819,13 +1819,13 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
// insert the styles!
if( bUnoCall )
{
- SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfContent(), -1 );
+ SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfContent(), -1 );
pPam = new SwPaM( aIdx );
pReader = new SwReader( aMed, rURL, *pPam );
}
else
{
- pReader = new SwReader( aMed, rURL, *pWrtShell->GetCrsr() );
+ pReader = new SwReader( aMed, rURL, *mpWrtShell->GetCrsr() );
}
pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() );
@@ -1836,14 +1836,14 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
if( bUnoCall )
{
- UnoActionContext aAction( pDoc );
+ UnoActionContext aAction( mpDoc );
nErr = pReader->Read( *pRead );
}
else
{
- pWrtShell->StartAllAction();
+ mpWrtShell->StartAllAction();
nErr = pReader->Read( *pRead );
- pWrtShell->EndAllAction();
+ mpWrtShell->EndAllAction();
}
delete pPam;
delete pReader;
diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx
index a3764be9a45a..2f1093d7ded7 100644
--- a/sw/source/ui/app/docshdrw.cxx
+++ b/sw/source/ui/app/docshdrw.cxx
@@ -19,36 +19,20 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
-
-
-
-
-
-
-
-
#include <svl/stritem.hxx>
#include <svx/drawitem.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdoutl.hxx>
#include <svx/xtable.hxx>
-
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <doc.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
@@ -56,26 +40,58 @@ using namespace ::com::sun::star;
Beschreibung: Document laden
--------------------------------------------------------------------*/
-
-void SwDocShell::InitDraw()
+void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocument)
{
- SdrModel *pDrDoc = pDoc->GetDrawModel();
- if( pDrDoc )
+ if(pSwDrawDocument)
{
- // Listen, bzw. Tables im ItemSet der DocShell anlegen
- PutItem( SvxGradientListItem( pDrDoc->GetGradientListFromSdrModel(), SID_GRADIENT_LIST ) );
- PutItem( SvxHatchListItem( pDrDoc->GetHatchListFromSdrModel(), SID_HATCH_LIST ) );
- PutItem( SvxBitmapListItem( pDrDoc->GetBitmapListFromSdrModel(), SID_BITMAP_LIST ) );
- PutItem( SvxDashListItem( pDrDoc->GetDashListFromSdrModel(), SID_DASH_LIST ) );
- PutItem( SvxLineEndListItem( pDrDoc->GetLineEndListFromSdrModel(), SID_LINEEND_LIST ) );
-
- Outliner& rOutliner = pDrDoc->GetDrawOutliner();
- uno::Reference<linguistic2::XHyphenator> xHyphenator( ::GetHyphenator() );
- rOutliner.SetHyphenator( xHyphenator );
+ if(pSwDocShell == pSwDrawDocument->GetObjectShell())
+ {
+ // association already done, nothing to do
+ }
+ else
+ {
+ // set object shell (mainly for FormControl stuff), maybe zero
+ pSwDrawDocument->SetObjectShell(pSwDocShell);
+
+ // set persist, maybe zero
+ pSwDrawDocument->SetPersist(pSwDocShell);
+
+ // get and decide on the color table to use
+ if(pSwDocShell)
+ {
+ const SvxColorTableItem* pColItemFromDocShell = static_cast< const SvxColorTableItem* >(pSwDocShell->GetItem(SID_COLOR_TABLE));
+
+ if(pColItemFromDocShell)
+ {
+ // the DocShell has a ColorTable, use it also in DrawingLayer
+ pSwDrawDocument->SetColorTableAtSdrModel(pColItemFromDocShell->GetColorTable());
+ }
+ else
+ {
+ // Use the ColorTable which is used at the DrawingLayer's SdrModel
+ pSwDocShell->PutItem(SvxColorTableItem(pSwDrawDocument->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
+ }
+
+ // add other tables in SfxItemSet of the DocShell
+ pSwDocShell->PutItem(SvxGradientListItem(pSwDrawDocument->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
+ pSwDocShell->PutItem(SvxHatchListItem(pSwDrawDocument->GetHatchListFromSdrModel(), SID_HATCH_LIST));
+ pSwDocShell->PutItem(SvxBitmapListItem(pSwDrawDocument->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
+ pSwDocShell->PutItem(SvxDashListItem(pSwDrawDocument->GetDashListFromSdrModel(), SID_DASH_LIST));
+ pSwDocShell->PutItem(SvxLineEndListItem(pSwDrawDocument->GetLineEndListFromSdrModel(), SID_LINEEND_LIST));
+ }
+
+ // init hyphenator for DrawingLayer outliner
+ uno::Reference<linguistic2::XHyphenator> xHyphenator(::GetHyphenator());
+ Outliner& rOutliner = pSwDrawDocument->GetDrawOutliner();
+
+ rOutliner.SetHyphenator(xHyphenator);
+ }
+ }
+ else if(pSwDocShell)
+ {
+ // fallback: add the default color list to have one when someone requests it from the DocShell
+ pSwDocShell->PutItem(SvxColorTableItem(XColorList::GetStdColorList(), SID_COLOR_TABLE));
}
- else
- PutItem( SvxColorTableItem( XColorList::GetStdColorList(), SID_COLOR_TABLE ));
}
-
-
+//eof
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 9591bc7bb9cf..3cdd059f7854 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -137,7 +137,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
RES_PARATR_TABSTOP));
*/
if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
- SwTransferable::InitOle( this, *pDoc );
+ SwTransferable::InitOle( this, *mpDoc );
// set forbidden characters if necessary
SvxAsianConfig aAsian;
@@ -150,20 +150,20 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
ForbiddenCharacters aForbidden;
aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine);
LanguageType eLang = SvxLocaleToLanguage(pLocales[i]);
- pDoc->setForbiddenCharacters( eLang, aForbidden);
+ mpDoc->setForbiddenCharacters( eLang, aForbidden);
}
}
- pDoc->set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION,
+ mpDoc->set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION,
!aAsian.IsKerningWesternTextOnly());
- pDoc->setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
- pDoc->setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
+ mpDoc->setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
+ mpDoc->setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
SubInitNew();
// fuer alle
SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
- SfxPrinter* pPrt = pDoc->getPrinter( false );
+ SfxPrinter* pPrt = mpDoc->getPrinter( false );
String sEntry;
sal_uInt16 aFontWhich[] =
@@ -201,7 +201,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
sal_uInt16 nFontWhich = aFontWhich[i];
sal_uInt16 nFontId = aFontIds[i];
SvxFontItem* pFontItem = 0;
- const SvxLanguageItem& rLang = (const SvxLanguageItem&)pDoc->GetDefault( aLangTypes[i] );
+ const SvxLanguageItem& rLang = (const SvxLanguageItem&)mpDoc->GetDefault( aLangTypes[i] );
LanguageType eLanguage = rLang.GetLanguage();
if(!pStdFont->IsFontDefault(nFontId))
{
@@ -238,20 +238,20 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
pFontItem = new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetName(),
aEmptyStr, aLangDefFont.GetPitch(), aLangDefFont.GetCharSet(), nFontWhich);
}
- pDoc->SetDefault(*pFontItem);
+ mpDoc->SetDefault(*pFontItem);
if( !bHTMLTemplSet )
{
- SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
+ SwTxtFmtColl *pColl = mpDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFmtAttr(nFontWhich);
}
delete pFontItem;
sal_Int32 nFontHeight = pStdFont->GetFontHeight( FONT_STANDARD, i, eLanguage );
if(nFontHeight <= 0)
nFontHeight = pStdFont->GetDefaultHeightFor( nFontId, eLanguage );
- pDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] ));
+ mpDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] ));
if( !bHTMLTemplSet )
{
- SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
+ SwTxtFmtColl *pColl = mpDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFmtAttr(aFontHeightWhich[i]);
}
@@ -274,20 +274,20 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
sal_uInt16 nFontWhich = RES_CHRATR_FONT;
sal_uInt16 nFontHeightWhich = RES_CHRATR_FONTSIZE;
- LanguageType eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage();
+ LanguageType eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage();
for(sal_uInt8 nIdx = 0; nIdx < 24; nIdx += 2)
{
if(nIdx == 8)
{
nFontWhich = RES_CHRATR_CJK_FONT;
nFontHeightWhich = RES_CHRATR_CJK_FONTSIZE;
- eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage();
+ eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage();
}
else if(nIdx == 16)
{
nFontWhich = RES_CHRATR_CTL_FONT;
nFontHeightWhich = RES_CHRATR_CTL_FONTSIZE;
- eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage();
+ eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage();
}
SwTxtFmtColl *pColl = 0;
if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx]))
@@ -298,7 +298,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if( pPrt )
aFont = pPrt->GetFontMetric( aFont );
- pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
+ pColl = mpDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
if( !bHTMLTemplSet ||
SFX_ITEM_SET != pColl->GetAttrSet().GetItemState(
nFontWhich, sal_False ) )
@@ -311,7 +311,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if(nFontHeight <= 0)
nFontHeight = pStdFont->GetDefaultHeightFor( aFontIdPoolId[nIdx], eLanguage );
if(!pColl)
- pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
+ pColl = mpDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
SvxFontHeightItem aFontHeight( (const SvxFontHeightItem&)pColl->GetFmtAttr( nFontHeightWhich, sal_True ));
if(aFontHeight.GetHeight() != sal::static_int_cast<sal_uInt32, sal_Int32>(nFontHeight))
{
@@ -323,7 +323,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
// the default for documents created via 'File/New' should be 'on'
// (old documents, where this property was not yet implemented, will get the
// value 'false' in the SwDoc c-tor)
- pDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
+ mpDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() );
}
@@ -331,26 +331,26 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
the default adjusment is to the right. */
if( !bHTMLTemplSet &&
FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) )
- pDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) );
+ mpDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) );
// OD 09.10.2003 #i18732# - set dynamic pool default for
// item RES_FOLLOW_TEXT_FLOW to sal_False for *new document*.
// Thus, redo this change in method <SwDoc::RemoveAllFmtLanguageDependencies()>,
// which is called from <SwDocShell::ConvertFrom(..)> in order to restore
// the static pool default.
- pDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) );
+ mpDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) );
// --> collapsing borders FME 2005-05-27 #i29550#
- pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) );
+ mpDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) );
// <-- collapsing
//#i16874# AutoKerning as default for new documents
- pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );
+ mpDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );
// --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)>
// at the document instance, the document is modified. Thus, reset this
// status here. Note: In method <SubInitNew()> this is also done.
- pDoc->ResetModified();
+ mpDoc->ResetModified();
// <--
return bRet;
@@ -363,13 +363,13 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
SfxObjectShell ( eMode ),
- pDoc(0),
- pFontList(0),
- pView( 0 ),
- pWrtShell( 0 ),
- pOLEChildList( 0 ),
- nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bInUpdateFontList(false)
+ mpDoc(0),
+ mpFontList(0),
+ mpView( 0 ),
+ mpWrtShell( 0 ),
+ mpOLEChildList( 0 ),
+ mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
+ mbInUpdateFontList(false)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" );
Init_Impl();
@@ -382,13 +382,13 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
SfxObjectShell ( i_nSfxCreationFlags ),
- pDoc(0),
- pFontList(0),
- pView( 0 ),
- pWrtShell( 0 ),
- pOLEChildList( 0 ),
- nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bInUpdateFontList(false)
+ mpDoc(0),
+ mpFontList(0),
+ mpView( 0 ),
+ mpWrtShell( 0 ),
+ mpOLEChildList( 0 ),
+ mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
+ mbInUpdateFontList(false)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" );
Init_Impl();
@@ -401,13 +401,13 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
SfxObjectShell ( eMode ),
- pDoc(pD),
- pFontList(0),
- pView( 0 ),
- pWrtShell( 0 ),
- pOLEChildList( 0 ),
- nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bInUpdateFontList(false)
+ mpDoc(pD),
+ mpFontList(0),
+ mpView( 0 ),
+ mpWrtShell( 0 ),
+ mpOLEChildList( 0 ),
+ mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
+ mbInUpdateFontList(false)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" );
Init_Impl();
@@ -421,22 +421,22 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
SwDocShell::~SwDocShell()
{
// disable chart related objects now because in ~SwDoc it may be to late for this
- if( pDoc )
+ if( mpDoc )
{
- pDoc->GetChartControllerHelper().Disconnect();
- SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
+ mpDoc->GetChartControllerHelper().Disconnect();
+ SwChartDataProvider *pPCD = mpDoc->GetChartDataProvider();
if (pPCD)
pPCD->dispose();
}
RemoveLink();
- delete pFontList;
+ delete mpFontList;
// wir als BroadCaster werden auch unser eigener Listener
// (fuer DocInfo/FileNamen/....)
EndListening( *this );
- delete pOLEChildList;
+ delete mpOLEChildList;
}
/* -----------------------------10.09.2001 15:59------------------------------
@@ -461,23 +461,23 @@ void SwDocShell::Init_Impl()
void SwDocShell::AddLink()
{
- if( !pDoc )
+ if( !mpDoc )
{
SwDocFac aFactory;
- pDoc = aFactory.GetDoc();
- pDoc->acquire();
- pDoc->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this) );
+ mpDoc = aFactory.GetDoc();
+ mpDoc->acquire();
+ mpDoc->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this) );
}
else
- pDoc->acquire();
- pDoc->SetDocShell( this ); // am Doc den DocShell-Pointer setzen
+ mpDoc->acquire();
+ mpDoc->SetDocShell( this ); // am Doc den DocShell-Pointer setzen
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Reactivate(this);
- SetPool(&pDoc->GetAttrPool());
+ SetPool(&mpDoc->GetAttrPool());
// am besten erst wenn eine sdbcx::View erzeugt wird !!!
- pDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl));
+ mpDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl));
}
/*--------------------------------------------------------------------
@@ -487,17 +487,17 @@ void SwDocShell::AddLink()
void SwDocShell::UpdateFontList()
{
- if(!bInUpdateFontList)
+ if(!mbInUpdateFontList)
{
- bInUpdateFontList = true;
- ASSERT(pDoc, "Kein Doc keine FontList");
- if( pDoc )
+ mbInUpdateFontList = true;
+ ASSERT(mpDoc, "Kein Doc keine FontList");
+ if( mpDoc )
{
- delete pFontList;
- pFontList = new FontList( pDoc->getReferenceDevice( true ) );
- PutItem( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
+ delete mpFontList;
+ mpFontList = new FontList( mpDoc->getReferenceDevice( true ) );
+ PutItem( SvxFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST ) );
}
- bInUpdateFontList = false;
+ mbInUpdateFontList = false;
}
}
@@ -512,19 +512,19 @@ void SwDocShell::RemoveLink()
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Invalidate();
aFinishedTimer.Stop();
- if(pDoc)
+ if(mpDoc)
{
if( mxBasePool.is() )
{
static_cast<SwDocStyleSheetPool*>(mxBasePool.get())->dispose();
mxBasePool.clear();
}
- sal_Int8 nRefCt = static_cast< sal_Int8 >(pDoc->release());
- pDoc->SetOle2Link(Link());
- pDoc->SetDocShell( 0 );
+ sal_Int8 nRefCt = static_cast< sal_Int8 >(mpDoc->release());
+ mpDoc->SetOle2Link(Link());
+ mpDoc->SetDocShell( 0 );
if( !nRefCt )
- delete pDoc;
- pDoc = 0; // wir haben das Doc nicht mehr !!
+ delete mpDoc;
+ mpDoc = 0; // wir haben das Doc nicht mehr !!
}
}
void SwDocShell::InvalidateModel()
@@ -552,7 +552,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
if( SfxObjectShell::Load( rMedium ))
{
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after SfxInPlaceObject::Load" );
- if( pDoc ) // fuer Letzte Version !!
+ if( mpDoc ) // fuer Letzte Version !!
RemoveLink(); // das existierende Loslassen
AddLink(); // Link setzen und Daten updaten !!
@@ -560,11 +560,11 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
// Das Laden
// fuer MD
ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" );
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
{
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
- nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
+ mnUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
}
SwWait aWait( *this, true );
@@ -580,7 +580,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
if( ReadXML )
{
ReadXML->SetOrganizerMode( sal_True );
- SwReader aRdr( rMedium, aEmptyStr, pDoc );
+ SwReader aRdr( rMedium, aEmptyStr, mpDoc );
nErr = aRdr.Read( *ReadXML );
ReadXML->SetOrganizerMode( sal_False );
}
@@ -591,7 +591,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
case SFX_CREATE_MODE_EMBEDDED:
{
// fuer MWERKS (Mac-Compiler): kann nicht selbststaendig casten
- SwTransferable::InitOle( this, *pDoc );
+ SwTransferable::InitOle( this, *mpDoc );
}
// SfxProgress unterdruecken, wenn man Embedded ist
SW_MOD()->SetEmbeddedLoadSave( sal_True );
@@ -605,7 +605,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
{
// die DocInfo vom Doc am DocShell-Medium setzen
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before ReadDocInfo" );
- SwReader aRdr( rMedium, aEmptyStr, pDoc );
+ SwReader aRdr( rMedium, aEmptyStr, mpDoc );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before Read" );
nErr = aRdr.Read( *pReader );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after Read" );
@@ -615,13 +615,13 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
// by this formats.
if( dynamic_cast< SwWebDocShell* >(this) )
{
- if( !pDoc->get(IDocumentSettingAccess::HTML_MODE) )
- pDoc->set(IDocumentSettingAccess::HTML_MODE, true);
+ if( !mpDoc->get(IDocumentSettingAccess::HTML_MODE) )
+ mpDoc->set(IDocumentSettingAccess::HTML_MODE, true);
}
if( dynamic_cast< SwGlobalDocShell* >(this) )
{
- if( !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
+ if( !mpDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
+ mpDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
}
}
#ifdef DBG_UTIL
@@ -637,7 +637,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
}
UpdateFontList();
- InitDraw();
+ InitDrawModelAndDocShell(this, mpDoc ? mpDoc->GetDrawModel() : 0);
SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
bRet = !IsError( nErr );
@@ -647,7 +647,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
// if( bRet && !pDoc->IsInLoadAsynchron() &&
// GetCreateMode() == SFX_CREATE_MODE_STANDARD )
// StartLoadFinishedTimer();
- if ( bRet && !pDoc->IsInLoadAsynchron() &&
+ if ( bRet && !mpDoc->IsInLoadAsynchron() &&
GetCreateMode() == SFX_CREATE_MODE_STANDARD )
{
LoadingFinished();
@@ -670,7 +670,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::LoadFrom" );
sal_Bool bRet = sal_False;
- if( pDoc )
+ if( mpDoc )
RemoveLink();
AddLink(); // Link setzen und Daten updaten !!
@@ -687,11 +687,11 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
SwWait aWait( *this, true );
{
ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" );
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if( ReadXML )
{
ReadXML->SetOrganizerMode( sal_True );
- SwReader aRdr( rMedium, aEmptyStr, pDoc );
+ SwReader aRdr( rMedium, aEmptyStr, mpDoc );
nErr = aRdr.Read( *ReadXML );
ReadXML->SetOrganizerMode( sal_False );
}
@@ -726,7 +726,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
} while( sal_False );
SfxObjectShell::LoadFrom( rMedium );
- pDoc->ResetModified();
+ mpDoc->ResetModified();
return bRet;
}
@@ -734,12 +734,12 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
void SwDocShell::SubInitNew()
{
ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" );
- mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
+ mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
UpdateFontList();
- InitDraw();
+ InitDrawModelAndDocShell(this, mpDoc ? mpDoc->GetDrawModel() : 0);
- pDoc->setLinkUpdateMode( GLOBALSETTING );
- pDoc->setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
+ mpDoc->setLinkUpdateMode( GLOBALSETTING );
+ mpDoc->setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
const bool bWeb(dynamic_cast< SwWebDocShell* >(this));
@@ -755,7 +755,7 @@ void SwDocShell::SubInitNew()
nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 3 ] = RES_PARATR_TABSTOP;
nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 2 ] = RES_PARATR_HYPHENZONE;
}
- SfxItemSet aDfltSet( pDoc->GetAttrPool(), nRange );
+ SfxItemSet aDfltSet( mpDoc->GetAttrPool(), nRange );
//! get lingu options without loading lingu DLL
SvtLinguOptions aLinguOpt;
@@ -771,7 +771,7 @@ void SwDocShell::SubInitNew()
if(!bWeb)
{
- SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) pDoc->GetDefault(
+ SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) mpDoc->GetDefault(
RES_PARATR_HYPHENZONE) );
aHyp.GetMinLead() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinLeading);
aHyp.GetMinTrail() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinTrailing);
@@ -785,21 +785,21 @@ void SwDocShell::SubInitNew()
}
aDfltSet.Put( SvxColorItem( Color( COL_AUTO ), RES_CHRATR_COLOR ) );
- pDoc->SetDefault( aDfltSet );
+ mpDoc->SetDefault( aDfltSet );
//default page mode for text grid
if(!bWeb)
{
sal_Bool bSquaredPageMode = SW_MOD()->GetUsrPref(sal_False)->IsSquaredPageMode();
- pDoc->SetDefaultPageMode( bSquaredPageMode );
+ mpDoc->SetDefaultPageMode( bSquaredPageMode );
}
- pDoc->ResetModified();
+ mpDoc->ResetModified();
}
/*
* Document Interface Access
*/
-IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; }
-const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; }
-IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; }
+IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return mpDoc; }
+const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return mpDoc; }
+IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return mpDoc; }
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index b4ff235e7f8e..f01db878d514 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -19,15 +19,12 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-
#include <hintids.hxx>
#include <sfx2/app.hxx>
#include <svl/whiter.hxx>
@@ -43,6 +40,7 @@
#include <svl/languageoptions.hxx>
#include <editeng/eeitem.hxx>
#include <svx/htmlmode.hxx>
+#include <svx/xdef.hxx>
#include <swmodule.hxx>
#include <wdocsh.hxx>
#include <fmtfsize.hxx>
@@ -52,7 +50,8 @@
#include <SwRewriter.hxx>
#include <numrule.hxx>
#include <swundo.hxx>
-
+#include <svx/svdmodel.hxx>
+#include <svx/drawitem.hxx>
#include "view.hxx"
#include "wrtsh.hxx"
#include "docsh.hxx"
@@ -74,15 +73,12 @@
#include "swevent.hxx"
#include "edtwin.hxx"
#include "unochart.hxx"
-
#include "app.hrc"
#include <fmtui.hrc>
#include "swabstdlg.hxx"
-// --> OD 2008-03-27 #refactorlists#
#include <list.hxx>
-// <--
-
#include <paratr.hxx> //#outline level,add by zhaojianwei
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
@@ -163,7 +159,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
SfxTemplateItem aItem(nWhich, aName);
sal_uInt16 nMask = 0;
- if( pDoc->get(IDocumentSettingAccess::HTML_MODE) )
+ if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) )
nMask = SWSTYLEBIT_HTML;
else
{
@@ -189,7 +185,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY3:
- if( pDoc->get(IDocumentSettingAccess::HTML_MODE) )
+ if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) )
rSet.DisableItem( nWhich );
else
{
@@ -205,7 +201,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY4:
{
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension())
+ if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension())
rSet.DisableItem( nWhich );
else
{
@@ -431,14 +427,14 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
break;
case SFX_STYLE_FAMILY_FRAME:
{
- SwFrmFmt* pFrm = pWrtShell->GetCurFrmFmt();
+ SwFrmFmt* pFrm = mpWrtShell->GetCurFrmFmt();
if( pFrm )
aParam = pFrm->GetName();
}
break;
case SFX_STYLE_FAMILY_CHAR:
{
- SwCharFmt* pChar = pWrtShell->GetCurCharFmt();
+ SwCharFmt* pChar = mpWrtShell->GetCurCharFmt();
if( pChar )
aParam = pChar->GetName();
}
@@ -508,10 +504,6 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
Beschreibung: Edit
--------------------------------------------------------------------*/
-//UUUU
-//#include <svx/svdmodel.hxx>
-//#include <svx/drawitem.hxx>
-
sal_uInt16 SwDocShell::Edit(
const String &rName,
const String &rParent,
@@ -526,7 +518,7 @@ sal_uInt16 SwDocShell::Edit(
SfxStyleSheetBase *pStyle = 0;
sal_uInt16 nRet = nMask;
- sal_Bool bModified = pDoc->IsModified();
+ sal_Bool bModified = mpDoc->IsModified();
if( bNew )
{
@@ -545,17 +537,16 @@ sal_uInt16 SwDocShell::Edit(
{
if(rParent.Len())
{
- SwTxtFmtColl* pColl = pWrtShell->FindTxtFmtCollByName( rParent );
+ SwTxtFmtColl* pColl = mpWrtShell->FindTxtFmtCollByName( rParent );
if(!pColl)
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
if(USHRT_MAX != nId)
- pColl = pWrtShell->GetTxtCollFromPool( nId );
+ pColl = mpWrtShell->GetTxtCollFromPool( nId );
}
pDStyle->GetCollection()->SetDerivedFrom( pColl );
pDStyle->PresetParent( rParent );
- //#outline level,add by zhaojianwei
/*When a new paragraph style is created based on a "to outline style
assigned" paragraph style, the outline level attribute and the list
style attribute of the new paragraph style have to be set to 0
@@ -566,12 +557,11 @@ sal_uInt16 SwDocShell::Edit(
pDStyle->GetCollection()->SetFmtAttr( aItem );
pDStyle->GetCollection()->SetAttrOutlineLevel( 0 );
}
- //<-end,zhaojianwei
}
else
{
- SwTxtFmtColl* pColl = pWrtShell->GetCurTxtFmtColl();
+ SwTxtFmtColl* pColl = mpWrtShell->GetCurTxtFmtColl();
pDStyle->GetCollection()->SetDerivedFrom( pColl );
if( pColl )
pDStyle->PresetParent( pColl->GetName() );
@@ -582,12 +572,12 @@ sal_uInt16 SwDocShell::Edit(
{
if(rParent.Len())
{
- SwCharFmt* pCFmt = pWrtShell->FindCharFmtByName( rParent );
+ SwCharFmt* pCFmt = mpWrtShell->FindCharFmtByName( rParent );
if(!pCFmt)
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
if(USHRT_MAX != nId)
- pCFmt = pWrtShell->GetCharFmtFromPool( nId );
+ pCFmt = mpWrtShell->GetCharFmtFromPool( nId );
}
pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt );
@@ -595,7 +585,7 @@ sal_uInt16 SwDocShell::Edit(
}
else
{
- SwCharFmt* pCFmt = pWrtShell->GetCurCharFmt();
+ SwCharFmt* pCFmt = mpWrtShell->GetCurCharFmt();
pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt );
if( pCFmt )
pDStyle->PresetParent( pCFmt->GetName() );
@@ -606,12 +596,12 @@ sal_uInt16 SwDocShell::Edit(
{
if(rParent.Len())
{
- SwFrmFmt* pFFmt = pWrtShell->GetDoc()->FindFrmFmtByName( rParent );
+ SwFrmFmt* pFFmt = mpWrtShell->GetDoc()->FindFrmFmtByName( rParent );
if(!pFFmt)
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT);
if(USHRT_MAX != nId)
- pFFmt = pWrtShell->GetFrmFmtFromPool( nId );
+ pFFmt = mpWrtShell->GetFrmFmtFromPool( nId );
}
pDStyle->GetFrmFmt()->SetDerivedFrom( pFFmt );
pDStyle->PresetParent( rParent );
@@ -667,29 +657,29 @@ sal_uInt16 SwDocShell::Edit(
rSet.Put( aTmpBrush );
}
}
- if (!bBasic)
+
+ if(SFX_STYLE_FAMILY_PAGE == nFamily || SFX_STYLE_FAMILY_PARA == nFamily)
{
- //UUUU
- //if(SFX_STYLE_FAMILY_FRAME == nFamily)
- //{
- // //UUUU create needed items for XPropertyList entries from the DrawModel so that
- // // the Area TabPage can access them
- // SfxItemSet& rSet = xTmp->GetItemSet();
- // const SdrModel* pDrawModel = GetDoc()->GetDrawModel();
- //
- // rSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
- // rSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
- // rSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
- // rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
- //}
+ //UUUU create needed items for XPropertyList entries from the DrawModel so that
+ // the Area TabPage can access them
+ SfxItemSet& rSet = xTmp->GetItemSet();
+ const SwDrawModel* pDrawModel = GetDoc()->GetDrawModel();
+
+ rSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
+ rSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
+ rSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
+ rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
+ }
+ if (!bBasic)
+ {
// vor dem Dialog wird der HtmlMode an der DocShell versenkt
sal_uInt16 nHtmlMode = ::GetHtmlMode(this);
// In HTML mode, we do not always have a printer. In order to show
// the correct page size in the Format - Page dialog, we have to
// get one here.
- SwWrtShell* pCurrShell = ( pActShell ? pActShell : pWrtShell );
+ SwWrtShell* pCurrShell = ( pActShell ? pActShell : mpWrtShell );
if( ( HTMLMODE_ON & nHtmlMode ) &&
!pCurrShell->getIDocumentDeviceAccess()->getPrinter( false ) )
pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess()->getPrinter( true ) );
@@ -701,7 +691,7 @@ sal_uInt16 SwDocShell::Edit(
DBG_ASSERT(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE,
0, *(xTmp.get()), nFamily, nSlot,
- pActShell ? pActShell : pWrtShell, bNew);
+ pActShell ? pActShell : mpWrtShell, bNew);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
@@ -735,7 +725,7 @@ sal_uInt16 SwDocShell::Edit(
SID_IMAGE_ORIENTATION,
SID_ATTR_CHAR_FONT,
FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0};
- pView->GetViewFrame()->GetBindings().Invalidate(aInval);
+ mpView->GetViewFrame()->GetBindings().Invalidate(aInval);
}
SfxItemSet aTmpSet( *pDlg->GetOutputItemSet() );
if( SFX_STYLE_FAMILY_CHAR == nFamily )
@@ -751,24 +741,31 @@ sal_uInt16 SwDocShell::Edit(
aTmpSet.ClearItem( RES_BACKGROUND );
}
- //UUUU
- if(bNew && SFX_STYLE_FAMILY_FRAME == nFamily)
- {
- // clear FillStyle so that it works as a derived attribute
- aTmpSet.ClearItem(XATTR_FILLSTYLE);
- }
-
xTmp->SetItemSet( aTmpSet );
if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() )
{
const SfxPoolItem *pItem = NULL;
if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET )
- SwChartHelper::DoUpdateAllCharts( pDoc );
+ SwChartHelper::DoUpdateAllCharts( mpDoc );
}
}
+
+ //UUUU
+ if(bNew)
+ {
+ if(SFX_STYLE_FAMILY_FRAME == nFamily || SFX_STYLE_FAMILY_PARA == nFamily)
+ {
+ // clear FillStyle so that it works as a derived attribute
+ SfxItemSet aTmpSet(*pDlg->GetOutputItemSet());
+
+ aTmpSet.ClearItem(XATTR_FILLSTYLE);
+ xTmp->SetItemSet(aTmpSet);
+ }
+ }
+
if(SFX_STYLE_FAMILY_PAGE == nFamily)
- pView->InvalidateRulerPos();
+ mpView->InvalidateRulerPos();
if( bNew )
mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) );
@@ -779,10 +776,10 @@ sal_uInt16 SwDocShell::Edit(
// Kopf-/Fusszeilen entfernt werden. Sonst kommts zu GPFs!!!
delete pDlg;
- pDoc->SetModified();
+ mpDoc->SetModified();
if( !bModified ) // Bug 57028
{
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
GetWrtShell()->EndAllAction();
@@ -794,11 +791,11 @@ sal_uInt16 SwDocShell::Edit(
// #116530#
//pBasePool->Erase( &aTmp );
GetWrtShell()->Undo(1);
- pDoc->GetIDocumentUndoRedo().ClearRedo();
+ mpDoc->GetIDocumentUndoRedo().ClearRedo();
}
if( !bModified )
- pDoc->ResetModified();
+ mpDoc->ResetModified();
delete pDlg;
}
}
@@ -839,15 +836,15 @@ sal_uInt16 SwDocShell::Edit(
xTmp->SetItemSet( aTmpSet );
}
if(SFX_STYLE_FAMILY_PAGE == nFamily)
- pView->InvalidateRulerPos();
+ mpView->InvalidateRulerPos();
if( bNew )
mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) );
- pDoc->SetModified();
+ mpDoc->SetModified();
if( !bModified ) // Bug 57028
{
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
GetWrtShell()->EndAllAction();
}
@@ -910,11 +907,8 @@ sal_uInt16 SwDocShell::ApplyStyles(
}
case SFX_STYLE_FAMILY_PARA:
{
- // --> OD 2007-11-06 #i62675#
- // clear also list attributes at affected text nodes, if paragraph
- // style has the list style attribute set.
+ // clear also list attributes at affected text nodes, if paragraph style has the list style attribute set.
pSh->SetTxtFmtColl( pStyle->GetCollection(), true );
- // <--
break;
}
case SFX_STYLE_FAMILY_FRAME:
@@ -931,14 +925,9 @@ sal_uInt16 SwDocShell::ApplyStyles(
case SFX_STYLE_FAMILY_PSEUDO:
{
- // --> OD 2008-02-08 #newlistlevelattrs#
- // reset indent attribute on applying list style
- // --> OD 2008-03-17 #refactorlists#
- // continue list of list style
const SwNumRule* pNumRule = pStyle->GetNumRule();
const String sListIdForStyle = pNumRule->GetDefaultListId();
pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true );
- // <--
break;
}
@@ -960,7 +949,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily)
{
ASSERT(GetWrtShell(), "Keine Shell, keine Styles");
- SwEditWin& rEdtWin = pView->GetEditWin();
+ SwEditWin& rEdtWin = mpView->GetEditWin();
SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
sal_Bool bWaterCan = !(pApply && pApply->eType != 0);
if( !rName.Len() )
@@ -1002,7 +991,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily)
aTemplate.eType = 0;
// Template anwenden
- pView->GetEditWin().SetApplyTemplate(aTemplate);
+ mpView->GetEditWin().SetApplyTemplate(aTemplate);
return nFamily;
}
@@ -1296,22 +1285,22 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent
// der Vorlage erhalten, einmal alle FixFelder der
// Source aktualisieren
if(!bPreserveCurrentDocument)
- ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL);
- if( pWrtShell )
+ ((SwDocShell&)rSource).mpDoc->SetFixFields(false, NULL);
+ if( mpWrtShell )
{
- pWrtShell->StartAllAction();
- pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc );
- pWrtShell->EndAllAction();
+ mpWrtShell->StartAllAction();
+ mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc );
+ mpWrtShell->EndAllAction();
}
else
{
- sal_Bool bModified = pDoc->IsModified();
- pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc );
- if( !bModified && pDoc->IsModified() && !pView )
+ sal_Bool bModified = mpDoc->IsModified();
+ mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc );
+ if( !bModified && mpDoc->IsModified() && !mpView )
{
// die View wird spaeter angelegt, ueberschreibt aber das
// Modify-Flag. Per Undo ist sowieso nichts mehr zu machen
- pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
}
}
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 5566b8c6e8aa..4551b214e7d0 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -19,23 +19,19 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#define _SVSTDARR_USHORTS
-
#include <svl/smplhint.hxx>
#include <hintids.hxx>
#include <svl/itemiter.hxx>
#include <svl/eitem.hxx>
+#include <svx/xdef.hxx>
#include <unotools/syslocale.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/numitem.hxx>
-// --> OD 2008-02-13 #newlistlevelattrs#
#include <editeng/lrspitem.hxx>
-// <--
#include <fmtcol.hxx>
#include <uitool.hxx>
#include <swmodule.hxx>
@@ -65,6 +61,11 @@
#include <svx/svxids.hrc>
#include <SwRewriter.hxx>
#include <svx/fmmodel.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xflftrit.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/drawitem.hxx>
+#include <drawdoc.hxx>
// MD 06.02.95: Die Formatnamen in der Liste aller Namen haben als
// erstes Zeichen die Familie:
@@ -663,6 +664,11 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
sal_Bool bHasCJKFontPrefix = sal_False;
SvtCJKOptions aCJKOptions;
+ //UUUU Get currently used FillStyle and remember, also need the XFillFloatTransparenceItem
+ // to decide if gradient transparence is used
+ const XFillStyle eFillStyle(static_cast< const XFillStyleItem& >(pSet->Get(XATTR_FILLSTYLE)).GetValue());
+ const bool bUseFloatTransparence(static_cast< const XFillFloatTransparenceItem& >(pSet->Get(XATTR_FILLFLOATTRANSPARENCE)).IsEnabled());
+
while ( pItem )
{
if(!IsInvalidItem(pItem))
@@ -689,6 +695,44 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
sal_Bool bIsDefault = sal_False;
switch ( pItem->Which() )
{
+ //UUUU
+ case XATTR_FILLCOLOR:
+ {
+ // only use active FillStyle information
+ bIsDefault = (XFILL_SOLID == eFillStyle);
+ break;
+ }
+ case XATTR_FILLGRADIENT:
+ {
+ // only use active FillStyle information
+ bIsDefault = (XFILL_GRADIENT == eFillStyle);
+ break;
+ }
+ case XATTR_FILLHATCH:
+ {
+ // only use active FillStyle information
+ bIsDefault = (XFILL_HATCH == eFillStyle);
+ break;
+ }
+ case XATTR_FILLBITMAP:
+ {
+ // only use active FillStyle information
+ bIsDefault = (XFILL_BITMAP == eFillStyle);
+ break;
+ }
+ case XATTR_FILLTRANSPARENCE:
+ {
+ // only active when not FloatTransparence
+ bIsDefault = !bUseFloatTransparence;
+ break;
+ }
+ case XATTR_FILLFLOATTRANSPARENCE:
+ {
+ // only active when FloatTransparence
+ bIsDefault = bUseFloatTransparence;
+ break;
+ }
+
case SID_ATTR_PARA_PAGENUM:
sPageNum = aItemPresentation;
break;
@@ -1023,10 +1067,6 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr)
Beschreibung: ueber Name und Family, Mask den ItemSet rausholen
--------------------------------------------------------------------*/
-//UUUU
-#include <svx/svdmodel.hxx>
-#include <svx/drawitem.hxx>
-
SfxItemSet& SwDocStyleSheet::GetItemSet()
{
if(!bPhysical)
@@ -1072,7 +1112,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
- const SdrModel* pDrawModel = rDoc.GetDrawModel();
+ const SwDrawModel* pDrawModel = rDoc.GetDrawModel();
aCoreSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
@@ -1084,6 +1124,12 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
case SFX_STYLE_FAMILY_PAGE :
{
+ //UUUU set correct parent to get the XFILL_NONE FillStyle as needed
+ if(!aCoreSet.GetParent())
+ {
+ aCoreSet.SetParent(&rDoc.GetDfltFrmFmt()->GetAttrSet());
+ }
+
ASSERT(pDesc, "Kein PageDescriptor");
::PageDescToItemSet(*((SwPageDesc*)pDesc), aCoreSet);
}
@@ -1222,11 +1268,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if( pColl != &pColl->GetNextTxtFmtColl() )
pCColl->SetNextTxtFmtColl( pColl->GetNextTxtFmtColl() );
- //pCColl->SetOutlineLevel( pColl->GetOutlineLevel() );//#outline level,zhaojianwei
if( pColl->IsAssignedToListLevelOfOutlineStyle())
pCColl->AssignToListLevelOfOutlineStyle(pColl->GetAssignedOutlineStyleLevel());
else
- pCColl->DeleteAssignmentToListLevelOfOutlineStyle();//<--end,zhaojianwei
+ pCColl->DeleteAssignmentToListLevelOfOutlineStyle();
diff --git a/sw/source/ui/chrdlg/paradlg.src b/sw/source/ui/chrdlg/paradlg.src
index fa7f710134f8..b71c2fa1e316 100644
--- a/sw/source/ui/chrdlg/paradlg.src
+++ b/sw/source/ui/chrdlg/paradlg.src
@@ -24,6 +24,8 @@
#include "globals.hrc"
#include "chrdlg.hrc"
#include "paradlg.hrc"
+#include <svx/dialogs.hrc>
+
#define HelpText "error - hier keine HelpTexte HelpText"
// #define DLG_PARA 256
TabDialog DLG_PARA
@@ -85,12 +87,28 @@ TabDialog DLG_PARA
Text [ en-US ] = "Borders" ;
PageResID = TP_BORDER ;
};
+
+ //UUUU new Area and Transparence TabPages
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_AREA;
+ PageResID = RID_SVXPAGE_AREA;
+ Text [ en-US ] = "Area" ;
+ };
PageItem
{
- Identifier = TP_BACKGROUND ;
- Text [ en-US ] = "Background" ;
- PageResID = TP_BACKGROUND ;
+ Identifier = RID_SVXPAGE_TRANSPARENCE;
+ PageResID = RID_SVXPAGE_TRANSPARENCE;
+ Text [ en-US ] = "Transparency" ;
};
+
+ //UUUU Remove?
+ //PageItem
+ //{
+ // Identifier = TP_BACKGROUND ;
+ // Text [ en-US ] = "Background" ;
+ // PageResID = TP_BACKGROUND ;
+ //};
};
};
};
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 8f548fbdb561..3836f495d240 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -150,13 +150,20 @@ SwParaDlg::SwParaDlg(Window *pParent,
}
if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES)))
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
- AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+ //UUUU remove?
+ //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+
+ //UUUU add Area and Transparence TabPages
+ AddTabPage(RID_SVXPAGE_AREA);
+ AddTabPage(RID_SVXPAGE_TRANSPARENCE);
}
else
{
- RemoveTabPage(TP_BACKGROUND);
+ //UUUU RemoveTabPage(TP_BACKGROUND);
+ RemoveTabPage(RID_SVXPAGE_AREA);
+ RemoveTabPage(RID_SVXPAGE_TRANSPARENCE);
}
if(!bHtmlMode || (nHtmlMode & HTMLMODE_PARA_BORDER))
{
@@ -178,88 +185,123 @@ __EXPORT SwParaDlg::~SwParaDlg()
}
-void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
+void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId,SfxTabPage& rPage)
{
SwWrtShell& rSh = rView.GetWrtShell();
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- // Bei Tabellenumrandung kann im Writer kein Schatten eingestellt werden
- if (nId == TP_BORDER)
+ switch(nId)
{
- aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
- rPage.PageCreated(aSet);
- }
- else if( nId == TP_PARA_STD )
- {
- aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,
- static_cast< sal_uInt16 >(rSh.GetAnyCurRect(RECT_PAGE_PRT).Width()) ));
-
- if (!bDrawParaDlg)
+ case TP_BORDER:
{
- aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000E));
- aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, MM50/10));
-
+ // Bei Tabellenumrandung kann im Writer kein Schatten eingestellt werden
+ aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
+ rPage.PageCreated(aSet);
+ break;
}
- rPage.PageCreated(aSet);
- }
- else if( TP_PARA_ALIGN == nId)
- {
- if (!bDrawParaDlg)
+ case TP_PARA_STD:
{
- aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
+ aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,
+ static_cast<sal_uInt16>(rSh.GetAnyCurRect(RECT_PAGE_PRT).Width())));
+
+ if(!bDrawParaDlg)
+ {
+ aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000E));
+ aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50 / 10));
+
+ }
rPage.PageCreated(aSet);
+ break;
}
- }
- else if( TP_PARA_EXT == nId )
- {
- // Seitenumbruch nur, wenn der Cursor im Body-Bereich und nicht in
- // einer Tabelle steht
- const sal_uInt16 eType = rSh.GetFrmType(0,sal_True);
- if( !(FRMTYPE_BODY & eType) ||
- rSh.GetSelectionType() & nsSelectionType::SEL_TBL )
+ case TP_PARA_ALIGN:
{
- aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_True));
- rPage.PageCreated(aSet);
+ if(!bDrawParaDlg)
+ {
+ aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
+ rPage.PageCreated(aSet);
+ }
+ break;
}
- }
- else if( TP_DROPCAPS == nId )
- {
- ((SwDropCapsPage&)rPage).SetFormat(sal_False);
- }
- else if( TP_BACKGROUND == nId )
- {
- if(!( nHtmlMode & HTMLMODE_ON ) ||
- nHtmlMode & HTMLMODE_SOME_STYLES)
+ case TP_PARA_EXT:
{
- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR));
- rPage.PageCreated(aSet);
+ // Seitenumbruch nur, wenn der Cursor im Body-Bereich und nicht in
+ // einer Tabelle steht
+ const sal_uInt16 eType = rSh.GetFrmType(0,sal_True);
+ if(!(FRMTYPE_BODY & eType) ||
+ rSh.GetSelectionType() & nsSelectionType::SEL_TBL)
+ {
+ aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_True));
+ rPage.PageCreated(aSet);
+ }
+ break;
}
- }
- else if( TP_NUMPARA == nId)
- {
- //-->#outline level,added by zhaojianwei
- SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl();
- if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() )
+ case TP_DROPCAPS:
+ {
+ ((SwDropCapsPage&)rPage).SetFormat(sal_False);
+ break;
+ }
+ case TP_BACKGROUND:
{
- ((SwParagraphNumTabPage&)rPage).DisableOutline() ;
- }//<-end
-
- ((SwParagraphNumTabPage&)rPage).EnableNewStart();
- ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
- SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool();
- pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL);
- const SfxStyleSheetBase* pBase = pPool->First();
- SvStringsSortDtor aNames;
- while(pBase)
+ if(!(nHtmlMode & HTMLMODE_ON) ||
+ nHtmlMode & HTMLMODE_SOME_STYLES)
+ {
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_SHOW_SELECTOR));
+ rPage.PageCreated(aSet);
+ }
+ break;
+ }
+ case TP_NUMPARA:
{
- aNames.Insert(new String(pBase->GetName()));
- pBase = pPool->Next();
+ //-->#outline level,added by zhaojianwei
+ SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl();
+ if(pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle())
+ {
+ ((SwParagraphNumTabPage&)rPage).DisableOutline();
+ }//<-end
+
+ ((SwParagraphNumTabPage&)rPage).EnableNewStart();
+ ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
+ SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool();
+ pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO,SFXSTYLEBIT_ALL);
+ const SfxStyleSheetBase* pBase = pPool->First();
+ SvStringsSortDtor aNames;
+ while(pBase)
+ {
+ aNames.Insert(new String(pBase->GetName()));
+ pBase = pPool->Next();
+ }
+ for(sal_uInt16 i = 0; i < aNames.Count(); i++)
+ rBox.InsertEntry(*aNames.GetObject(i));
+ break;
}
- for(sal_uInt16 i = 0; i < aNames.Count(); i++)
- rBox.InsertEntry(*aNames.GetObject(i));
- }
-}
+ //UUUU inits for Area and Transparency TabPages
+ // The selection attribute lists (XPropertyList derivates, e.g. XColorList for
+ // the color table) need to be added as items (e.g. SvxColorTableItem) to make
+ // these pages find the needed attributes for fill style suggestions.
+ // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on
+ // demand, but could also be directly added from the DrawModel.
+ case RID_SVXPAGE_AREA:
+ {
+ SfxItemSet aNew(*aSet.GetPool(),
+ SID_COLOR_TABLE, SID_BITMAP_LIST,
+ SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0);
+
+ aNew.Put(*GetInputSetImpl());
+ // add flag for direct graphic content selection
+ aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true));
+
+ rPage.PageCreated(aNew);
+ break;
+ }
+ case RID_SVXPAGE_TRANSPARENCE:
+ {
+ rPage.PageCreated(*GetInputSetImpl());
+ break;
+ }
+ }
+}
+// eof
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 7b3dd1cc0df3..e6002d6d46c9 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1809,7 +1809,7 @@ void SwInsertDBColAutoPilot::Load()
rtl::OUString sColumn;
pSubProps[0] >>= sColumn;
- //check for existance of the loaded column name
+ //check for existence of the loaded column name
sal_Bool bFound = sal_False;
for(sal_Int32 nRealColumn = 0; nRealColumn < aDBColumns.Count(); nRealColumn++)
{
diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx
index e9061b9ff06b..7a7f23a81f50 100644
--- a/sw/source/ui/dbui/maildispatcher.cxx
+++ b/sw/source/ui/dbui/maildispatcher.cxx
@@ -112,7 +112,7 @@ MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) :
throw uno::RuntimeException();
// wait until the mail dispatcher thread is really alive
- // and has aquired a reference to this instance of the
+ // and has acquired a reference to this instance of the
// class
mail_dispatcher_active_.wait();
}
@@ -242,7 +242,7 @@ void MailDispatcher::sendMailMessageNotifyListener(uno::Reference<mail::XMailMes
void MailDispatcher::run()
{
- // aquire a self reference in order to avoid race
+ // acquire a self reference in order to avoid race
// conditions. The last client of this class must
// call shutdown before releasing his last reference
// to this class in order to shutdown this thread
diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx
index 9035985a2c7f..6248f9618815 100644
--- a/sw/source/ui/dbui/swdbtoolsclient.cxx
+++ b/sw/source/ui/dbui/swdbtoolsclient.cxx
@@ -159,7 +159,7 @@ void SwDbtoolsClient::getFactory()
if (pDBTFactory)
{
m_xDataAccessFactory = pDBTFactory;
- // by definition, the factory was aquired once
+ // by definition, the factory was acquired once
m_xDataAccessFactory->release();
}
}
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index a8a53adcf94e..85e1e15eee04 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -56,6 +54,7 @@
#include <cmdid.h>
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 754a6121bc8c..0e30896ff90d 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -3865,7 +3865,7 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise )
sal_Bool bIsModified = pDoc->IsModified();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- // check, if DdeBookmark is already in its desctruction
+ // check, if DdeBookmark is already in its destruction
IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(sName);
if ( ppMark != pMarkAccess->getAllMarksEnd() )
{
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 1c38eacbfc69..a1ed2e1bdf20 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -127,7 +127,7 @@ SwPostItMgr::SwPostItMgr(SwView* pView)
SW_MOD()->GetRedlineAuthor();
// collect all PostIts and redline comments that exist after loading the document
- // don't check for existance for any of them, don't focus them
+ // don't check for existence for any of them, don't focus them
AddPostIts(false,false);
/* this code can be used once we want redline comments in the Sidebar
AddRedlineComments(false,false);
@@ -620,9 +620,9 @@ void SwPostItMgr::LayoutPostIts()
mbLayouting = true;
//loop over all pages and do the layout
- // - create SwPostIt if neccessary
+ // - create SwPostIt if necessary
// - place SwPostIts on their initial position
- // - calculate neccessary height for all PostIts together
+ // - calculate necessary height for all PostIts together
bool bUpdate = false;
for (unsigned long n=0;n<mPages.size();n++)
{
@@ -866,7 +866,7 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
{
DBG_ASSERT((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
- // do not scroll more than neccessary up or down
+ // do not scroll more than necessary up or down
if ( ((mPages[aPage-1]->lOffset == 0) && (lScroll>0)) || ( BorderOverPageBorder(aPage) && (lScroll<0)) )
return;
@@ -1013,7 +1013,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
bool bDone = false;
bool bScrollbars = false;
- // do all neccessary resizings
+ // do all necessary resizings
if (lVisibleHeight < lNeededHeight)
{
// ok, now we have to really resize and adding scrollbars
@@ -1223,7 +1223,7 @@ void SwPostItMgr::RemoveSidebarWin()
}
// copy to new vector, otherwise RemoveItem would operate and delete stuff on mvPostItFlds as well
-// RemoveItem will clean up the core field and visible postit if neccessary
+// RemoveItem will clean up the core field and visible postit if necessary
// we cannot just delete everything as before, as postits could move into change tracking
void SwPostItMgr::Delete(String aAuthor)
{
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index cdcbcb7bcb1c..3af6c58c8c45 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -579,7 +579,8 @@ void SwSidebarWin::SetPosAndSize()
}
// text range overlay
- if ( mrSidebarItem.maLayoutInfo.mnStartNodeIdx != 0
+ if ( mrMgr.ShowNotes()
+ && mrSidebarItem.maLayoutInfo.mnStartNodeIdx != 0
&& mrSidebarItem.maLayoutInfo.mnStartContent != STRING_NOTFOUND )
{
std::vector< basegfx::B2DRange > aAnnotationTextRanges;
@@ -1447,7 +1448,7 @@ void SwRedComment::MouseButtonDown( const MouseEvent& rMEvt )
void SwRedComment::Delete()
{
SwSidebarWin::Delete();
- // we are not neccessarily on our redline, so let's move there
+ // we are not necessarily on our redline, so let's move there
GotoPos();
DocView()->GetWrtShell().SetRedlineComment(EMPTYSTRING);
DocView()->GetWrtShell().ClearMark();
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index a7d2807fae27..b54ee51ab788 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -5485,7 +5485,7 @@ void SwEditWin::SetChainMode( sal_Bool bOn )
uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::CreateAccessible()
{
vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
- // happend already!!!
+ // happened already!!!
SwWrtShell *pSh = rView.GetWrtShellPtr();
ASSERT( pSh, "no writer shell, no accessible object" );
uno::Reference<
diff --git a/sw/source/ui/envelp/labimg.cxx b/sw/source/ui/envelp/labimg.cxx
index ffb3ff365b3f..694ac9da099a 100644
--- a/sw/source/ui/envelp/labimg.cxx
+++ b/sw/source/ui/envelp/labimg.cxx
@@ -208,7 +208,7 @@ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames()
{
static const char* aLabelPropNames[] =
{
- "Medium/Continous", // 0
+ "Medium/Continuous", // 0
"Medium/Brand", // 1
"Medium/Type", // 2
"Format/Column", // 3
@@ -302,7 +302,7 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) :
bNoConfigValues = sal_False;
switch(nProperty)
{
- case 0: aItem.bCont = *(sal_Bool*)pValues[nProp].getValue(); break;// "Medium/Continous",
+ case 0: aItem.bCont = *(sal_Bool*)pValues[nProp].getValue(); break;// "Medium/Continuous",
case 1: pValues[nProp] >>= aItem.aMake; break;// "Medium/Brand",
case 2: pValues[nProp] >>= aItem.aType; break;// "Medium/Type",
case 3: pValues[nProp] >>= aItem.nCols; break;// "Format/Column",
@@ -419,7 +419,7 @@ void SwLabCfgItem::Commit()
nProperty += 3;
switch(nProperty)
{
- case 0: pValues[nProp].setValue(&aItem.bCont, rType); break;// "Medium/Continous",
+ case 0: pValues[nProp].setValue(&aItem.bCont, rType); break;// "Medium/Continuous",
case 1: pValues[nProp] <<= aItem.aMake; break;// "Medium/Brand",
case 2: pValues[nProp] <<= aItem.aType; break;// "Medium/Type",
case 3: pValues[nProp] <<= aItem.nCols; break;// "Format/Column",
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 6d83b9b07b3e..8fba4e5ae446 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -199,9 +199,15 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SwParagraphNumTabPage::GetRanges);
AddTabPage(TP_DROPCAPS, SwDropCapsPage::Create,
SwDropCapsPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
- AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+ //UUUU remove?
+ //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+
+ //UUUU add Area and Transparence TabPages
+ AddTabPage(RID_SVXPAGE_AREA);
+ AddTabPage(RID_SVXPAGE_TRANSPARENCE);
+
DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
@@ -248,8 +254,10 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SwFrmAddPage::GetRanges );
AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create,
SwWrapTabPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+
+ //UUUU remove?
+ //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
//UUUU remove?
//AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
@@ -272,9 +280,15 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
// Seitenvorlagen
case SFX_STYLE_FAMILY_PAGE:
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
- AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+ //UUUU remove?
+ //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+
+ //UUUU add Area and Transparence TabPages
+ AddTabPage(RID_SVXPAGE_AREA);
+ AddTabPage(RID_SVXPAGE_TRANSPARENCE);
+
AddTabPage(TP_HEADER_PAGE, String(SW_RES(STR_PAGE_HEADER)),
SvxHeaderPage::Create,
SvxHeaderPage::GetRanges );
@@ -401,247 +415,296 @@ const SfxItemSet* SwTemplateDlg::GetRefreshedSet()
Beschreibung:
--------------------------------------------------------------------*/
-void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void SwTemplateDlg::PageCreated(sal_uInt16 nId,SfxTabPage &rPage)
{
//Namen der Vorlagen und Metric setzen
- String sNumCharFmt, sBulletCharFmt;
- SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt);
- SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt);
+ String sNumCharFmt,sBulletCharFmt;
+ SwStyleNameMapper::FillUIName(RES_POOLCHR_NUM_LEVEL,sNumCharFmt);
+ SwStyleNameMapper::FillUIName(RES_POOLCHR_BUL_LEVEL,sBulletCharFmt);
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- switch( nId )
+ switch(nId)
{
case TP_CHAR_STD:
- {
- ASSERT(::GetActiveView(), "keine View aktiv");
-
- SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()->
- GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
-
- aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
- sal_uInt32 nFlags = 0;
- if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON ))
- nFlags = SVX_RELATIVE_MODE;
- if( SFX_STYLE_FAMILY_CHAR == nType )
- nFlags = nFlags|SVX_PREVIEW_CHARACTER;
- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags));
- rPage.PageCreated(aSet);
- }
+ {
+ ASSERT(::GetActiveView(),"keine View aktiv");
+
+ SvxFontListItem aFontListItem(*((SvxFontListItem*)::GetActiveView()->
+ GetDocShell()->GetItem(SID_ATTR_CHAR_FONTLIST)));
+
+ aSet.Put(SvxFontListItem(aFontListItem.GetFontList(),SID_ATTR_CHAR_FONTLIST));
+ sal_uInt32 nFlags = 0;
+ if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON))
+ nFlags = SVX_RELATIVE_MODE;
+ if(SFX_STYLE_FAMILY_CHAR == nType)
+ nFlags = nFlags | SVX_PREVIEW_CHARACTER;
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags));
+ rPage.PageCreated(aSet);
break;
+ }
case TP_CHAR_EXT:
- {
+ {
sal_uInt32 nFlags = SVX_ENABLE_FLASH;
- if( SFX_STYLE_FAMILY_CHAR == nType )
- nFlags = nFlags|SVX_PREVIEW_CHARACTER;
- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags));
+ if(SFX_STYLE_FAMILY_CHAR == nType)
+ nFlags = nFlags | SVX_PREVIEW_CHARACTER;
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags));
rPage.PageCreated(aSet);
- }
break;
+ }
case TP_CHAR_POS:
- if( SFX_STYLE_FAMILY_CHAR == nType )
+ {
+ if(SFX_STYLE_FAMILY_CHAR == nType)
{
- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER));
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
rPage.PageCreated(aSet);
}
- break;
+ break;
+ }
case TP_CHAR_TWOLN:
- if( SFX_STYLE_FAMILY_CHAR == nType )
+ {
+ if(SFX_STYLE_FAMILY_CHAR == nType)
{
- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER));
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
rPage.PageCreated(aSet);
}
- break;
+ break;
+ }
case TP_PARA_STD:
+ {
+ if(rPage.GetItemSet().GetParent())
{
- if( rPage.GetItemSet().GetParent() )
- {
- aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50/10));
- aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F));
- rPage.PageCreated(aSet);
- }
-
+ aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50 / 10));
+ aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F));
+ rPage.PageCreated(aSet);
}
+
break;
+ }
+
case TP_NUMPARA:
+ {
+ //-->#outlinelevel added by zhaojianwei
+ // handle if the current paragraph style is assigned to a list level of outline style,
+ SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName(GetStyleSheet().GetName());
+ if(pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle())
{
- //-->#outlinelevel added by zhaojianwei
- // handle if the current paragraph style is assigned to a list level of outline style,
- SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName( GetStyleSheet().GetName() );
- if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() )
- {
- ((SwParagraphNumTabPage&)rPage).DisableOutline() ;
- ((SwParagraphNumTabPage&)rPage).DisableNumbering();
- }//<-end
- ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
- SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
- pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL);
- const SfxStyleSheetBase* pBase = pPool->First();
- SvStringsSortDtor aNames;
- while(pBase)
- {
- aNames.Insert(new String(pBase->GetName()));
- pBase = pPool->Next();
- }
- for(sal_uInt16 i = 0; i < aNames.Count(); i++)
- rBox.InsertEntry(*aNames.GetObject(i));
- }
- break;
- case TP_PARA_ALIGN:
+ ((SwParagraphNumTabPage&)rPage).DisableOutline();
+ ((SwParagraphNumTabPage&)rPage).DisableNumbering();
+ }//<-end
+ ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
+ SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
+ pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO,SFXSTYLEBIT_ALL);
+ const SfxStyleSheetBase* pBase = pPool->First();
+ SvStringsSortDtor aNames;
+ while(pBase)
{
- aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
- rPage.PageCreated(aSet);
+ aNames.Insert(new String(pBase->GetName()));
+ pBase = pPool->Next();
}
+ for(sal_uInt16 i = 0; i < aNames.Count(); i++)
+ rBox.InsertEntry(*aNames.GetObject(i));
break;
+ }
+
+ case TP_PARA_ALIGN:
+ {
+ aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
+ rPage.PageCreated(aSet);
+ break;
+ }
case TP_FRM_STD:
- ((SwFrmPage&)rPage).SetNewFrame( sal_True );
- ((SwFrmPage&)rPage).SetFormatUsed( sal_True );
+ {
+ ((SwFrmPage&)rPage).SetNewFrame(sal_True);
+ ((SwFrmPage&)rPage).SetFormatUsed(sal_True);
break;
+ }
case TP_FRM_ADD:
+ {
((SwFrmAddPage&)rPage).SetFormatUsed(sal_True);
((SwFrmAddPage&)rPage).SetNewFrame(sal_True);
break;
+ }
case TP_FRM_WRAP:
- ((SwWrapTabPage&)rPage).SetFormatUsed( sal_True, sal_False );
+ {
+ ((SwWrapTabPage&)rPage).SetFormatUsed(sal_True,sal_False);
break;
+ }
case TP_COLUMN:
- if( nType == SFX_STYLE_FAMILY_FRAME )
+ {
+ if(nType == SFX_STYLE_FAMILY_FRAME)
((SwColumnPage&)rPage).SetFrmMode(sal_True);
- ((SwColumnPage&)rPage).SetFormatUsed( sal_True );
+ ((SwColumnPage&)rPage).SetFormatUsed(sal_True);
break;
+ }
//UUUU do not remove; many other style dialog combinations still use the SfxTabPage
// for the SvxBrushItem (see RID_SVXPAGE_BACKGROUND)
case TP_BACKGROUND:
{
sal_Int32 nFlagType = 0;
- if( SFX_STYLE_FAMILY_PARA == nType )
+ if(SFX_STYLE_FAMILY_PARA == nType)
nFlagType |= SVX_SHOW_PARACTL;
- if( SFX_STYLE_FAMILY_CHAR != nType )
+ if(SFX_STYLE_FAMILY_CHAR != nType)
nFlagType |= SVX_SHOW_SELECTOR;
- if( SFX_STYLE_FAMILY_FRAME == nType )
+ if(SFX_STYLE_FAMILY_FRAME == nType)
nFlagType |= SVX_ENABLE_TRANSPARENCY;
- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlagType));
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlagType));
rPage.PageCreated(aSet);
+ break;
}
- break;
+
case TP_CONDCOLL:
+ {
((SwCondCollPage&)rPage).SetCollection(
- ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(), bNewStyle );
+ ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(),bNewStyle);
break;
+ }
case TP_PAGE_STD:
- if(0 == (nHtmlMode & HTMLMODE_ON ))
+ {
+ if(0 == (nHtmlMode & HTMLMODE_ON))
{
List aList;
String* pNew = new String;
- SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, *pNew );
- aList.Insert( pNew, (sal_uLong)0 );
- if( pWrtShell )
+ SwStyleNameMapper::FillUIName(RES_POOLCOLL_TEXT,*pNew);
+ aList.Insert(pNew,(sal_uLong)0);
+
+ if(pWrtShell)
{
- SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->
- GetView().GetDocShell()->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA);
SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First();
+
while(pFirstStyle)
{
- aList.Insert( new String(pFirstStyle->GetName()),
- aList.Count());
+ aList.Insert(new String(pFirstStyle->GetName()), aList.Count());
pFirstStyle = pStyleSheetPool->Next();
}
}
- aSet.Put (SfxStringListItem(SID_COLLECT_LIST, &aList));
+
+ //UUUU set DrawingLayer FillStyles active
+ aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
+ aSet.Put(SfxStringListItem(SID_COLLECT_LIST, &aList));
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
+
+ for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i)
+ {
delete (String*)aList.Remove(i);
+ }
}
+
break;
+ }
case TP_MACRO_ASSIGN:
{
SfxAllItemSet aNewSet(*aSet.GetPool());
- aNewSet.Put( SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM) );
- if ( pWrtShell )
- rPage.SetFrame( pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() );
+ aNewSet.Put(SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM));
+ if(pWrtShell)
+ rPage.SetFrame(pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface());
rPage.PageCreated(aNewSet);
break;
}
case RID_SVXPAGE_PICK_NUM:
- {
+ {
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
rPage.PageCreated(aSet);
- }
- break;
+ break;
+ }
+
case RID_SVXPAGE_NUM_OPTIONS:
{
-
- aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
- aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
+ aSet.Put(SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
+ aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
// Zeichenvorlagen sammeln
ListBox rCharFmtLB(this);
rCharFmtLB.Clear();
- rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
+ rCharFmtLB.InsertEntry(ViewShell::GetShellRes()->aStrNone);
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
- ::FillCharStyleListBox(rCharFmtLB, pDocShell);
+ ::FillCharStyleListBox(rCharFmtLB,pDocShell);
List aList;
for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
{
-
- aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
+ aList.Insert(new XubString(rCharFmtLB.GetEntry(j)),LIST_APPEND);
}
- aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
+ aSet.Put(SfxStringListItem(SID_CHAR_FMT_LIST_BOX,&aList));
FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell));
- aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
+ aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (XubString*)aList.Remove(i);
+ for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i)
+ delete (XubString*)aList.Remove(i);
aList.Clear();
+ break;
}
- break;
+
case RID_SVXPAGE_NUM_POSITION:
{
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell));
- aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
+ aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
rPage.PageCreated(aSet);
+ break;
}
- break;
- case RID_SVXPAGE_PICK_BULLET :
+
+ case RID_SVXPAGE_PICK_BULLET:
+ {
+ aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
+ rPage.PageCreated(aSet);
+ break;
+ }
+
+ case TP_HEADER_PAGE:
+ {
+ if(0 == (nHtmlMode & HTMLMODE_ON))
{
- aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
- rPage.PageCreated(aSet);
+ static_cast< SvxHeaderPage& >(rPage).EnableDynamicSpacing();
}
- break;
- case TP_HEADER_PAGE:
- if(0 == (nHtmlMode & HTMLMODE_ON ))
- ((SvxHeaderPage&)rPage).EnableDynamicSpacing();
- break;
+
+ //UUUU set DrawingLayer FillStyles active
+ aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
+ rPage.PageCreated(aSet);
+
+ break;
+ }
+
case TP_FOOTER_PAGE:
- if(0 == (nHtmlMode & HTMLMODE_ON ))
- ((SvxFooterPage&)rPage).EnableDynamicSpacing();
- break;
- case TP_BORDER :
- if( SFX_STYLE_FAMILY_PARA == nType )
+ {
+ if(0 == (nHtmlMode & HTMLMODE_ON))
+ {
+ static_cast< SvxFooterPage& >(rPage).EnableDynamicSpacing();
+ }
+
+ //UUUU set DrawingLayer FillStyles active
+ aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
+ rPage.PageCreated(aSet);
+
+ break;
+ }
+
+ case TP_BORDER:
+ {
+ if(SFX_STYLE_FAMILY_PARA == nType)
{
- aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
+ aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
}
- else if( SFX_STYLE_FAMILY_FRAME == nType )
+ else if(SFX_STYLE_FAMILY_FRAME == nType)
{
- aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
+ aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
}
rPage.PageCreated(aSet);
-
- break;
+ break;
+ }
//UUUU inits for Area and Transparency TabPages
// The selection attribute lists (XPropertyList derivates, e.g. XColorList for
@@ -651,24 +714,20 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
// demand, but could also be directly added from the DrawModel.
case RID_SVXPAGE_AREA:
{
- SfxItemSet aNew(*aSet.GetPool(),
- SID_COLOR_TABLE, SID_BITMAP_LIST,
- SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0);
-
- aNew.Put(GetStyleSheet().GetItemSet());
+ aSet.Put(GetStyleSheet().GetItemSet());
// add flag for direct graphic content selection
- aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true));
+ aSet.Put(SfxBoolItem(SID_OFFER_IMPORT, true));
- rPage.PageCreated(aNew);
+ rPage.PageCreated(aSet);
+ break;
}
- break;
case RID_SVXPAGE_TRANSPARENCE:
{
rPage.PageCreated(GetStyleSheet().GetItemSet());
+ break;
}
- break;
}
}
diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src
index f9b23a473ec5..383c1149f525 100644
--- a/sw/source/ui/fmtui/tmpdlg.src
+++ b/sw/source/ui/fmtui/tmpdlg.src
@@ -148,12 +148,29 @@ TabDialog DLG_TEMPLATE_2
Text [ en-US ] = "Drop Caps" ;
PageResID = TP_DROPCAPS ;
};
+
+ //UUUU new Area and Transparence TabPages
PageItem
{
- Identifier = TP_BACKGROUND ;
- Text [ en-US ] = "Background" ;
- PageResID = TP_BACKGROUND ;
+ Identifier = RID_SVXPAGE_AREA;
+ PageResID = RID_SVXPAGE_AREA;
+ Text [ en-US ] = "Area" ;
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_TRANSPARENCE;
+ PageResID = RID_SVXPAGE_TRANSPARENCE;
+ Text [ en-US ] = "Transparency" ;
};
+
+ //UUUU remove?
+ //PageItem
+ //{
+ // Identifier = TP_BACKGROUND ;
+ // Text [ en-US ] = "Background" ;
+ // PageResID = TP_BACKGROUND ;
+ //};
+
PageItem
{
Identifier = TP_BORDER ;
@@ -196,12 +213,28 @@ TabDialog DLG_TEMPLATE_4
Text [ en-US ] = "Page" ;
PageResID = TP_PAGE_STD ;
};*/
+
+ //UUUU new Area and Transparence TabPages
PageItem
{
- Identifier = TP_BACKGROUND ;
- Text [ en-US ] = "Background" ;
- PageResID = TP_BACKGROUND ;
+ Identifier = RID_SVXPAGE_AREA;
+ PageResID = RID_SVXPAGE_AREA;
+ Text [ en-US ] = "Area" ;
};
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_TRANSPARENCE;
+ PageResID = RID_SVXPAGE_TRANSPARENCE;
+ Text [ en-US ] = "Transparency" ;
+ };
+
+ //UUUU remove?
+ //PageItem
+ //{
+ // Identifier = TP_BACKGROUND ;
+ // Text [ en-US ] = "Background" ;
+ // PageResID = TP_BACKGROUND ;
+ //};
/* PageItem
{
Identifier = TP_BORDER ;
diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx
index 81f348c1e28e..4df7a20b648d 100644
--- a/sw/source/ui/frmdlg/colex.cxx
+++ b/sw/source/ui/frmdlg/colex.cxx
@@ -19,19 +19,12 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include "cmdid.h"
#include "hintids.hxx"
#include <algorithm>
-
-
#include <svl/eitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
@@ -46,6 +39,9 @@
#include "colex.hxx"
#include "colmgr.hxx"
+//UUUU
+#include <svx/unobrushitemhelper.hxx>
+
/*-----------------------------------------------------------------------
Beschreibung: Uebernahme der aktualisierten Werte aus dem Set
-----------------------------------------------------------------------*/
@@ -128,12 +124,20 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
SetHdLeft( rLR.GetLeft() );
SetHdRight( rLR.GetRight() );
SetHeader( sal_True );
- if ( rHeaderSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET )
+
+ if(SFX_ITEM_SET == rHeaderSet.GetItemState(RES_BACKGROUND))
{
- const SvxBrushItem& rItem =
- (const SvxBrushItem&)rHeaderSet.Get( RES_BACKGROUND );
- SetHdColor( rItem.GetColor() );
+ //UUUU create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor());
+ const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(RES_BACKGROUND));
+ SfxItemSet aTempSet(*rHeaderSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+
+ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
+ setHeaderFillAttributes(
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr(
+ new drawinglayer::attribute::SdrAllFillAttributesHelper(
+ aTempSet)));
}
+
if ( rHeaderSet.GetItemState( RES_BOX ) == SFX_ITEM_SET )
{
const SvxBoxItem& rItem =
@@ -167,12 +171,20 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
SetFtLeft( rLR.GetLeft() );
SetFtRight( rLR.GetRight() );
SetFooter( sal_True );
+
if( rFooterSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET )
{
- const SvxBrushItem& rItem =
- (const SvxBrushItem&)rFooterSet.Get( RES_BACKGROUND );
- SetFtColor( rItem.GetColor() );
+ //UUUU create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor());
+ const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rFooterSet.Get(RES_BACKGROUND));
+ SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+
+ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
+ setFooterFillAttributes(
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr(
+ new drawinglayer::attribute::SdrAllFillAttributesHelper(
+ aTempSet)));
}
+
if( rFooterSet.GetItemState( RES_BOX ) == SFX_ITEM_SET )
{
const SvxBoxItem& rItem =
@@ -183,19 +195,18 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
else
SetFooter( sal_False );
}
- if( SFX_ITEM_SET == rSet.GetItemState( RES_BACKGROUND,
- sal_False, &pItem ) )
- {
- SetColor( ( (const SvxBrushItem*)pItem )->GetColor() );
- const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic();
- if ( pGrf )
- {
- Bitmap aBitmap = pGrf->GetBitmap();
- SetBitmap( &aBitmap );
- }
- else
- SetBitmap( NULL );
+ if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND, sal_False, &pItem))
+ {
+ //UUUU create FillAttributes from SvxBrushItem
+ const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem);
+ SfxItemSet aTempSet(*rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+
+ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
+ setPageFillAttributes(
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr(
+ new drawinglayer::attribute::SdrAllFillAttributesHelper(
+ aTempSet)));
}
Invalidate();
@@ -233,14 +244,23 @@ void SwColExample::DrawPage( const Point& rOrg,
- GetFtHeight() - GetFtDist();
DrawRect(aRect);
- if(GetColor() == Color(COL_TRANSPARENT))
+ //UUUU
+ const Rectangle aDefineRect(aRect);
+
+ //UUUU
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes = getPageFillAttributes();
+
+ if(!rFillAttributes.get() || !rFillAttributes->isUsed())
{
+ //UUUU If there is no fill, use fallback color
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
const Color& rFieldColor = rStyleSettings.GetFieldColor();
- SetFillColor( rFieldColor );
+
+ setPageFillAttributes(
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr(
+ new drawinglayer::attribute::SdrAllFillAttributesHelper(
+ rFieldColor)));
}
- else
- SetFillColor( GetColor() );
// #97495# make sure that the automatic column widht's are always equal
sal_Bool bAutoWidth = pColMgr->IsAutoWidth();
@@ -260,7 +280,10 @@ void SwColExample::DrawPage( const Point& rOrg,
if(!bAutoWidth)
nAutoColWidth = pColMgr->GetColWidth( i );
aRect.Right() = aRect.Left() + nAutoColWidth;
- DrawRect(aRect);
+
+ //UUUU use primitive draw command
+ drawFillAttributes(getPageFillAttributes(), aRect, aDefineRect);
+
if(i < nColumnCount - 1)
aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i);
}
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index e1840cc2f732..83e22491d60f 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -35,6 +35,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/shaditem.hxx>
#include <svx/swframevalidation.hxx>
+#include <svx/xdef.hxx>
#include <fmtclds.hxx>
#include "wrtsh.hxx"
#include "view.hxx"
diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src
index 82f0a3967415..abf689ce2aef 100644
--- a/sw/source/ui/frmdlg/frmpage.src
+++ b/sw/source/ui/frmdlg/frmpage.src
@@ -157,14 +157,31 @@ TabDialog DLG_FRM_GRF
PageResID = TP_BORDER ;
Text [ en-US ] = "Borders" ;
};
+
+ //UUUU new Area and Transparence TabPages
PageItem
{
- Identifier = TP_BACKGROUND ;
- PageResID = TP_BACKGROUND ;
- Text [ en-US ] = "Background" ;
+ Identifier = RID_SVXPAGE_AREA;
+ PageResID = RID_SVXPAGE_AREA;
+ Text [ en-US ] = "Area" ;
};
PageItem
{
+ Identifier = RID_SVXPAGE_TRANSPARENCE;
+ PageResID = RID_SVXPAGE_TRANSPARENCE;
+ Text [ en-US ] = "Transparency" ;
+ };
+
+ //UUUU remove?
+ //PageItem
+ //{
+ // Identifier = TP_BACKGROUND ;
+ // PageResID = TP_BACKGROUND ;
+ // Text [ en-US ] = "Background" ;
+ //};
+
+ PageItem
+ {
Identifier = TP_MACRO_ASSIGN ;
Text [ en-US ] = "Macro" ;
};
@@ -212,12 +229,29 @@ TabDialog DLG_FRM_OLE
PageResID = TP_BORDER ;
Text [ en-US ] = "Borders" ;
};
+
+ //UUUU new Area and Transparence TabPages
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_AREA;
+ PageResID = RID_SVXPAGE_AREA;
+ Text [ en-US ] = "Area" ;
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_TRANSPARENCE;
+ PageResID = RID_SVXPAGE_TRANSPARENCE;
+ Text [ en-US ] = "Transparency" ;
+ };
+
+ //UUUU remove?
PageItem
{
Identifier = TP_BACKGROUND ;
PageResID = TP_BACKGROUND ;
Text [ en-US ] = "Background" ;
};
+
/*
PageItem {
Identifier = TP_COLUMN ;
diff --git a/sw/source/ui/inc/tablemgr.hxx b/sw/source/ui/inc/tablemgr.hxx
index 4ebeea506f42..44e95bccc7df 100644
--- a/sw/source/ui/inc/tablemgr.hxx
+++ b/sw/source/ui/inc/tablemgr.hxx
@@ -76,7 +76,7 @@ public:
// @deprecated
void UpdateChart();
- /// @return the XModel of the newly inserted chart if successfull
+ /// @return the XModel of the newly inserted chart if successful
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
InsertChart( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > &rxDataProvider, sal_Bool bFillWithData, const rtl::OUString &rCellRange, SwFlyFrmFmt** ppFlyFrmFmt = 0 );
};
diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx
index 766079ab2f0d..9c2b4851df70 100644
--- a/sw/source/ui/inc/uitool.hxx
+++ b/sw/source/ui/inc/uitool.hxx
@@ -81,7 +81,7 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
String GetAppLangDateTimeString( const DateTime& );
-// search for a command string withing the menu structure and execute it
+// search for a command string within the menu structure and execute it
// at the dispatcher if there is one, if executed return true
bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId );
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index ce800f3bcefa..855d5f3c5d03 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -740,7 +740,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
String aTmp( aSuggestions[ nAltIdx ] );
String aOrig( bGrammarResults ? OUString() : xSpellAlt->getWord() );
- // if orginal word has a trailing . (likely the end of a sentence)
+ // if original word has a trailing . (likely the end of a sentence)
// and the replacement text hasn't, then add it to the replacement
if (aTmp.Len() && aOrig.Len() &&
'.' == aOrig.GetChar( aOrig.Len() - 1) && /* !IsAlphaNumeric ??*/
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index d111cef9f10f..11a48d572444 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <svx/svditer.hxx>
#include <svx/svdotext.hxx>
@@ -40,19 +39,16 @@
#include <unotools/localedatawrapper.hxx>
#include <sdrhhcwrap.hxx>
#include <frmfmt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx> // " " "
-#endif
#include <wrtsh.hxx> // MakeVisible
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <dcontact.hxx> // Spelling von DrawObj
#include <doc.hxx> // " " "
#include <docary.hxx>
#include <edtwin.hxx>
#include <svx/svdlegacy.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 10a53cf75ed0..12622bbe1f02 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -349,7 +349,12 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
ShowAutoText(*::GetCurrGlosGroup(), aShortNameEdit.GetText());
}
else
+ {
+ aNameED.SetText(aEmptyStr);
+ aShortNameEdit.SetText(aEmptyStr);
+ aInsertBtn.Enable(sal_False);
ShowAutoText(aEmptyStr, aEmptyStr);
+ }
//Controls aktualisieren
NameModify(&aShortNameEdit);
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 17379d8a152f..9ae8e60a0835 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -28,7 +26,6 @@
#include <hintids.hxx>
#include <svl/urihelper.hxx>
#include <svl/languageoptions.hxx>
-
#include <svx/svxids.hrc>
#include <sfx2/linkmgr.hxx>
#include <svx/htmlmode.hxx>
@@ -101,7 +98,6 @@
#include <crsskip.hxx>
#include <fmtinfmt.hxx>
#include <doc.hxx>
-
#include "swabstdlg.hxx"
#include "dialog.hrc"
#include "fldui.hrc"
@@ -111,13 +107,14 @@
#include <svx/fmshell.hxx> // for FN_XFORMS_DESIGN_MODE
#include <SwRewriter.hxx>
#include <comcore.hrc>
-
#include <unomid.h>
#include <svx/galleryitem.hxx>
#include <com/sun/star/gallery/GalleryItemType.hpp>
-FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END;
+//UUUU
+#include <svx/unobrushitemhelper.hxx>
+FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END;
//Fuer die Erkennung der Id, die variable von Gallery mit SID_GALLERY_BG_BRUSH
//ankommt.
@@ -2256,28 +2253,10 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet )
void SwBaseShell::GetBckColState(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
- SfxWhichIter aIter( rSet );
- sal_uInt16 nWhich = aIter.FirstWhich();
- int nSelType = rSh.GetSelectionType();
-
-// if ( nSelType & nsSelectionType::SEL_GRF ||
- if( nSelType & nsSelectionType::SEL_OLE )
- {
- rSet.DisableItem( SID_BACKGROUND_COLOR );
- return;
- }
-
- if ( nSelType & nsSelectionType::SEL_FRM )
- {
- sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
- if (bParentCntProt)
- {
- rSet.DisableItem( SID_BACKGROUND_COLOR );
- return;
- }
- }
-
- SvxBrushItem aBrushItem( RES_BACKGROUND );
+ SfxWhichIter aIter(rSet);
+ sal_uInt16 nWhich(aIter.FirstWhich());
+ int nSelType(rSh.GetSelectionType());
+ SvxBrushItem aBrushItem(RES_BACKGROUND);
if( nsSelectionType::SEL_TBL_CELLS & nSelType )
{
@@ -2285,54 +2264,41 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
}
else
{
- //UUUU
- if(nSelType & nsSelectionType::SEL_GRF)
- {
- SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
+ //UUUU Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
+ SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
- rSh.GetFlyFrmAttr( aCoreSet );
- aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
- }
- else if(nsSelectionType::SEL_FRM & nSelType)
- {
- SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
- const XFillStyleItem& rXFillStyleItem(static_cast< const XFillStyleItem& >(aCoreSet.Get(XATTR_FILLSTYLE)));
+ aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrmFmt()->GetAttrSet());
- if(XFILL_SOLID == rXFillStyleItem.GetValue())
- {
- const Color aFillColor(static_cast< const XFillColorItem& >(aCoreSet.Get(XATTR_FILLCOLOR)).GetColorValue());
-
- aBrushItem.SetColor(aFillColor);
- }
- else
- {
- // keep default in SvxBrushItem which equals no fill
- }
+ if(nSelType & nsSelectionType::SEL_GRF || nsSelectionType::SEL_FRM & nSelType)
+ {
+ rSh.GetFlyFrmAttr(aCoreSet);
}
else
{
- SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
-
- rSh.GetCurAttr( aCoreSet );
- aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
+ rSh.GetCurAttr(aCoreSet);
}
+
+ aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
}
- while ( nWhich )
+ while(nWhich)
{
switch(nWhich)
{
- case SID_BACKGROUND_COLOR :
+ case SID_BACKGROUND_COLOR:
{
- SvxColorItem aColorItem(aBrushItem.GetColor(), SID_BACKGROUND_COLOR);
- rSet.Put( aColorItem, SID_BACKGROUND_COLOR );
+ SvxColorItem aColorItem(aBrushItem.GetColor(),SID_BACKGROUND_COLOR);
+ rSet.Put(aColorItem,SID_BACKGROUND_COLOR);
+ break;
}
- break;
case SID_ATTR_BRUSH:
case RES_BACKGROUND:
- rSet.Put( aBrushItem, GetPool().GetWhich(nWhich) );
- break;
+ {
+ rSet.Put(aBrushItem,GetPool().GetWhich(nWhich));
+ break;
+ }
}
+
nWhich = aIter.NextWhich();
}
}
@@ -2344,18 +2310,16 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
void SwBaseShell::ExecBckCol(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
- int nSelType = rSh.GetSelectionType();
- if ( nSelType & nsSelectionType::SEL_OLE )
+ int nSelType(rSh.GetSelectionType());
+ const SfxItemSet* pArgs = rReq.GetArgs();
+ sal_uInt16 nSlot(rReq.GetSlot());
+
+ if(!pArgs && nSlot != SID_BACKGROUND_COLOR)
{
return;
}
- const SfxItemSet* pArgs = rReq.GetArgs();
- sal_uInt16 nSlot = rReq.GetSlot();
- if( !pArgs && nSlot != SID_BACKGROUND_COLOR)
- return ;
-
- SvxBrushItem aBrushItem( RES_BACKGROUND );
+ SvxBrushItem aBrushItem(RES_BACKGROUND);
if( nsSelectionType::SEL_TBL_CELLS & nSelType )
{
@@ -2363,129 +2327,98 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
}
else
{
- //UUUU
- if(nSelType & nsSelectionType::SEL_GRF)
- {
- SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
-
- rSh.GetFlyFrmAttr( aCoreSet );
- aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
- }
- else if(nsSelectionType::SEL_FRM & nSelType)
- {
- SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
- const XFillStyleItem& rXFillStyleItem(static_cast< const XFillStyleItem& >(aCoreSet.Get(XATTR_FILLSTYLE)));
+ //UUUU Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
+ SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
- if(XFILL_SOLID == rXFillStyleItem.GetValue())
- {
- const Color aFillColor(static_cast< const XFillColorItem& >(aCoreSet.Get(XATTR_FILLCOLOR)).GetColorValue());
+ aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrmFmt()->GetAttrSet());
- aBrushItem.SetColor(aFillColor);
- }
- else
- {
- // keep default in SvxBrushItem which equals no fill
- }
+ if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType))
+ {
+ rSh.GetFlyFrmAttr(aCoreSet);
}
else
{
- SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
-
- rSh.GetCurAttr( aCoreSet );
- aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
+ rSh.GetCurAttr(aCoreSet);
}
- }
-// sal_Bool bMsgOk = sal_False;
+ aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
+ }
- switch (nSlot)
+ switch(nSlot)
{
- // RES_BACKGROUND (=SID_ATTR_BRUSH) muss ueber zwei IDs
- // gesetzt werden:
case SID_BACKGROUND_COLOR:
- {
- aBrushItem.SetGraphicPos(GPOS_NONE);
+ {
+ aBrushItem.SetGraphicPos(GPOS_NONE);
- //Brush &rBrush = aBrushItem.GetBrush();
- if(pArgs)
- {
- const SvxColorItem& rNewColorItem = (const SvxColorItem&)
- pArgs->Get(SID_BACKGROUND_COLOR);
- const Color& rNewColor = rNewColorItem.GetValue();
- aBrushItem.SetColor( rNewColor );
- GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem);
- }
- else
- {
- aBrushItem.SetColor( COL_TRANSPARENT );
- rReq.AppendItem( SvxColorItem( Color( COL_TRANSPARENT ), nSlot ) );
- }
+ if(pArgs)
+ {
+ const SvxColorItem& rNewColorItem = (const SvxColorItem&)pArgs->Get(SID_BACKGROUND_COLOR);
+ const Color& rNewColor = rNewColorItem.GetValue();
+ aBrushItem.SetColor(rNewColor);
+ GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem);
+ }
+ else
+ {
+ aBrushItem.SetColor(COL_TRANSPARENT);
+ rReq.AppendItem(SvxColorItem(Color(COL_TRANSPARENT),nSlot));
}
break;
+ }
case SID_ATTR_BRUSH:
case RES_BACKGROUND:
{
- const SvxBrushItem& rNewBrushItem = (const SvxBrushItem&)
- pArgs->Get( GetPool().GetWhich(nSlot) );
+ const SvxBrushItem& rNewBrushItem = (const SvxBrushItem&)pArgs->Get(GetPool().GetWhich(nSlot));
aBrushItem = rNewBrushItem;
+ break;
}
- break;
default:
-// bMsgOk = sal_False;
+ {
rReq.Ignore();
- DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" );
+ DBG_ERROR("Unbekannte Message bei ExecuteAttr!");
return;
+ }
}
if( nsSelectionType::SEL_TBL_CELLS & nSelType )
{
rSh.SetBoxBackground( aBrushItem );
}
- //UUUU
- else if(nsSelectionType::SEL_GRF & nSelType)
- {
- SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
- aCoreSet.Put( aBrushItem );
- // Vorlagen-AutoUpdate
- SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
- if(pFmt && pFmt->IsAutoUpdateFmt())
- rSh.AutoUpdateFrame( pFmt, aCoreSet);
- else
- rSh.SetFlyFrmAttr( aCoreSet );
- }
- else if(nsSelectionType::SEL_FRM & nSelType)
+ else
{
+ //UUUU Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
- const XubString aNullStr;
-
- // set FillStyle and color when applying
- aCoreSet.Put(XFillStyleItem(XFILL_SOLID));
- aCoreSet.Put(XFillColorItem(aNullStr, aBrushItem.GetColor()));
- // Vorlagen-AutoUpdate
- SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
+ aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrmFmt()->GetAttrSet());
+ setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, aCoreSet);
- if(pFmt && pFmt->IsAutoUpdateFmt())
+ if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType))
{
- rSh.AutoUpdateFrame( pFmt, aCoreSet);
+ // Vorlagen-AutoUpdate
+ SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
+
+ if(pFmt && pFmt->IsAutoUpdateFmt())
+ {
+ rSh.AutoUpdateFrame(pFmt, aCoreSet);
+ }
+ else
+ {
+ rSh.SetFlyFrmAttr(aCoreSet);
+ }
}
else
{
- rSh.SetFlyFrmAttr( aCoreSet );
- }
- }
- else
- {
- SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
- if( pColl && pColl->IsAutoUpdateFmt())
- {
- SfxItemSet aSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND );
- aSet.Put(aBrushItem);
- rSh.AutoUpdatePara( pColl, aSet);
+ SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
+
+ if(pColl && pColl->IsAutoUpdateFmt())
+ {
+ rSh.AutoUpdatePara(pColl, aCoreSet);
+ }
+ else
+ {
+ rSh.SetAttrSet(aCoreSet);
+ }
}
- else
- rSh.SetAttrItem( aBrushItem );
}
rReq.Done();
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 7d183ccd1fcc..bea5ca19c6f7 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -19,12 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <tools/shl.hxx>
#include <hintids.hxx>
#include <helpid.h>
@@ -57,7 +54,6 @@
#include <svx/svdogrp.hxx>
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
-
#include <shells.hrc>
#define SwDrawBaseShell
#include <sfx2/msg.hxx>
@@ -70,9 +66,9 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
-
#include <IDocumentDrawModelAccess.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
@@ -647,7 +643,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
else
{
nRet = 1;
- SdrModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel();
// --> OD 2006-03-09 #i51726# - all drawing objects can be named now.
// consider also drawing objects inside group objects
// SdrPage* pPage = pModel->GetPage(0);
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index 0fbf9789852d..e40201385c3e 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -654,7 +654,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
rSet.DisableItem( SID_THES );
- //! avoid puting the same item as SfxBoolItem at the end of this function
+ //! avoid putting the same item as SfxBoolItem at the end of this function
nSlotId = 0;
break;
}
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 8621be134bcd..b9f9587b764b 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -76,10 +76,10 @@
#include "swabstdlg.hxx"
#include "misc.hrc"
#include <svx/dialogs.hrc>
-
#include <docsh.hxx>
#include <svx/drawitem.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -441,18 +441,16 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SID_HTML_MODE, SID_HTML_MODE, // [10414
FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, // [21032
FN_SURROUND, FN_HORI_ORIENT, // [21303
- FN_SET_FRM_NAME, FN_SET_FRM_NAME, // [21306
- FN_KEEP_ASPECT_RATIO, FN_KEEP_ASPECT_RATIO, // [21307
+ FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, // [21306
FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, // [21318
- FN_OLE_IS_MATH, FN_OLE_IS_MATH, // [22314
- FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT, // [22315
+ FN_OLE_IS_MATH, FN_MATH_BASELINE_ALIGNMENT, // [22314
FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT, // [22420
0);
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
- const SdrModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel();
+ const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel();
aSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
aSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 2ec894b605e4..2ecdeda8360b 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -19,17 +19,10 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <hintids.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
@@ -38,7 +31,6 @@
#include <svl/urihelper.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/dispatch.hxx>
-
#include <sfx2/objface.hxx>
#include <editeng/sizeitem.hxx>
#include <editeng/protitem.hxx>
@@ -74,12 +66,14 @@
#include <swwait.hxx>
#include <shells.hrc>
#include <popup.hrc>
-
+#include <doc.hxx>
+#include <docsh.hxx>
+#include <svx/drawitem.hxx>
#define SwGrfShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
-
#include "swabstdlg.hxx"
+#include <drawdoc.hxx>
#define TOOLBOX_NAME ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "colorbar" ) )
@@ -128,22 +122,41 @@ void SwGrfShell::Execute(SfxRequest &rReq)
const SwViewOption* pVOpt = rSh.GetViewOptions();
SwViewOption aUsrPref( *pVOpt );
- SfxItemSet aSet(GetPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1,
- RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF,
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
- SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM,
- SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_FRMSIZE,
- SID_ATTR_GRAF_FRMSIZE_PERCENT, SID_ATTR_GRAF_FRMSIZE_PERCENT,
- SID_ATTR_GRAF_GRAPHIC, SID_ATTR_GRAF_GRAPHIC,
- FN_PARAM_GRF_CONNECT, FN_PARAM_GRF_CONNECT,
- SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- FN_GET_PRINT_AREA, FN_GET_PRINT_AREA,
- FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO,
- FN_PARAM_GRF_DIALOG, FN_PARAM_GRF_DIALOG,
- SID_DOCFRAME, SID_DOCFRAME,
- SID_HTML_MODE, SID_HTML_MODE,
- FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME,
- 0);
+ SfxItemSet aSet(GetPool(), //UUUU sorted by indices
+
+ RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [ 82
+ RES_GRFATR_MIRRORGRF,RES_GRFATR_CROPGRF, // [ 123
+
+ //UUUU FillAttribute support
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // [ 1014
+
+ SID_DOCFRAME,SID_DOCFRAME, // [ 5598
+ SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
+ SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
+ SID_ATTR_GRAF_KEEP_ZOOM,SID_ATTR_GRAF_KEEP_ZOOM, // [10882
+ SID_ATTR_GRAF_FRMSIZE,SID_ATTR_GRAF_GRAPHIC, // [10884, contains SID_ATTR_GRAF_FRMSIZE_PERCENT
+
+ //UUUU items to hand over XPropertyList things like
+ // XColorList, XHatchList, XGradientList and XBitmapList
+ // to the Area TabPage
+ SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179
+
+ SID_HTML_MODE,SID_HTML_MODE, // [10414
+ FN_GET_PRINT_AREA,FN_GET_PRINT_AREA, // [21032
+ FN_PARAM_GRF_CONNECT,FN_PARAM_GRF_CONNECT, // [21153
+ FN_PARAM_GRF_DIALOG,FN_PARAM_GRF_DIALOG, // [21171
+ FN_SET_FRM_NAME,FN_KEEP_ASPECT_RATIO, // [21306
+ FN_SET_FRM_ALT_NAME,FN_SET_FRM_ALT_NAME, // [21318
+ 0);
+
+ //UUUU create needed items for XPropertyList entries from the DrawModel so that
+ // the Area TabPage can access them
+ const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel();
+
+ aSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
+ aSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
+ aSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
+ aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx
index 2bd91838b3a2..521c92d552fb 100644
--- a/sw/source/ui/shells/grfshex.cxx
+++ b/sw/source/ui/shells/grfshex.cxx
@@ -19,12 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <docary.hxx>
#include <grfsh.hxx>
#include <wrtsh.hxx>
@@ -52,7 +49,6 @@
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
#include <poolfmt.hrc>
-
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/stritem.hxx>
@@ -60,11 +56,9 @@
#include <vcl/svapp.hxx>
#include <doc.hxx>
#include <svx/fmmodel.hxx>
-
-// -> #111827#
#include <SwRewriter.hxx>
#include <comcore.hrc>
-// <- #111827#
+#include <drawdoc.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ui::dialogs;
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 0ea6c9181b5c..ddf3e1609567 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -19,20 +19,16 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-
#include <comphelper/processfactory.hxx>
#include <svx/dialogs.hrc>
#include <hintids.hxx>
#include <cmdid.h>
#include <helpid.h>
-
#include <i18npool/mslangid.hxx>
#include <svl/languageoptions.hxx>
#include <editeng/langitem.hxx>
@@ -91,7 +87,6 @@
#include <edtwin.hxx>
#include <redlndlg.hxx>
#include "fldmgr.hxx"
-
#include <globals.hrc>
#include <shells.hrc>
#include <app.hrc>
@@ -102,15 +97,12 @@
#include <vcl/svapp.hxx>
#include <sfx2/app.hxx>
#include <breakit.hxx>
-
#include <SwSmartTagMgr.hxx>
-
#include <editeng/acorrcfg.hxx>
#include "swabstdlg.hxx"
#include "misc.hrc"
#include "chrdlg.hrc"
#include <IDocumentStatistics.hxx>
-
#include <sfx2/sfxdlg.hxx>
#include <svl/languageoptions.hxx>
#include <unotools/lingucfg.hxx>
@@ -125,22 +117,16 @@
#include <pam.hxx>
#include <sfx2/objface.hxx>
#include <langhelper.hxx>
-
-#ifndef _NBDTMGFACT_HXX
#include <svx/nbdtmgfact.hxx>
-#endif
-#ifndef _NBDTMG_HXX
#include <svx/nbdtmg.hxx>
-#endif
-
-
+#include <svx/svdmodel.hxx>
+#include <svx/drawitem.hxx>
#include <numrule.hxx>
-
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace svx::sidebar;
-
void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq )
{
FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &rWrtSh.GetView()));
@@ -896,27 +882,45 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
- SfxItemSet aCoreSet( GetPool(),
- RES_PARATR_BEGIN, RES_PARATR_END - 1,
- // --> OD 2008-02-25 #refactorlists#
- RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
- // <--
- RES_FRMATR_BEGIN, RES_FRMATR_END - 1,
- SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS,
- SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_DEFAULTS,
- SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET,
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
- SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
- SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,
- SID_HTML_MODE, SID_HTML_MODE,
- FN_PARAM_1, FN_PARAM_1,
- FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT,
- FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME,
+ SfxItemSet aCoreSet( GetPool(), //UUUU sorted by indices, one group of three concatenated
+ RES_PARATR_BEGIN, RES_PARATR_END - 1, // [60
+ RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, // [77
+ RES_FRMATR_BEGIN, RES_FRMATR_END - 1, // [82
+
+ //UUUU FillAttribute support
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014
+
+ // includes SID_ATTR_TABSTOP_POS
+ SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_OFFSET, // [10003 .. 10005
+
+ SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, // [10023
+ SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP, // [10065
+
+ //UUUU items to hand over XPropertyList things like
+ // XColorList, XHatchList, XGradientList and XBitmapList
+ // to the Area TabPage
+ SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179
+
+ SID_HTML_MODE, SID_HTML_MODE, // [10414
+ SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, // [10457
+ FN_PARAM_1, FN_PARAM_1, // [21160
+ FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, // [21738
+ FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME, // [22418
0);
- // --> OD 2008-01-16 #newlistlevelattrs#
+
// get also the list level indent values merged as LR-SPACE item, if needed.
rWrtSh.GetCurAttr( aCoreSet, true );
- // <--
+
+ //UUUU create needed items for XPropertyList entries from the DrawModel so that
+ // the Area TabPage can access them
+ // Do this after GetCurAttr, this resets the ItemSet content again
+ const SwDrawModel* pDrawModel = GetView().GetDocShell()->GetDoc()->GetDrawModel();
+
+ aCoreSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
+ aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
+ aCoreSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
+ aCoreSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
+
aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE,
::GetHtmlMode(GetView().GetDocShell())));
diff --git a/sw/source/ui/sidebar/WrapPropertyPanel.hxx b/sw/source/ui/sidebar/WrapPropertyPanel.hxx
index 292cb1e22d6b..cac77ade11ce 100644
--- a/sw/source/ui/sidebar/WrapPropertyPanel.hxx
+++ b/sw/source/ui/sidebar/WrapPropertyPanel.hxx
@@ -72,7 +72,7 @@ namespace sw { namespace sidebar {
ImageList aWrapIL;
ImageList aWrapILH;
- //Controler Items==================================
+ //Controller Items==================================
::sfx2::sidebar::ControllerItem maSwNoWrapControl;
::sfx2::sidebar::ControllerItem maSwWrapLeftControl;
::sfx2::sidebar::ControllerItem maSwWrapRightControl;
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 11988add957f..246b5543e8fe 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -2105,7 +2105,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible >
SwPagePreViewWin::CreateAccessible()
{
vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
- // happend already!!!
+ // happened already!!!
DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" );
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc = GetAccessible( sal_False );
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index d0e6a373bfd1..646dc91ef60b 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1682,10 +1682,11 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
//#i76332# if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode
if( !bReadonly )
{
- SwDrawDocument * pDrawDoc = 0;
- if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (GetDocShell()->GetDoc()->GetDrawModel() ) ) )
+ SwDrawModel* pDrawModel = 0;
+
+ if ( 0 != ( pDrawModel = GetDocShell()->GetDoc()->GetDrawModel() ) )
{
- if( !pDrawDoc->GetOpenInDesignMode() )
+ if( !pDrawModel->GetOpenInDesignMode() )
break;// don't touch the design mode
}
}
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index dd4eab5a9455..c437d0992030 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1013,7 +1013,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
//GetViewFrame()->ShowChildWindow(nSlot, bShow && bInMailMerge);
if((bShow && bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot))
GetViewFrame()->ToggleChildWindow(nSlot);
- //if fields have been succesfully inserted call the "real"
+ //if fields have been successfully inserted call the "real"
//mail merge dialog
SwWrtShell &rSh = GetWrtShell();
if(bInMailMerge && rSh.IsAnyDatabaseFieldInDoc())
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 5e6c8128b597..6ec26419a25e 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -714,7 +714,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
{
//Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist.
// JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
- // so we dont must do it agin.
+ // so we dont must do it again.
EndScrollHdl(pScrollbar);
if ( Help::IsQuickHelpEnabled() &&
@@ -730,7 +730,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
if(pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay ))
{
// JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
- // so we dont must do it agin.
+ // so we dont must do it again.
// if(!GetViewFrame()->GetFrame().IsInPlace())
// S F X_BINDINGS().Update(FN_STAT_PAGE);
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index aee1ca50f096..6a86182e04d7 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -30,7 +28,6 @@
#include <svl/aeitem.hxx>
#include <svl/whiter.hxx>
#include <svl/cjkoptions.hxx>
-
#include <sfx2/viewfrm.hxx>
#include <sfx2/objitem.hxx>
#include <svl/imageitm.hxx>
@@ -58,11 +55,12 @@
#include <svl/stritem.hxx>
#include <unotools/moduleoptions.hxx>
#include <svl/visitem.hxx>
-
#include <cmdid.h>
-
#include <IDocumentRedlineAccess.hxx>
+//UUUU
+#include <doc.hxx>
+
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
@@ -144,6 +142,15 @@ void SwView::GetState(SfxItemSet &rSet)
{
const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc();
const SwPageDesc& rDesc = pWrtShell->GetPageDesc( nCurIdx );
+
+ //UUUU set correct parent to get the XFILL_NONE FillStyle as needed
+ if(!rSet.GetParent())
+ {
+ const SwFrmFmt& rMaster = rDesc.GetMaster();
+
+ rSet.SetParent(&rMaster.GetDoc()->GetDfltFrmFmt()->GetAttrSet());
+ }
+
::PageDescToItemSet( rDesc, rSet);
}
break;
diff --git a/sw/source/ui/uno/unodefaults.cxx b/sw/source/ui/uno/unodefaults.cxx
index da4913d9acd9..10b5cc96d2e5 100644
--- a/sw/source/ui/uno/unodefaults.cxx
+++ b/sw/source/ui/uno/unodefaults.cxx
@@ -19,17 +19,15 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <unodefaults.hxx>
#include <svx/svdmodel.hxx>
#include <svx/unoprov.hxx>
#include <doc.hxx>
#include <svx/fmmodel.hxx>
+#include <drawdoc.hxx>
/* -----------------------------13.03.01 14:16--------------------------------
diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx
index 732f32ddc5e4..6f2b765d5f54 100644
--- a/sw/source/ui/uno/unodispatch.cxx
+++ b/sw/source/ui/uno/unodispatch.cxx
@@ -60,7 +60,7 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) :
m_refCount++;
m_xIntercepted->registerDispatchProviderInterceptor((frame::XDispatchProviderInterceptor*)this);
// this should make us the top-level dispatch-provider for the component, via a call to our
- // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fullfill
+ // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fulfill
uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY);
if (xInterceptedComponent.is())
xInterceptedComponent->addEventListener((lang::XEventListener*)this);
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 77740e822081..bb0d92981621 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -111,7 +111,7 @@ osl::Mutex & GetMailMergeMutex()
enum CloseResult
{
eSuccess, // successfully closed
- eVetoed, // vetoed, ownership transfered to the vetoing instance
+ eVetoed, // vetoed, ownership transferred to the vetoing instance
eFailed // failed for some unknown reason
};
static CloseResult CloseModelAndDocSh(
@@ -279,7 +279,7 @@ namespace
try
{
sal_Bool bDeliverOwnership = ( 0 == m_nPendingDeleteAttempts );
- // if this is our last attemt, then anybody which vetoes this has to take the consequences
+ // if this is our last attempt, then anybody which vetoes this has to take the consequences
// (means take the ownership)
m_xDocument->close( bDeliverOwnership );
bSuccess = sal_True;
@@ -448,7 +448,7 @@ SwXMailMerge::~SwXMailMerge()
//! because there is no automatism that will do that later.
//! #120086#
if ( eVetoed == CloseModelAndDocSh( xModel, xDocSh ) )
- DBG_WARNING( "owner ship transfered to vetoing object!" );
+ DBG_WARNING( "owner ship transferred to vetoing object!" );
xModel = 0;
xDocSh = 0; // destroy doc shell
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 408d6b1a44f3..9aa3cf421152 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1258,7 +1258,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
OUString sFileURL;
if ( (rProp.Value >>= sFileURL ) )
{
- // Convert the File URL into a system dependant path, as the SalPrinter expects
+ // Convert the File URL into a system dependent path, as the SalPrinter expects
OUString sSystemPath;
FileBase::getSystemPathFromFileURL ( sFileURL, sSystemPath );
aReq.AppendItem(SfxStringItem( SID_FILE_NAME, sSystemPath ) );
@@ -2093,11 +2093,13 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
break;
case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
{
- SwDrawDocument * pDrawDoc;
+ SwDrawModel* pDrawModel = 0;
sal_Bool bAuto = *(sal_Bool*) aValue.getValue();
- if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * >( pDocShell->GetDoc()->GetDrawModel() ) ) )
- pDrawDoc->SetAutoControlFocus( bAuto );
+ if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) )
+ {
+ pDrawModel->SetAutoControlFocus( bAuto );
+ }
else if (bAuto)
{
// if setting to true, and we don't have an
@@ -2106,19 +2108,21 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
// SdrModel and we are leaving the default at false,
// we don't need to make an SdrModel and can do nothing
// --> OD 2005-08-08 #i52858# - method name changed
- pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() );
+ pDrawModel = pDocShell->GetDoc()->GetOrCreateDrawModel();
// <--
- pDrawDoc->SetAutoControlFocus ( bAuto );
+ pDrawModel->SetAutoControlFocus ( bAuto );
}
}
break;
case WID_DOC_APPLY_FORM_DESIGN_MODE:
{
- SwDrawDocument * pDrawDoc;
+ SwDrawModel* pDrawModel = 0;
sal_Bool bMode = *(sal_Bool*)aValue.getValue();
- if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
- pDrawDoc->SetOpenInDesignMode( bMode );
+ if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) )
+ {
+ pDrawModel->SetOpenInDesignMode( bMode );
+ }
else if (!bMode)
{
// if setting to false, and we don't have an
@@ -2128,9 +2132,9 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
// we don't need to make an SdrModel and can do
// nothing
// --> OD 2005-08-08 #i52858# - method name changed
- pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() );
+ pDrawModel = pDocShell->GetDoc()->GetOrCreateDrawModel();
// <--
- pDrawDoc->SetOpenInDesignMode ( bMode );
+ pDrawModel->SetOpenInDesignMode ( bMode );
}
}
break;
@@ -2273,23 +2277,35 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
break;
case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
{
- SwDrawDocument * pDrawDoc;
- sal_Bool bAuto;
- if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
- bAuto = pDrawDoc->GetAutoControlFocus();
+ SwDrawModel* pDrawModel = 0;
+ sal_Bool bAuto(sal_False);
+
+ if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) )
+ {
+ bAuto = pDrawModel->GetAutoControlFocus();
+ }
else
+ {
bAuto = sal_False;
+ }
+
aAny.setValue(&bAuto, ::getBooleanCppuType());
}
break;
case WID_DOC_APPLY_FORM_DESIGN_MODE:
{
- SwDrawDocument * pDrawDoc;
- sal_Bool bMode;
- if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) )
- bMode = pDrawDoc->GetOpenInDesignMode();
+ SwDrawModel* pDrawModel = 0;
+ sal_Bool bMode(sal_False);
+
+ if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) )
+ {
+ bMode = pDrawModel->GetOpenInDesignMode();
+ }
else
+ {
bMode = sal_True;
+ }
+
aAny.setValue(&bMode, ::getBooleanCppuType());
}
break;
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index abd5759f9c44..913aca6ca15d 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -85,22 +83,16 @@
#include <numrule.hxx>
#include <swundo.hxx>
#include <ndtxt.hxx>
-//#include <ndgrf.hxx>
#include <fmtcntnt.hxx>
#include <PostItMgr.hxx>
-//#include <../../core/inc/flyfrm.hxx>
-//#include <../../core/inc/cntfrm.hxx>
-//#include <ndnotxt.hxx>
-//#include <postit.hxx>
#include <postithelper.hxx>
#include <redline.hxx>
#include <docary.hxx>
-
#include "swabstdlg.hxx"
#include "globals.hrc"
#include <unomid.h>
#include <svx/fmmodel.hxx>
-
+#include <drawdoc.hxx>
#define CTYPE_CNT 0
#define CTYPE_CTT 1
@@ -447,7 +439,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
{
sTypeToken = aEmptyStr;
nMemberCount = 0;
- SdrModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel();
if(pModel)
{
SdrPage* pPage = pModel->GetPage(0);
@@ -816,7 +808,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
pMember->DeleteAndDestroy(0, pMember->Count());
IDocumentDrawModelAccess* pIDDMA = pWrtShell->getIDocumentDrawModelAccess();
- SdrModel* pModel = pIDDMA->GetDrawModel();
+ SwDrawModel* pModel = pIDDMA->GetDrawModel();
if(pModel)
{
SdrPage* pPage = pModel->GetPage(0);
@@ -956,7 +948,7 @@ String SwContentTree::GetEntryAltText( SvLBoxEntry* pEntry ) const
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
- SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
const sal_uInt32 nCount = pPage->GetObjCount();
for( sal_uInt32 i=0; i< nCount; i++ )
@@ -1034,7 +1026,7 @@ String SwContentTree::GetEntryLongDescription( SvLBoxEntry* pEntry ) const
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
- SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
for( sal_uInt32 i=0; i< nCount; i++ )
@@ -1400,7 +1392,7 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
- SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
@@ -2681,7 +2673,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
{
pDrawView->SdrEndTextEdit();//Change from "EndTextEdit" to "SdrEndTextEdit" for acc migration
- SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
sal_Bool hasObjectMarked = sal_False;
@@ -3381,7 +3373,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
{
pDrawView->SdrEndTextEdit();
pDrawView->UnmarkAll();
- SdrModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel();
SdrPage* pPage = _pModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
for( sal_uInt32 i=0; i< nCount; i++ )
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 869a48a521ae..050e57b3bf27 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -803,6 +803,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
aContentToolBox.SetHelpId(HID_NAVIGATOR_TOOLBOX );
aGlobalToolBox.SetHelpId(HID_NAVIGATOR_GLOBAL_TOOLBOX);
aDocListBox.SetHelpId(HID_NAVIGATOR_LISTBOX );
+ aDocListBox.SetDropDownLineCount(9);
nDocLBIniHeight = aDocListBox.GetSizePixel().Height();
nZoomOutInit = nZoomOut = Resource::ReadShortRes();
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 78a2d381d097..4db50c999776 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -385,12 +385,19 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
// HeaderInfo, Raender, Hintergrund, Umrandung
//
- SfxItemSet aHeaderSet( *rSet.GetPool(),
- SID_ATTR_PAGE_ON, SID_ATTR_PAGE_SHARED,
- SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
- RES_FRMATR_BEGIN, RES_FRMATR_END-1,
- 0);
+ SfxItemSet aHeaderSet(*rSet.GetPool(),
+ RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82
+
+ //UUUU FillAttribute support
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014
+
+ SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
+ SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
+ SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
+ 0, 0);
+
+ //UUUU set correct parent to get the XFILL_NONE FillStyle as needed
+ aHeaderSet.SetParent(&rMaster.GetDoc()->GetDfltFrmFmt()->GetAttrSet());
// dynamische oder feste Hoehe
//
@@ -431,12 +438,19 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
// FooterInfo, Raender, Hintergrund, Umrandung
//
- SfxItemSet aFooterSet( *rSet.GetPool(),
- SID_ATTR_PAGE_ON, SID_ATTR_PAGE_SHARED,
- SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
- RES_FRMATR_BEGIN, RES_FRMATR_END-1,
- 0);
+ SfxItemSet aFooterSet(*rSet.GetPool(),
+ RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82
+
+ //UUUU FillAttribute support
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014
+
+ SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
+ SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
+ SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
+ 0, 0);
+
+ //UUUU set correct parent to get the XFILL_NONE FillStyle as needed
+ aFooterSet.SetParent(&rMaster.GetDoc()->GetDfltFrmFmt()->GetAttrSet());
// dynamische oder feste Hoehe
//
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 574decb055d0..60be62e7de97 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -65,7 +65,7 @@ static sal_Bool bStartDrag = sal_False;
void SwWrtShell::Invalidate()
{
- // to avoid making the slot volatile, invalidate it everytime if something could have been changed
+ // to avoid making the slot volatile, invalidate it every time if something could have been changed
// this is still much cheaper than asking for the state every 200 ms (and avoid background processing)
GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE );
}
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 00ccaf63b9af..4ad98e910a1c 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -100,7 +100,10 @@ void SwWrtShell::Insert( SwField& rFld )
GetTblCrs()->Normalize( sal_False );
const SwPosition rStartPos( *(GetTblCrs()->GetMark()->nNode.GetNode().GetCntntNode()), 0 );
KillPams();
- EndPara();
+ if ( !IsEndOfPara() )
+ {
+ EndPara();
+ }
const SwPosition rEndPos( *GetCurrentShellCursor().GetPoint() );
pAnnotationTextRange = new SwPaM( rStartPos, rEndPos );
}