summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-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
112 files changed, 3996 insertions, 3001 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;