diff options
84 files changed, 1244 insertions, 527 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 20af2f38b3ee..0f7e233cde87 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -396,9 +396,9 @@ void SmFontDialog::InitColor_Impl() #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - if (GetDisplayBackground().GetColor().IsDark()) + const StyleSettings &rS = GetSettings().GetStyleSettings(); + if (rS.GetHighContrastMode()) { - const StyleSettings &rS = GetSettings().GetStyleSettings(); nBgCol = rS.GetFieldColor().GetColor(); nTxtCol = rS.GetFieldTextColor().GetColor(); } @@ -967,7 +967,7 @@ SmDistanceDialog::~SmDistanceDialog() void SmDistanceDialog::ApplyImages() { - BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + BOOL bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); for (int i = 0; i < NOCATEGORIES; ++i) { SmCategoryDesc *pCat = Categories[i]; @@ -1551,9 +1551,9 @@ void SmSymbolDialog::InitColor_Impl() #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - if (GetDisplayBackground().GetColor().IsDark()) + const StyleSettings &rS = GetSettings().GetStyleSettings(); + if (rS.GetHighContrastMode()) { - const StyleSettings &rS = GetSettings().GetStyleSettings(); nBgCol = rS.GetFieldColor().GetColor(); nTxtCol = rS.GetFieldTextColor().GetColor(); } @@ -2180,7 +2180,7 @@ void SmSymDefineDialog::InitColor_Impl() #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + BOOL bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); if (bHighContrast) { const StyleSettings &rS = GetSettings().GetStyleSettings(); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index ab467fc034e3..03beb26f7bb2 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -467,7 +467,7 @@ void SmDocShell::Draw(OutputDevice &rDev, Point &rPosition) ULONG nOldDrawMode = DRAWMODE_DEFAULT; BOOL bRestoreDrawMode = FALSE; if (OUTDEV_WINDOW == rDev.GetOutDevType() && - ((Window &) rDev).GetDisplayBackground().GetColor().IsDark()) + ((Window &) rDev).GetSettings().GetStyleSettings().GetHighContrastMode()) { nOldDrawMode = rDev.GetDrawMode(); rDev.SetDrawMode( DRAWMODE_DEFAULT ); diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx index 487bd6155fc9..0c108967e0c1 100644 --- a/starmath/source/toolbox.cxx +++ b/starmath/source/toolbox.cxx @@ -222,7 +222,7 @@ const ImageList * SmToolBoxWindow::GetImageList( USHORT nResId, BOOL bHighContra void SmToolBoxWindow::ApplyImageLists( USHORT nCategoryRID ) { - BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + BOOL bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); // set image list for toolbox 'catalog' const ImageList *pImageList = GetImageList( bHighContrast ? RID_ILH_CATALOG : RID_IL_CATALOG, bHighContrast ); diff --git a/sw/inc/IDocumentExternalData.hxx b/sw/inc/IDocumentExternalData.hxx new file mode 100644 index 000000000000..d84c07a677d4 --- /dev/null +++ b/sw/inc/IDocumentExternalData.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision:$ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_I_DOCUMENT_EXTERNAL_DATA_HXX +#define INCLUDED_I_DOCUMENT_EXTERNAL_DATA_HXX + +#include <hash_map> +#include <boost/shared_ptr.hpp> + +namespace sw +{ +enum tExternalDataType { FIB, STTBF_ASSOC }; + +struct ExternalDataTypeHash +{ + size_t operator()(tExternalDataType eType) const { return eType; } +}; + +class ExternalData +{ +public: + ExternalData() {} + virtual ~ExternalData() {} +}; + +typedef ::boost::shared_ptr<ExternalData> tExternalDataPointer; +} + + +class IDocumentExternalData +{ +protected: + typedef ::std::hash_map<sw::tExternalDataType, sw::tExternalDataPointer, sw::ExternalDataTypeHash> + tExternalData; + + tExternalData m_externalData; + + virtual ~IDocumentExternalData() {}; + +public: + virtual void setExternalData(sw::tExternalDataType eType, + sw::tExternalDataPointer pPayload) = 0; + virtual sw::tExternalDataPointer getExternalData(sw::tExternalDataType eType) = 0; +}; + +#endif //INCLUDED_I_DOCUMENT_EXTERNAL_DATA_HXX diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx index 635141a1bdc5..7d8d9ca4a5a3 100644 --- a/sw/inc/dbgoutsw.hxx +++ b/sw/inc/dbgoutsw.hxx @@ -35,6 +35,11 @@ #include <hash_map> #include <tox.hxx> class String; + +namespace rtl +{ +class OUString; +} class SwNode; class SwTxtAttr; class SwpHints; @@ -69,6 +74,7 @@ extern bool bDbgOutPrintAttrSet; SW_DLLPUBLIC const char * dbg_out(const void * pVoid); SW_DLLPUBLIC const char * dbg_out(const String & aStr); +SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr); SW_DLLPUBLIC const char * dbg_out(const SwRect & rRect); SW_DLLPUBLIC const char * dbg_out(const SwFrmFmt & rFrmFmt); SW_DLLPUBLIC const char * dbg_out(const SwNode & rNode); diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 30faa66f13e1..de82d9056ff9 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -58,6 +58,7 @@ #include <IDocumentListsAccess.hxx> class SwList; // <-- +#include <IDocumentExternalData.hxx> #define _SVSTDARR_STRINGSDTOR #include <svtools/svstdarr.hxx> #include <com/sun/star/embed/XEmbeddedObject.hpp> @@ -271,8 +272,9 @@ class SW_DLLPUBLIC SwDoc : public IDocumentOutlineNodes, // <-- // --> OD 2008-03-12 #refactorlists# - public IDocumentListsAccess + public IDocumentListsAccess, // <-- + public IDocumentExternalData { friend void _InitCore(); @@ -1046,6 +1048,12 @@ public: const String sNewListStyleName ); // <-- + /** IDocumentExternalData */ + virtual void setExternalData(::sw::tExternalDataType eType, + ::sw::tExternalDataPointer pPayload); + virtual ::sw::tExternalDataPointer getExternalData(::sw::tExternalDataType eType); + + /** INextInterface here */ diff --git a/sw/inc/docstat.hxx b/sw/inc/docstat.hxx index 9e03f57d5a97..4575796440bf 100644 --- a/sw/inc/docstat.hxx +++ b/sw/inc/docstat.hxx @@ -33,12 +33,6 @@ #include <tools/solar.h> #include "swdllapi.h" -/////////////////////////////////////////////////////////////////////////// -// PRODUCT: struct SwInternStat ist nur fuer CORE Interne Statistics und -// hat nichts in einer ProductVersion zu suchen. -/////////////////////////////////////////////////////////////////////////// - -struct SwInternStat; struct SW_DLLPUBLIC SwDocStat { @@ -46,11 +40,14 @@ struct SW_DLLPUBLIC SwDocStat USHORT nGrf; USHORT nOLE; ULONG nPage; + /// paragraphs for document statistic: non-empty and non-hidden ones ULONG nPara; + /// all paragraphs, including empty/hidden ones + ULONG nAllPara; ULONG nWord; ULONG nChar; BOOL bModified; - SwInternStat* pInternStat; + SwDocStat(); void Reset(); }; diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 88c4e650cfd0..f3e41abf199f 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -548,6 +548,8 @@ public: const OutlinerParaObject* GetTextObject() const; void SetTextObject( OutlinerParaObject* pText ); + sal_uInt32 GetNumberOfParagraphs() const; + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const; virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich ); virtual String GetDescription() const; diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 3f2bdf6f07ae..1dc28e197107 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -112,23 +112,33 @@ enum RES_TXTATR { RES_TXTATR_BEGIN = RES_CHRATR_END, -// alle TextAttribute mit einem Ende -// JP 12.07.96: die Ids RES_TXTATR_NOLINEBREAK und RES_TXTATR_NOHYPHEN -// wanderten in den Bereich der CharAttr. Die Ids selbst muessen -// aber als Dummies noch erhalten bleiben. Der SwG-/Sw3 Reader -// merkt sich die Ids immer als Offset zum Start der Gruppe!!! -// Aus dem RES_TXTATR_NOLINEBREAK ist jetzt RES_TXTATR_INETFMT geworden. +/** text attributes with start and end. + #i105453#: + Hints (SwTxtAttr) with the same start and end position are sorted by + WhichId, i.e., the TXTATR constants defined here. + The text formatting (SwAttrIter) poses some requirements on TXTATR order: + - AUTOFMT must precede CHARFMT, so that auto style can overwrite char style. + - INETFMT must precede CHARFMT, so that link style can overwrite char style. + (this is actually surprising: CHARFMT hints are not split at INETFMT + hints on insertion, but on exporting to ODF. if CHARFMT would precede + INETFMT, then exporting and importing will effectively change precedence) + + Nesting hints (SwTxtAttrNesting) also have requirements on TXTATR order, + to ensure proper nesting (because CJK_RUBY and INETFMT have no CH_TXTATR): + - INETFMT should precede CJK_RUBY (for UNO API it does not matter...) + - META and METAFIELD must precede CJK_RUBY and INETFMT + */ RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BEGIN , - RES_TXTATR_AUTOFMT = RES_TXTATR_WITHEND_BEGIN, // 41 - RES_TXTATR_INETFMT, // 42 - RES_TXTATR_REFMARK, // 43 - RES_TXTATR_TOXMARK, // 44 - RES_TXTATR_CHARFMT, // 45 - RES_TXTATR_DUMMY5, // 46 - RES_TXTATR_CJK_RUBY, // 47 - RES_TXTATR_UNKNOWN_CONTAINER, // 48 - RES_TXTATR_META, // 49 - RES_TXTATR_METAFIELD, // 50 + RES_TXTATR_REFMARK = RES_TXTATR_WITHEND_BEGIN, // 41 + RES_TXTATR_TOXMARK, // 42 + RES_TXTATR_META, // 43 + RES_TXTATR_METAFIELD, // 44 + RES_TXTATR_AUTOFMT, // 45 + RES_TXTATR_INETFMT, // 46 + RES_TXTATR_CHARFMT, // 47 + RES_TXTATR_CJK_RUBY, // 48 + RES_TXTATR_UNKNOWN_CONTAINER, // 49 + RES_TXTATR_DUMMY5, // 50 RES_TXTATR_WITHEND_END, // alle TextAttribute ohne ein Ende diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx index fc6d0238820e..c5ded7255c49 100644 --- a/sw/inc/swrect.hxx +++ b/sw/inc/swrect.hxx @@ -35,10 +35,8 @@ class SvStream; class SwRect { - long nX; - long nY; - long nWidth; - long nHeight; + Point m_Point; + Size m_Size; public: @@ -177,137 +175,133 @@ typedef void (SwRect:: *SwRectSetPos)( const Point& ); //---------------------------------- Set-Methoden inline void SwRect::Chg( const Point& rNP, const Size &rNS ) { - nX = rNP.X(); nY = rNP.Y(); - nWidth = rNS.Width(); nHeight = rNS.Height(); + m_Point = rNP; + m_Size = rNS; } inline void SwRect::Pos( const Point& rNew ) { - nX = rNew.X(); nY = rNew.Y(); + m_Point = rNew; } inline void SwRect::Pos( const long nNewX, const long nNewY ) { - nX = nNewX; nY = nNewY; + m_Point.setX(nNewX); + m_Point.setY(nNewY); } inline void SwRect::SSize( const Size& rNew ) { - nWidth = rNew.Width(); nHeight = rNew.Height(); + m_Size = rNew; } inline void SwRect::SSize( const long nNewHeight, const long nNewWidth ) { - nWidth = nNewWidth; nHeight = nNewHeight; + m_Size.setWidth(nNewWidth); + m_Size.setHeight(nNewHeight); } inline void SwRect::Width( long nNew ) { - nWidth = nNew; + m_Size.setWidth(nNew); } inline void SwRect::Height( long nNew ) { - nHeight = nNew; + m_Size.setHeight(nNew); } inline void SwRect::Left( const long nLeft ) { - nWidth += nX - nLeft; - nX = nLeft; + m_Size.Width() += m_Point.getX() - nLeft; + m_Point.setX(nLeft); } inline void SwRect::Right( const long nRight ) { - nWidth = nRight - nX + 1; + m_Size.setWidth(nRight - m_Point.getX() + 1); } inline void SwRect::Top( const long nTop ) { - nHeight += nY - nTop; - nY = nTop; + m_Size.Height() += m_Point.getY() - nTop; + m_Point.setY(nTop); } inline void SwRect::Bottom( const long nBottom ) { - nHeight = nBottom - nY + 1; + m_Size.setHeight(nBottom - m_Point.getY() + 1); } //----------------------------------- Get-Methoden inline const Point &SwRect::Pos() const { - return *(Point*)(&nX); + return m_Point; } inline Point &SwRect::Pos() { - return *(Point*)(&nX); + return m_Point; } inline const Size &SwRect::SSize() const { - return *(Size*)(&nWidth); + return m_Size; } inline Size &SwRect::SSize() { - return *(Size*)(&nWidth); + return m_Size; } inline long SwRect::Width() const { - return nWidth; + return m_Size.Width(); } inline long SwRect::Height() const { - return nHeight; + return m_Size.Height(); } inline long SwRect::Left() const { - return nX; + return m_Point.X(); } inline long SwRect::Right() const { - return nWidth ? nX + nWidth - 1 : nX; + return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : m_Point.getX(); } inline long SwRect::Top() const { - return nY; + return m_Point.Y(); } inline long SwRect::Bottom() const { - return nHeight ? nY + nHeight - 1 : nY; + return m_Size.getHeight() ? m_Point.getY() + m_Size.getHeight() - 1 : m_Point.getY(); } //----------------------------------- operatoren inline SwRect &SwRect::operator = ( const SwRect &rRect ) { - nX = rRect.Left(); - nY = rRect.Top(); - nWidth = rRect.Width(); - nHeight = rRect.Height(); + m_Point = rRect.m_Point; + m_Size = rRect.m_Size; return *this; } inline BOOL SwRect::operator == ( const SwRect& rRect ) const { - return (nX == rRect.Left() && - nY == rRect.Top() && - nWidth == rRect.Width() && - nHeight == rRect.Height()); + return (m_Point == rRect.m_Point && m_Size == rRect.m_Size); } inline BOOL SwRect::operator != ( const SwRect& rRect ) const { - return (nX != rRect.Left() || - nY != rRect.Top() || - nWidth != rRect.Width() || - nHeight != rRect.Height()); + return (m_Point != rRect.m_Point || m_Size != rRect.m_Size); } inline SwRect &SwRect::operator+=( const Point &rPt ) { - nX += rPt.X(); nY += rPt.Y(); + m_Point += rPt; return *this; } inline SwRect &SwRect::operator-=( const Point &rPt ) { - nX -= rPt.X(); nY -= rPt.Y(); + m_Point -= rPt; return *this; } inline SwRect &SwRect::operator+=( const Size &rSz ) { - nWidth += rSz.Width(); nHeight += rSz.Height(); + m_Size.Width() += rSz.Width(); + m_Size.Height() += rSz.Height(); return *this; } inline SwRect &SwRect::operator-=( const Size &rSz ) { - nWidth -= rSz.Width(); nHeight -= rSz.Height(); + m_Size.Width() -= rSz.Width(); + m_Size.Height() -= rSz.Height(); return *this; } @@ -315,10 +309,10 @@ inline SwRect &SwRect::operator-=( const Size &rSz ) //--------------------------- Sonstiges inline Rectangle SwRect::SVRect() const { - ASSERT( nWidth && nHeight, "SVRect() ohne Widht oder Height" ); - return Rectangle( nX, nY, - nX + nWidth - 1, //Right() - nY + nHeight - 1 ); //Bottom() + ASSERT( !IsEmpty(), "SVRect() without Width or Height" ); + return Rectangle( m_Point.getX(), m_Point.getY(), + m_Point.getX() + m_Size.getWidth() - 1, //Right() + m_Point.getY() + m_Size.getHeight() - 1 ); //Bottom() } inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const @@ -328,51 +322,44 @@ inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const inline BOOL SwRect::HasArea() const { - return nHeight && nWidth; + return !IsEmpty(); } inline BOOL SwRect::IsEmpty() const { - return !(nHeight && nWidth); + return !(m_Size.getHeight() && m_Size.getWidth()); } inline void SwRect::Clear() { - nX = nY = nWidth = nHeight = 0; + m_Point.setX(0); + m_Point.setY(0); + m_Size.setWidth(0); + m_Size.setHeight(0); } //-------------------------- CToren inline SwRect::SwRect() : - nX( 0 ), - nY( 0 ), - nWidth ( 0 ), - nHeight( 0 ) + m_Point( 0, 0 ), + m_Size( 0, 0 ) { } inline SwRect::SwRect( const SwRect &rRect ) : - nX( rRect.Left() ), - nY( rRect.Top() ), - nWidth ( rRect.Width() ), - nHeight( rRect.Height() ) + m_Point( rRect.m_Point ), + m_Size( rRect.m_Size ) { } inline SwRect::SwRect( const Point& rLT, const Size& rSize ) : - nX( rLT.X() ), - nY( rLT.Y() ), - nWidth ( rSize.Width() ), - nHeight( rSize.Height()) + m_Point( rLT ), + m_Size( rSize ) { } inline SwRect::SwRect( const Point& rLT, const Point& rRB ) : - nX( rLT.X() ), - nY( rLT.Y() ), - nWidth ( rRB.X() - rLT.X() + 1 ), - nHeight( rRB.Y() - rLT.Y() + 1 ) + m_Point( rLT ), + m_Size( rRB.X() - rLT.X() + 1, rRB.Y() - rLT.Y() + 1 ) { } inline SwRect::SwRect( long X, long Y, long W, long H ) : - nX( X ), - nY( Y ), - nWidth ( W ), - nHeight( H ) + m_Point( X, Y ), + m_Size( W, H ) { } diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index 2a49460a05ca..32fedb3753a0 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -121,7 +121,6 @@ public: inline const SwTOXMark &GetTOXMark() const; inline const SwFmtRefMark &GetRefMark() const; inline const SwFmtINetFmt &GetINetFmt() const; - inline const SvXMLAttrContainerItem &GetXMLAttrContainer() const; inline const SwFmtRuby &GetRuby() const; inline const SwFmtMeta &GetMeta() const; @@ -230,13 +229,6 @@ inline const SwFmtINetFmt& SwTxtAttr::GetINetFmt() const return (const SwFmtINetFmt&)(*m_pAttr); } -inline const SvXMLAttrContainerItem& SwTxtAttr::GetXMLAttrContainer() const -{ - ASSERT( m_pAttr && m_pAttr->Which() == RES_UNKNOWNATR_CONTAINER, - "Wrong attribute" ); - return (const SvXMLAttrContainerItem&)(*m_pAttr); -} - inline const SwFmtRuby& SwTxtAttr::GetRuby() const { ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_CJK_RUBY, diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index 92b51fede495..d9e9463a30a7 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -60,15 +60,6 @@ public: }; -// ATT_XMLCONTAINERITEM ****************************** - -class SwTxtXMLAttrContainer : public SwTxtAttrEnd -{ -public: - SwTxtXMLAttrContainer( SvXMLAttrContainerItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ); -}; - // ****************************** class SwTxtAttrNesting : public SwTxtAttrEnd diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index aaafa3fca76a..daefe85aa09a 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -206,6 +206,11 @@ namespace nsDelCntntType const DelCntntType DELCNT_CHKNOCNTNT = 0x80; } +/// will DelCntntIndex destroy a frame anchored at character at rAnchorPos? +bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, + SwPosition const & rStart, SwPosition const & rEnd, + DelCntntType const nDelCntntType = nsDelCntntType::DELCNT_ALL); + // diese Klasse muss in ein Undo-Object vererbt werden, wenn dieses Inhalt // fuers Redo/Undo ... speichert class SwUndoSaveCntnt diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index cd0d5321da1e..9f275aa09ed3 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -311,16 +311,16 @@ SfxItemInfo __FAR_DATA aSlotTab[] = { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY1 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY2 - { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_AUTOFMT - { FN_TXTATR_INET, 0 }, // RES_TXTATR_INETFMT { 0, 0 }, // RES_TXTATR_REFMARK { 0, 0 }, // RES_TXTATR_TOXMARK + { 0, 0 }, // RES_TXTATR_META + { 0, 0 }, // RES_TXTATR_METAFIELD + { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_AUTOFMT + { FN_TXTATR_INET, 0 }, // RES_TXTATR_INETFMT { 0, 0 }, // RES_TXTATR_CHARFMT + { SID_ATTR_CHAR_CJK_RUBY, 0 }, // RES_TXTATR_CJK_RUBY + { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_UNKNOWN_CONTAINER { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_DUMMY5 - { SID_ATTR_CHAR_CJK_RUBY, 0 }, // RES_TXTATR_CJK_RUBY, - { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_UNKNOWN_CONTAINER, - { 0, 0 }, // RES_TXTATR_META, - { 0, 0 }, // RES_TXTATR_METAFIELD, { 0, 0 }, // RES_TXTATR_FIELD { 0, 0 }, // RES_TXTATR_FLYCNT diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index 21fd4c7a2970..b92047dbb39a 100644 --- a/sw/source/core/bastyp/swrect.cxx +++ b/sw/source/core/bastyp/swrect.cxx @@ -53,13 +53,12 @@ SwRect::SwRect( const Rectangle &rRect ) : - nX( rRect.Left() ), - nY( rRect.Top() ) + m_Point( rRect.Left(), rRect.Top() ) { - nWidth = rRect.Right() == RECT_EMPTY ? 0 : - rRect.Right() - rRect.Left() +1; - nHeight = rRect.Bottom() == RECT_EMPTY ? 0 : - rRect.Bottom() - rRect.Top() + 1; + m_Size.setWidth(rRect.Right() == RECT_EMPTY ? 0 : + rRect.Right() - rRect.Left() +1); + m_Size.setHeight(rRect.Bottom() == RECT_EMPTY ? 0 : + rRect.Bottom() - rRect.Top() + 1); } /************************************************************************* @@ -139,7 +138,7 @@ SwRect& SwRect::Intersection( const SwRect& rRect ) } else //Def.: Bei einer leeren Intersection wird nur die SSize genullt. - nHeight = nWidth = 0; + SSize(0, 0); return *this; } @@ -239,76 +238,88 @@ BOOL SwRect::IsOver( const SwRect& rRect ) const void SwRect::Justify() { - if ( nHeight < 0 ) + if ( m_Size.getHeight() < 0 ) { - nY = nY + nHeight + 1; - nHeight = -nHeight; + m_Point.Y() += m_Size.getHeight() + 1; + m_Size.setHeight(-m_Size.getHeight()); } - if ( nWidth < 0 ) + if ( m_Size.getWidth() < 0 ) { - nX = nX + nWidth + 1; - nWidth = -nWidth; + m_Point.Y() += m_Size.getWidth() + 1; + m_Size.setWidth(-m_Size.getWidth()); } } // Similiar to the inline methods, but we need the function pointers -void SwRect::_Width( const long nNew ) { nWidth = nNew; } -void SwRect::_Height( const long nNew ) { nHeight = nNew; } -void SwRect::_Left( const long nLeft ){ nWidth += nX - nLeft; nX = nLeft; } -void SwRect::_Right( const long nRight ){ nWidth = nRight - nX; } -void SwRect::_Top( const long nTop ){ nHeight += nY - nTop; nY = nTop; } -void SwRect::_Bottom( const long nBottom ){ nHeight = nBottom - nY; } - -long SwRect::_Width() const{ return nWidth; } -long SwRect::_Height() const{ return nHeight; } -long SwRect::_Left() const{ return nX; } -long SwRect::_Right() const{ return nX + nWidth; } -long SwRect::_Top() const{ return nY; } -long SwRect::_Bottom() const{ return nY + nHeight; } - -void SwRect::AddWidth( const long nAdd ) { nWidth += nAdd; } -void SwRect::AddHeight( const long nAdd ) { nHeight += nAdd; } -void SwRect::SubLeft( const long nSub ){ nWidth += nSub; nX -= nSub; } -void SwRect::AddRight( const long nAdd ){ nWidth += nAdd; } -void SwRect::SubTop( const long nSub ){ nHeight += nSub; nY -= nSub; } -void SwRect::AddBottom( const long nAdd ){ nHeight += nAdd; } -void SwRect::SetPosX( const long nNew ){ nX = nNew; } -void SwRect::SetPosY( const long nNew ){ nY = nNew; } +void SwRect::_Width( const long nNew ) { m_Size.setWidth(nNew); } +void SwRect::_Height( const long nNew ) { m_Size.setHeight(nNew); } +void SwRect::_Left( const long nLeft ){ m_Size.Width() += m_Point.getX() - nLeft; m_Point.setX(nLeft); } +void SwRect::_Right( const long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); } +void SwRect::_Top( const long nTop ){ m_Size.Height() += m_Point.getY() - nTop; m_Point.setY(nTop); } +void SwRect::_Bottom( const long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); } + +long SwRect::_Width() const{ return m_Size.getWidth(); } +long SwRect::_Height() const{ return m_Size.getHeight(); } +long SwRect::_Left() const{ return m_Point.getX(); } +long SwRect::_Right() const{ return m_Point.getX() + m_Size.getWidth(); } +long SwRect::_Top() const{ return m_Point.getY(); } +long SwRect::_Bottom() const{ return m_Point.getY() + m_Size.getHeight(); } + +void SwRect::AddWidth( const long nAdd ) { m_Size.Width() += nAdd; } +void SwRect::AddHeight( const long nAdd ) { m_Size.Height() += nAdd; } +void SwRect::SubLeft( const long nSub ){ m_Size.Width() += nSub; m_Point.X() -= nSub; } +void SwRect::AddRight( const long nAdd ){ m_Size.Width() += nAdd; } +void SwRect::SubTop( const long nSub ){ m_Size.Height() += nSub; m_Point.Y() -= nSub; } +void SwRect::AddBottom( const long nAdd ){ m_Size.Height() += nAdd; } +void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); } +void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); } const Size SwRect::_Size() const { return SSize(); } -const Size SwRect::SwappedSize() const { return Size( nHeight, nWidth ); } +const Size SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); } const Point SwRect::TopLeft() const { return Pos(); } -const Point SwRect::TopRight() const { return Point( nX + nWidth, nY ); } -const Point SwRect::BottomLeft() const { return Point( nX, nY + nHeight ); } +const Point SwRect::TopRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() ); } +const Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() + m_Size.getHeight() ); } const Point SwRect::BottomRight() const - { return Point( nX + nWidth, nY + nHeight ); } -long SwRect::GetLeftDistance( long nLimit ) const { return nX - nLimit; } -long SwRect::GetBottomDistance( long nLim ) const { return nLim - nY - nHeight;} -long SwRect::GetTopDistance( long nLimit ) const { return nY - nLimit; } -long SwRect::GetRightDistance( long nLim ) const { return nLim - nX - nWidth; } + { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() + m_Size.getHeight() ); } +long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLimit; } +long SwRect::GetBottomDistance( long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();} +long SwRect::GetTopDistance( long nLimit ) const { return m_Point.getY() - nLimit; } +long SwRect::GetRightDistance( long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); } BOOL SwRect::OverStepLeft( long nLimit ) const - { return nLimit > nX && nX + nWidth > nLimit; } + { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; } BOOL SwRect::OverStepBottom( long nLimit ) const - { return nLimit > nY && nY + nHeight > nLimit; } + { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; } BOOL SwRect::OverStepTop( long nLimit ) const - { return nLimit > nY && nY + nHeight > nLimit; } + { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; } BOOL SwRect::OverStepRight( long nLimit ) const - { return nLimit > nX && nX + nWidth > nLimit; } + { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; } void SwRect::SetLeftAndWidth( long nLeft, long nNew ) - { nX = nLeft; nWidth = nNew; } +{ + m_Point.setX(nLeft); + m_Size.setWidth(nNew); +} void SwRect::SetTopAndHeight( long nTop, long nNew ) - { nY = nTop; nHeight = nNew; } +{ + m_Point.setY(nTop); + m_Size.setHeight(nNew); +} void SwRect::SetRightAndWidth( long nRight, long nNew ) - { nX = nRight - nNew; nWidth = nNew; } +{ + m_Point.setX(nRight - nNew); + m_Size.setWidth(nNew); +} void SwRect::SetBottomAndHeight( long nBottom, long nNew ) - { nY = nBottom - nNew; nHeight = nNew; } +{ + m_Point.setY(nBottom - nNew); + m_Size.setHeight(nNew); +} void SwRect::SetUpperLeftCorner( const Point& rNew ) - { nX = rNew.nA; nY = rNew.nB; } + { m_Point = rNew; } void SwRect::SetUpperRightCorner( const Point& rNew ) - { nX = rNew.nA - nWidth; nY = rNew.nB; } + { m_Point = Point(rNew.nA - m_Size.getWidth(), rNew.nB); } void SwRect::SetLowerLeftCorner( const Point& rNew ) - { nX = rNew.nA; nY = rNew.nB - nHeight; } + { m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); } #ifndef PRODUCT /************************************************************************* diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx index ba8ee121a362..2bab385f0b5a 100644 --- a/sw/source/core/bastyp/swregion.cxx +++ b/sw/source/core/bastyp/swregion.cxx @@ -117,7 +117,7 @@ void SwRegionRects::operator-=( const SwRect &rRect ) if ( 0 < (nTmp = aInter.Top() - aTmp.Top()) ) { const long nOldVal = aTmp.Height(); - aTmp.SSize().Height() = nTmp; + aTmp.Height(nTmp); InsertRect( aTmp, i, bDel ); aTmp.Height( nOldVal ); } diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index 3ed58c72bd97..9fda3564a400 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -111,6 +111,11 @@ SW_DLLPUBLIC const char * dbg_out(const String & aStr) return aDbgOutResult.GetBuffer(); } +SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr) +{ + return OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr(); +} + struct CompareUShort { diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index eb4c1c988c05..0c18b725d9f7 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -106,6 +106,8 @@ #include <SwUndoFmt.hxx> #include <unocrsr.hxx> #include <docsh.hxx> +#include <docufld.hxx> + #include <vector> #include <osl/diagnose.h> @@ -1077,6 +1079,24 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat ) } } + // #i93174#: notes contain paragraphs that are not nodes + { + SwFieldType * const pPostits( GetSysFldType(RES_POSTITFLD) ); + SwClientIter aIter(*pPostits); + SwFmtFld const * pFmtFld = + static_cast<SwFmtFld const*>(aIter.First( TYPE(SwFmtFld) )); + while (pFmtFld) + { + if (pFmtFld->IsFldInDoc()) + { + SwPostItField const * const pField( + static_cast<SwPostItField const*>(pFmtFld->GetFld())); + rStat.nAllPara += pField->GetNumberOfParagraphs(); + } + pFmtFld = static_cast<SwFmtFld const*>(aIter.Next()); + } + } + rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0; rStat.bModified = FALSE; SetDocStat( rStat ); @@ -1102,12 +1122,21 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat ) aStat[n++].Value <<= (sal_Int32)rStat.nChar; // For e.g. autotext documents there is no pSwgInfo (#i79945) - if (GetDocShell()) { - uno::Reference<document::XDocumentPropertiesSupplier> xDPS( - GetDocShell()->GetModel(), uno::UNO_QUERY_THROW); - uno::Reference<document::XDocumentProperties> xDocProps( + SfxObjectShell * const pObjShell( GetDocShell() ); + if (pObjShell) + { + const uno::Reference<document::XDocumentPropertiesSupplier> xDPS( + pObjShell->GetModel(), uno::UNO_QUERY_THROW); + const uno::Reference<document::XDocumentProperties> xDocProps( xDPS->getDocumentProperties()); + // #i96786#: do not set modified flag when updating statistics + const bool bDocWasModified( IsModified() ); + const ModifyBlocker_Impl b(pObjShell); xDocProps->setDocumentStatistics(aStat); + if (!bDocWasModified) + { + ResetModified(); + } } // event. Stat. Felder Updaten @@ -2018,3 +2047,13 @@ void SwDoc::ChkCondColls() } } +void SwDoc::setExternalData(::sw::tExternalDataType eType, + ::sw::tExternalDataPointer pPayload) +{ + m_externalData[eType] = pPayload; +} + +::sw::tExternalDataPointer SwDoc::getExternalData(::sw::tExternalDataType eType) +{ + return m_externalData[eType]; +} diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 68c84dd3b644..047b5b2dc582 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -428,7 +428,7 @@ Compare::Compare( ULONG nDiff, CompareData& rData1, CompareData& rData2 ) SetDiscard( rData2, pDiscard2, pCount1 ); // die Arrays koennen wir wieder vergessen - delete pCount1; delete pCount2; + delete [] pCount1; delete [] pCount2; CheckDiscard( rData1.GetLineCount(), pDiscard1 ); CheckDiscard( rData2.GetLineCount(), pDiscard2 ); @@ -437,7 +437,7 @@ Compare::Compare( ULONG nDiff, CompareData& rData1, CompareData& rData2 ) pMD2 = new MovedData( rData2, pDiscard2 ); // die Arrays koennen wir wieder vergessen - delete pDiscard1; delete pDiscard2; + delete [] pDiscard1; delete [] pDiscard2; } { diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 948741067967..af3b5ddedf37 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -469,9 +469,10 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, // --> OD 2008-02-25 #refactorlists# RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, // <-- - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 }; @@ -624,7 +625,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, (RES_TXTATR_CHARFMT == nWhich) || (RES_TXTATR_INETFMT == nWhich) || (RES_TXTATR_AUTOFMT == nWhich) || - isUNKNOWNATR(nWhich) ) + (RES_TXTATR_UNKNOWN_CONTAINER == nWhich) ) { pCharSet = &rChgSet; bCharAttr = true; @@ -635,7 +636,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, || isPARATR_LIST(nWhich) // <-- || isFRMATR(nWhich) - || isGRFATR(nWhich) ) + || isGRFATR(nWhich) + || isUNKNOWNATR(nWhich) ) { pOtherSet = &rChgSet; bOtherAttr = true; @@ -652,7 +654,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, RES_TXTATR_AUTOFMT, RES_TXTATR_AUTOFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, 0 ); SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(), @@ -662,6 +664,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, // <-- RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_BEGIN, RES_GRFATR_END-1, + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 ); pTmpCharItemSet->Put( rChgSet ); @@ -753,7 +756,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, // TEST_TEMP ToDo: AutoFmt! SfxItemSet aTxtSet( pDoc->GetAttrPool(), RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK, - RES_TXTATR_DUMMY5, RES_TXTATR_WITHEND_END-1, + RES_TXTATR_META, RES_TXTATR_METAFIELD, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, 0 ); aTxtSet.Put( rChgSet ); @@ -1742,36 +1746,45 @@ BOOL lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs ) pFmt != pCNd->GetFmtColl() && pFmt->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET ) { - // --> OD 2008-04-08 #refactorlists# -// if ( pPara->pHistory ) -// { -// SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) ); -// ASSERT( pTNd, -// "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" ); -// SwRegHistory aRegH( pTNd, *pTNd, pPara->pHistory ); -// pCNd->ResetAttr( RES_PARATR_NUMRULE ); -// } -// else -// { -// pCNd->ResetAttr( RES_PARATR_NUMRULE ); -// } - std::auto_ptr< SwRegHistory > pRegH; - if ( pPara->pHistory ) + // --> OD 2009-09-07 #b6876367# + // Check, if the list style of the paragraph will change. + bool bChangeOfListStyleAtParagraph( true ); + SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) ); + ASSERT( pTNd, + "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" ); { - SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) ); - ASSERT( pTNd, - "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" ); - pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) ); + SwNumRule* pNumRuleAtParagraph( pTNd->GetNumRule() ); + if ( pNumRuleAtParagraph ) + { + const SwNumRuleItem& rNumRuleItemAtParagraphStyle = + pFmt->GetNumRule(); + if ( rNumRuleItemAtParagraphStyle.GetValue() == + pNumRuleAtParagraph->GetName() ) + { + bChangeOfListStyleAtParagraph = false; + } + } } - pCNd->ResetAttr( RES_PARATR_NUMRULE ); + if ( bChangeOfListStyleAtParagraph ) + { + // --> OD 2008-04-08 #refactorlists# + std::auto_ptr< SwRegHistory > pRegH; + if ( pPara->pHistory ) + { + pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) ); + } - // reset all list attributes - pCNd->ResetAttr( RES_PARATR_LIST_LEVEL ); - pCNd->ResetAttr( RES_PARATR_LIST_ISRESTART ); - pCNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE ); - pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED ); - pCNd->ResetAttr( RES_PARATR_LIST_ID ); + pCNd->ResetAttr( RES_PARATR_NUMRULE ); + + // reset all list attributes + pCNd->ResetAttr( RES_PARATR_LIST_LEVEL ); + pCNd->ResetAttr( RES_PARATR_LIST_ISRESTART ); + pCNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE ); + pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED ); + pCNd->ResetAttr( RES_PARATR_LIST_ID ); + } + // <-- } // <-- } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index daeda48ccae3..5f0170c1947f 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -309,9 +309,11 @@ Verhalten von Delete-Redline: bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) { -#ifndef PRODUCT +#if 0 +// #i93179# disabled: ASSERT in ~SwIndexReg #ifndef PRODUCT SwRedline aCopy( *pNewRedl ); #endif + bool bError = true; _CHECK_REDLINE( this ) if( IsRedlineOn() && !IsShowOriginal( eRedlineMode ) && @@ -431,6 +433,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) pRedlineTbl->Insert( pRedl ); } + bError = false; bDelete = true; } else if( (( POS_BEFORE == eCmpPos && @@ -446,6 +449,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) pRedlineTbl->Remove( n ); pRedlineTbl->Insert( pRedl ); + bError = false; bDelete = true; } else if ( POS_OUTSIDE == eCmpPos ) @@ -1108,7 +1112,8 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) case POS_EQUAL: case POS_INSIDE: - delete pNewRedl, pNewRedl = 0; + // TODO Check if there is any side effect + //delete pNewRedl, pNewRedl = 0; break; case POS_OUTSIDE: @@ -1271,7 +1276,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) } _CHECK_REDLINE( this ) - return 0 != pNewRedl; + return ( 0 != pNewRedl ) || !bError; } void SwDoc::CompressRedlines() diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 67fec1f7d33d..3f1a6babac56 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -386,7 +386,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) { if( bUndo ) { - pRedlUndo = new SwUndoRedlineSort( rPaM, rOpt ); + pRedlUndo = new SwUndoRedlineSort( *pRedlPam,rOpt ); DoUndo( FALSE ); } // erst den Bereich kopieren, dann @@ -471,20 +471,36 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) AppendUndo( pRedlUndo ); } - // nBeg ist der Start vom sortierten Bereich + // nBeg is start of sorted range SwNodeIndex aSttIdx( GetNodes(), nBeg ); - // der Kopierte Bereich ist das Geloeschte - AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam ), true); + // the copied range is deleted + SwRedline *const pDeleteRedline( + new SwRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam )); - // das sortierte ist das Eingefuegte + // pRedlPam points to nodes that may be deleted (hidden) by + // AppendRedline, so adjust it beforehand to prevent ASSERT pRedlPam->GetPoint()->nNode = aSttIdx; SwCntntNode* pCNd = aSttIdx.GetNode().GetCntntNode(); pRedlPam->GetPoint()->nContent.Assign( pCNd, 0 ); + AppendRedline(pDeleteRedline, true); + + // the sorted range is inserted AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_INSERT, *pRedlPam ), true); if( pRedlUndo ) + { + SwNodeIndex aInsEndIdx( pRedlPam->GetMark()->nNode, -1 ); + pRedlPam->GetMark()->nNode = aInsEndIdx; + SwCntntNode *const pPrevNode = + pRedlPam->GetMark()->nNode.GetNode().GetCntntNode(); + pRedlPam->GetMark()->nContent.Assign( pPrevNode, pPrevNode->Len() ); + + pRedlUndo->SetValues( *pRedlPam ); + } + + if( pRedlUndo ) pRedlUndo->SetOffset( aSttIdx ); delete pRedlPam, pRedlPam = 0; diff --git a/sw/source/core/doc/docstat.cxx b/sw/source/core/doc/docstat.cxx index 23e6fe5b055d..04c85a3a8d2a 100644 --- a/sw/source/core/doc/docstat.cxx +++ b/sw/source/core/doc/docstat.cxx @@ -45,10 +45,10 @@ SwDocStat::SwDocStat() : nOLE(0), nPage(1), nPara(1), + nAllPara(1), nWord(0), nChar(0), - bModified(TRUE), - pInternStat(0) + bModified(TRUE) {} /************************************************************************ @@ -62,9 +62,9 @@ void SwDocStat::Reset() nOLE = 0; nPage = 1; nPara = 1; + nAllPara= 1; nWord = 0; nChar = 0; bModified = TRUE; - pInternStat = 0; } diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index a7e7675966c3..6407e505aa0c 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1322,7 +1322,8 @@ SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> > SwTxtNode& rTxtNode = static_cast<SwTxtNode&>(rNode); // setze den bei allen TextNode in der Tabelle den TableNode // als StartNode - rTxtNode.pStartOfSection = pTblNd; +// FIXME: this is setting wrong node StartOfSections in nested tables. +// rTxtNode.pStartOfSection = pTblNd; // remove PageBreaks/PageDesc/ColBreak const SwAttrSet* pSet = rTxtNode.GetpSwAttrSet(); if( pSet ) @@ -1401,7 +1402,6 @@ SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> > aCellNodeIdx = SwNodeIndex( *aCellNodeIdx.GetNode().EndOfSectionNode() ); } - // Section der Box zuweisen pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); pLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, nBoxes++ ); diff --git a/sw/source/core/docnode/swthreadmanager.cxx b/sw/source/core/docnode/swthreadmanager.cxx index 61ffa301f708..3f06c26de608 100644 --- a/sw/source/core/docnode/swthreadmanager.cxx +++ b/sw/source/core/docnode/swthreadmanager.cxx @@ -39,35 +39,29 @@ @author OD */ -SwThreadManager* SwThreadManager::mpThreadManager = 0; -osl::Mutex* SwThreadManager::mpGetManagerMutex = new osl::Mutex(); +bool SwThreadManager::mbThreadManagerInstantiated = false; SwThreadManager::SwThreadManager() : mpThreadManagerImpl( new ThreadManager( SwThreadJoiner::GetThreadJoiner() ) ) { mpThreadManagerImpl->Init(); + mbThreadManagerInstantiated = true; } SwThreadManager::~SwThreadManager() { - delete mpThreadManagerImpl; } +struct InitInstance : public rtl::Static<SwThreadManager, InitInstance> {}; + SwThreadManager& SwThreadManager::GetThreadManager() { - osl::MutexGuard aGuard(*mpGetManagerMutex); - - if ( mpThreadManager == 0 ) - { - mpThreadManager = new SwThreadManager(); - } - - return *mpThreadManager; + return InitInstance::get(); } bool SwThreadManager::ExistsThreadManager() { - return (mpThreadManager != 0); + return mbThreadManagerInstantiated; } oslInterlockedCount SwThreadManager::AddThread( const rtl::Reference< ObservableThread >& rThread ) diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 6bb8ff4902ea..9f1b19db95fa 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1147,16 +1147,9 @@ String SwDocInfoField::Expand() const ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY ); uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING ); aNew >>= sVal; - ((SwDocInfoField*)this)->aContent = sVal; + const_cast<SwDocInfoField*>(this)->aContent = sVal; } } - else - { - // property is "void" - means it has not been added until now - do it! - aAny <<= ::rtl::OUString(aContent); - uno::Reference < beans::XPropertyContainer > xCont( xSet, uno::UNO_QUERY ); - xCont->addProperty( aName, ::com::sun::star::beans::PropertyAttribute::REMOVEABLE, aAny ); - } } catch (uno::Exception&) {} } @@ -1877,6 +1870,11 @@ void SwPostItField::SetTextObject( OutlinerParaObject* pText ) mpText = pText; } +sal_uInt32 SwPostItField::GetNumberOfParagraphs() const +{ + return (mpText) ? mpText->Count() : 1; +} + /*-----------------05.03.98 13:42------------------- --------------------------------------------------*/ diff --git a/sw/source/core/inc/swthreadmanager.hxx b/sw/source/core/inc/swthreadmanager.hxx index a8a0de5d0d4e..e3d08955433b 100644 --- a/sw/source/core/inc/swthreadmanager.hxx +++ b/sw/source/core/inc/swthreadmanager.hxx @@ -34,6 +34,10 @@ #include <osl/mutex.hxx> #include <rtl/ref.hxx> +#include <boost/utility.hpp> +#include <memory> + + class ObservableThread; class ThreadManager; @@ -45,6 +49,7 @@ class ThreadManager; @author OD */ class SwThreadManager + : private ::boost::noncopyable { public: @@ -52,6 +57,9 @@ class SwThreadManager static bool ExistsThreadManager(); + // private: don't call! + SwThreadManager(); + // private: don't call! ~SwThreadManager(); oslInterlockedCount AddThread( const rtl::Reference< ObservableThread >& rThread ); @@ -76,12 +84,9 @@ class SwThreadManager bool StartingOfThreadsSuspended(); private: - static SwThreadManager* mpThreadManager; - static osl::Mutex* mpGetManagerMutex; + static bool mbThreadManagerInstantiated; - ThreadManager* mpThreadManagerImpl; - - SwThreadManager(); + ::std::auto_ptr<ThreadManager> mpThreadManagerImpl; }; #endif diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index e6275cb5481a..f7c615ae640f 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -1160,6 +1160,10 @@ void SwSectionFrm::SimpleFormat() SWRECTFN( this ) if( GetPrev() || GetUpper() ) { + // --> OD 2009-09-28 #b6882166# + // assure notifications on position changes. + const SwLayNotify aNotify( this ); + // <-- (this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), FALSE ); bValidPos = TRUE; } diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index f8d617061d3e..7db8ec2e2506 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -128,16 +128,16 @@ const BYTE StackPos[ static_cast<USHORT>(RES_TXTATR_WITHEND_END) - 35, // RES_CHRATR_OVERLINE, // 38 0, // RES_CHRATR_DUMMY1, // 39 0, // RES_CHRATR_DUMMY2, // 40 - 0, // RES_TXTATR_AUTOFMT, // 41 - 0, // RES_TXTATR_INETFMT // 42 - 36, // RES_TXTATR_REFMARK, // 43 - 37, // RES_TXTATR_TOXMARK, // 44 - 0, // RES_TXTATR_CHARFMT, // 45 - 0, // RES_TXTATR_DUMMY5 // 46 - 38, // RES_TXTATR_CJK_RUBY, // 47 - 0, // RES_TXTATR_UNKNOWN_CONTAINER, // 48 - 39, // RES_TXTATR_META, // 49 - 39 // RES_TXTATR_METAFIELD, // 50 + 36, // RES_TXTATR_REFMARK, // 41 + 37, // RES_TXTATR_TOXMARK, // 42 + 38, // RES_TXTATR_META, // 43 + 38, // RES_TXTATR_METAFIELD, // 44 + 0, // RES_TXTATR_AUTOFMT, // 45 + 0, // RES_TXTATR_INETFMT // 46 + 0, // RES_TXTATR_CHARFMT, // 47 + 39, // RES_TXTATR_CJK_RUBY, // 48 + 0, // RES_TXTATR_UNKNOWN_CONTAINER, // 49 + 0, // RES_TXTATR_DUMMY5 // 50 }; /************************************************************************* @@ -523,13 +523,11 @@ void SwAttrHandler::PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt ) sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem ) { - ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END || - RES_UNKNOWNATR_CONTAINER == rItem.Which() , + ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END, "I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" ); // robust - if ( RES_TXTATR_WITHEND_END <= rItem.Which() || - RES_UNKNOWNATR_CONTAINER == rItem.Which() ) + if ( RES_TXTATR_WITHEND_END <= rItem.Which() ) return sal_False; USHORT nStack = StackPos[ rItem.Which() ]; @@ -557,6 +555,9 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem ) void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt ) { + if ( RES_TXTATR_WITHEND_END <= rAttr.Which() ) + return; // robust + // these special attributes in fact represent a collection of attributes // they have to be removed from each stack they belong to if ( RES_TXTATR_INETFMT == rAttr.Which() || @@ -583,7 +584,7 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt ) } // this is the usual case, we have a basic attribute, remove it from the // stack and reset the font - else if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() ) + else { aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr ); // reset font according to attribute on top of stack @@ -600,13 +601,13 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt ) void SwAttrHandler::Pop( const SwTxtAttr& rAttr ) { - ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END || - RES_UNKNOWNATR_CONTAINER == rAttr.Which() , + ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END, "I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" ); - if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() && - rAttr.Which() < RES_TXTATR_WITHEND_END ) + if ( rAttr.Which() < RES_TXTATR_WITHEND_END ) + { aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr ); + } } /************************************************************************* diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index cf6603d8a4d7..c42ba1c25df0 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -158,7 +158,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) const SwTxtNode *pNode = pFrm->GetTxtNode(); const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace(); - // --> OD 2009-09-02 #i95907# + // --> OD 2009-09-08 #i95907#, #b6879723# const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable(); // <-- @@ -183,7 +183,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) pFrm->Prt().Left() + nLMWithNum - pNode->GetLeftMarginWithNum( sal_False ) - - // --> OD 2009-09-02 #i95907# + // --> OD 2009-09-08 #i95907#, #b6879723# // rSpace.GetLeft() + // rSpace.GetTxtLeft(); ( bListLevelIndentsApplicable @@ -193,14 +193,18 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) } else { - if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) + // --> OD 2009-09-08 #i95907#, #b6879723# +// if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) + if ( bListLevelIndentsApplicable || + !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) + // <-- { // this calculation is identical this the calculation for R2L layout - see above nLeft = pFrm->Frm().Left() + pFrm->Prt().Left() + nLMWithNum - pNode->GetLeftMarginWithNum( sal_False ) - - // --> OD 2009-09-02 #i95907# + // --> OD 2009-09-08 #i95907#, #b6879723# // rSpace.GetLeft() + // rSpace.GetTxtLeft(); ( bListLevelIndentsApplicable @@ -223,7 +227,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) // paras inside cells inside new documents: ( pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) || !pFrm->IsInTab() || - !nLMWithNum) ) + !nLMWithNum ) ) // <-- { nLeft = pFrm->Prt().Left() + pFrm->Frm().Left(); @@ -235,8 +239,8 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) nFirst = nLeft; else { - short nFLOfst; - long nFirstLineOfs; + short nFLOfst = 0; + long nFirstLineOfs = 0; if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) && rSpace.IsAutoFirst() ) { @@ -290,8 +294,13 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) else nFirstLineOfs = nFLOfst; + // --> OD 2009-09-08 #i95907#, #b6879723# +// if ( pFrm->IsRightToLeft() || +// !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) if ( pFrm->IsRightToLeft() || - !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) + bListLevelIndentsApplicable || + !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) + // <-- { nFirst = nLeft + nFirstLineOfs; } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 9952c50e678d..6f98bd371ead 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -386,7 +386,9 @@ USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut ) const FontMetric aOutMet( rRefDev.GetFontMetric() ); long nTmpPrtHeight = (USHORT)aOutMet.GetAscent() + aOutMet.GetDescent(); (void) nTmpPrtHeight; - ASSERT( nTmpPrtHeight == nPrtHeight, "GetTextHeight != Ascent + Descent" ) + // #i106098#: do not compare with == here due to rounding error + ASSERT( abs(nTmpPrtHeight - nPrtHeight) < 3, + "GetTextHeight != Ascent + Descent" ); #endif ((OutputDevice&)rRefDev).SetFont( aOldFnt ); @@ -2424,8 +2426,12 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf ) const xub_StrLen nEnd = rInf.GetIdx() + rInf.GetLen(); // skip character cells for complex scripts - if ( rInf.GetFont() && SW_CTL == rInf.GetFont()->GetActual() && + // --> OD 2009-10-14 #i105571# - skip also character cells for CJK + if ( rInf.GetFont() && + ( SW_CTL == rInf.GetFont()->GetActual() || + SW_CJK == rInf.GetFont()->GetActual() ) && pBreakIt->GetBreakIter().is() ) + // <-- { aLang = rInf.GetFont()->GetLanguage(); bSkipCell = sal_True; diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index 6fdacb37a456..54be1b261655 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -123,8 +123,8 @@ static BOOL lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 ) return (long)&rHt1 < (long)&rHt2; } - // the order must ensure that META is inside RUBY! - return ( nWhich1 < nWhich2 ); + // order is important! for requirements see hintids.hxx + return ( nWhich1 > nWhich2 ); } return ( nHt1 > nHt2 ); } @@ -159,8 +159,8 @@ static BOOL lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 ) return (long)&rHt1 > (long)&rHt2; } - // the order must ensure that META is inside RUBY! - return ( nWhich1 > nWhich2 ); + // order is important! for requirements see hintids.hxx + return ( nWhich1 < nWhich2 ); } else return ( *rHt1.GetStart() > *rHt2.GetStart() ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 6c5aafb4667d..eb1f5c3e94fc 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -943,9 +943,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen, bool bNoExp = false; bool bResort = false; const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) - - static_cast<USHORT>(RES_CHRATR_BEGIN) + - static_cast<USHORT>(RES_UNKNOWNATR_END) - - static_cast<USHORT>(RES_UNKNOWNATR_BEGIN); + static_cast<USHORT>(RES_CHRATR_BEGIN); BOOL aDontExp[ coArrSz ]; memset( &aDontExp, 0, coArrSz * sizeof(BOOL) ); @@ -980,14 +978,6 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen, nWhPos = static_cast<USHORT>(nWhich - RES_CHRATR_BEGIN); } - else if (isUNKNOWNATR(nWhich)) - { - nWhPos = static_cast<USHORT>( - nWhich - - static_cast<USHORT>(RES_UNKNOWNATR_BEGIN) + - static_cast<USHORT>(RES_TXTATR_WITHEND_END) - - static_cast<USHORT>(RES_CHRATR_BEGIN) ); - } else continue; @@ -1518,8 +1508,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, { SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 ); aCharSet.Put( *GetpSwAttrSet() ); @@ -1565,8 +1555,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, { SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 ); aCharSet.Put( *GetpSwAttrSet() ); @@ -2072,8 +2062,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, { SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 ); aCharSet.Put( *GetpSwAttrSet() ); @@ -2852,6 +2842,9 @@ long SwTxtNode::GetLeftMarginWithNum( BOOL bTxtLeft ) const BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const { BOOL bRet( FALSE ); + // --> OD 2009-09-08 #i95907#, #b6879723# + rFLOffset = 0; + // <-- // --> OD 2005-11-02 #i51089 - TUNING# const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L; @@ -2885,8 +2878,6 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const } // <-- } - else - rFLOffset = 0; bRet = TRUE; } diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 12f8e210e7c5..81bdb95f0699 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1065,11 +1065,6 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr, case RES_TXTATR_TOXMARK: pNew = new SwTxtTOXMark( (SwTOXMark&)rNew, nStt, &nEnd ); break; - case RES_UNKNOWNATR_CONTAINER: - case RES_TXTATR_UNKNOWN_CONTAINER: - pNew = new SwTxtXMLAttrContainer( (SvXMLAttrContainerItem&)rNew, - nStt, nEnd ); - break; case RES_TXTATR_CJK_RUBY: pNew = new SwTxtRuby( (SwFmtRuby&)rNew, nStt, nEnd ); break; @@ -1669,8 +1664,7 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt, SfxItemSet aCharSet( *rSet.GetPool(), aCharAutoFmtSetRange ); - USHORT nWhich, nCount = 0; - SwTxtAttr* pNew; + USHORT nCount = 0; SfxItemIter aIter( *pSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); @@ -1678,8 +1672,10 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt, { if ( pItem && (reinterpret_cast<SfxPoolItem*>(-1) != pItem)) { - nWhich = pItem->Which(); - if ( isCHRATR(nWhich) || isTXTATR(nWhich) || isUNKNOWNATR(nWhich) ) + const USHORT nWhich = pItem->Which(); + ASSERT( isCHRATR(nWhich) || isTXTATR(nWhich), + "SwTxtNode::SetAttr(): unknown attribute" ); + if ( isCHRATR(nWhich) || isTXTATR(nWhich) ) { if ((RES_TXTATR_CHARFMT == nWhich) && (GetDoc()->GetDfltCharFmt() == @@ -1698,7 +1694,8 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt, } else { - pNew = MakeTxtAttr( *GetDoc(), + + SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(), const_cast<SfxPoolItem&>(*pItem), nStt, nEnd ); if ( pNew ) { @@ -1862,20 +1859,18 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, } const USHORT nSize = m_pSwpHints->Count(); - USHORT n; - xub_StrLen nAttrStart; - const xub_StrLen* pAttrEnd; if( nStt == nEnd ) // kein Bereich: { - for( n = 0; n < nSize; ++n ) // + for (USHORT n = 0; n < nSize; ++n) { const SwTxtAttr* pHt = (*m_pSwpHints)[n]; - nAttrStart = *pHt->GetStart(); + const xub_StrLen nAttrStart = *pHt->GetStart(); if( nAttrStart > nEnd ) // ueber den Bereich hinaus break; - if( 0 == ( pAttrEnd = pHt->GetEnd() )) // nie Attribute ohne Ende + const xub_StrLen* pAttrEnd = pHt->GetEnd(); + if ( ! pAttrEnd ) // no attributes without end continue; if( ( nAttrStart < nStt && @@ -1889,22 +1884,21 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, else // es ist ein Bereich definiert { // --> FME 2007-03-13 #i75299# - std::vector< SwPoolItemEndPair >* pAttrArr = 0; + ::std::auto_ptr< std::vector< SwPoolItemEndPair > > pAttrArr; // <-- const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) - - static_cast<USHORT>(RES_CHRATR_BEGIN) + - static_cast<USHORT>(RES_UNKNOWNATR_END) - - static_cast<USHORT>(RES_UNKNOWNATR_BEGIN); + static_cast<USHORT>(RES_CHRATR_BEGIN); - for( n = 0; n < nSize; ++n ) + for (USHORT n = 0; n < nSize; ++n) { const SwTxtAttr* pHt = (*m_pSwpHints)[n]; - nAttrStart = *pHt->GetStart(); + const xub_StrLen nAttrStart = *pHt->GetStart(); if( nAttrStart > nEnd ) // ueber den Bereich hinaus break; - if( 0 == ( pAttrEnd = pHt->GetEnd() )) // nie Attribute ohne Ende + const xub_StrLen* pAttrEnd = pHt->GetEnd(); + if ( ! pAttrEnd ) // no attributes without end continue; BOOL bChkInvalid = FALSE; @@ -1927,7 +1921,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, if( bChkInvalid ) { // uneindeutig ? - SfxItemIter* pItemIter = 0; + ::std::auto_ptr< SfxItemIter > pItemIter; const SfxPoolItem* pItem = 0; if ( RES_TXTATR_AUTOFMT == pHt->Which() ) @@ -1935,7 +1929,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, const SfxItemSet* pAutoSet = CharFmt::GetItemSet( pHt->GetAttr() ); if ( pAutoSet ) { - pItemIter = new SfxItemIter( *pAutoSet ); + pItemIter.reset( new SfxItemIter( *pAutoSet ) ); pItem = pItemIter->GetCurItem(); } } @@ -1947,9 +1941,14 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, while ( pItem ) { const USHORT nHintWhich = pItem->Which(); + ASSERT(!isUNKNOWNATR(nHintWhich), + "SwTxtNode::GetAttr(): unkonwn attribute?"); - if( !pAttrArr ) - pAttrArr = new std::vector< SwPoolItemEndPair >( coArrSz ); + if ( !pAttrArr.get() ) + { + pAttrArr.reset( + new std::vector< SwPoolItemEndPair >(coArrSz)); + } std::vector< SwPoolItemEndPair >::iterator pPrev = pAttrArr->begin(); if (isCHRATR(nHintWhich) || @@ -1957,12 +1956,6 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, { pPrev += nHintWhich - RES_CHRATR_BEGIN; } - else if (isUNKNOWNATR(nHintWhich)) - { - pPrev += nHintWhich - RES_UNKNOWNATR_BEGIN + ( - static_cast< USHORT >(RES_TXTATR_WITHEND_END) - - static_cast< USHORT >(RES_CHRATR_BEGIN) ); - } else { pPrev = pAttrArr->end(); @@ -2006,28 +1999,21 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, } } - pItem = ( pItemIter && !pItemIter->IsAtEnd() ) ? pItemIter->NextItem() : 0; + pItem = ( pItemIter.get() && !pItemIter->IsAtEnd() ) + ? pItemIter->NextItem() : 0; } // end while - - delete pItemIter; } } - if( pAttrArr ) + if ( pAttrArr.get() ) { - for( n = 0; n < coArrSz; ++n ) + for (USHORT n = 0; n < coArrSz; ++n) { const SwPoolItemEndPair& rItemPair = (*pAttrArr)[ n ]; if( (0 != rItemPair.mpItem) && ((SfxPoolItem*)-1 != rItemPair.mpItem) ) { - USHORT nWh; - if( n < static_cast<USHORT>( static_cast<USHORT>(RES_TXTATR_WITHEND_END) - - static_cast<USHORT>(RES_CHRATR_BEGIN) ) ) - nWh = static_cast<USHORT>(n + RES_CHRATR_BEGIN); - else - nWh = n - static_cast<USHORT>( static_cast<USHORT>(RES_TXTATR_WITHEND_END) - - static_cast<USHORT>(RES_CHRATR_BEGIN) + - static_cast<USHORT>(RES_UNKNOWNATR_BEGIN) ); + const USHORT nWh = + static_cast<USHORT>(n + RES_CHRATR_BEGIN); if( nEnd <= rItemPair.mnEndPos ) // hinter oder genau Ende { @@ -2039,8 +2025,6 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, rSet.InvalidateItem( nWh ); } } - - delete pAttrArr; } } if( aFmtSet.Count() ) diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 18db65d13dc8..afed4e1af732 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <hintids.hxx> #include <hints.hxx> #include <sfx2/objsh.hxx> @@ -52,13 +51,6 @@ TYPEINIT1(SwTxtINetFmt,SwClient); TYPEINIT1(SwTxtRuby,SwClient); -// ATT_XMLCONTAINERITEM ****************************** - -SwTxtXMLAttrContainer::SwTxtXMLAttrContainer( - SvXMLAttrContainerItem& rAttr, - xub_StrLen nStt, xub_StrLen nEnde ) - : SwTxtAttrEnd( rAttr, nStt, nEnde ) -{} /************************************************************************* * class SwTxtCharFmt diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index b34d013f3264..03efd19df3e8 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1676,6 +1676,7 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen, void SwTxtNode::CountWords( SwDocStat& rStat, xub_StrLen nStt, xub_StrLen nEnd ) const { + ++rStat.nAllPara; // #i93174#: count _all_ paragraphs if( nStt < nEnd ) { if ( !IsHidden() ) diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index 07eb7182d717..1eeb9246dffe 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -679,22 +679,27 @@ SwUndoIdAndName * lcl_GetUndoIdAndName(const SwUndos & rUndos, sal_uInt16 nPos ) int nTmpPos = nPos + pUndoStart->GetEndOffset(); int nSubstitute = -1; - SwUndo * pTmpUndo; - do + // --> OD 2009-09-30 #i105457# + if ( nTmpPos > 0 ) + // <-- { - nTmpPos--; - pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ]; + SwUndo * pTmpUndo; + do + { + nTmpPos--; + pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ]; - if (pTmpUndo->GetEffectiveId() > UNDO_END) - nSubstitute = nTmpPos; - } - while (nSubstitute < 0 && nTmpPos > nPos); + if (pTmpUndo->GetEffectiveId() > UNDO_END) + nSubstitute = nTmpPos; + } + while (nSubstitute < 0 && nTmpPos > nPos); - if (nSubstitute >= 0) - { - SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ]; - nId = pSubUndo->GetEffectiveId(); - sStr = pSubUndo->GetComment(); + if (nSubstitute >= 0) + { + SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ]; + nId = pSubUndo->GetEffectiveId(); + sStr = pSubUndo->GetComment(); + } } } else diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index ffc831fe16e5..908fc480fe66 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -833,7 +833,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet, , m_Array( (BYTE)rSet.Count() ) { SfxItemIter aIter( rSet ); - bool bAutoStyle = true; + bool bAutoStyle = false; while( TRUE ) { diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 87522d4d59f8..3b090e875ea8 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -666,14 +666,9 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, { if( !pHistory ) pHistory = new SwHistory; - if( pAPos->nNode < pEnd->nNode && - ( ( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) || - ( pStt->nNode < pAPos->nNode || !pStt->nContent.GetIndex() ) ) ) + if (IsDestroyFrameAnchoredAtChar( + *pAPos, *pStt, *pEnd, nDelCntntType)) { - // Here we identified the objects to destroy: - // - anchored between start and end of the selection - // - anchored in start of the selection with "CheckNoContent" - // - anchored in start of sel. and the selection start at pos 0 pHistory->Add( *pFmt, nChainInsPos ); n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1; } @@ -1388,3 +1383,20 @@ String DenoteSpecialCharacters(const String & rStr) return aResult; } + +bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, + SwPosition const & rStart, SwPosition const & rEnd, + DelCntntType const nDelCntntType) +{ + + // Here we identified the objects to destroy: + // - anchored between start and end of the selection + // - anchored in start of the selection with "CheckNoContent" + // - anchored in start of sel. and the selection start at pos 0 + return (rAnchorPos.nNode < rEnd.nNode) + && ( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType) + || (rStart.nNode < rAnchorPos.nNode) + || !rStart.nContent.GetIndex() + ); +} + diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx index e2cb9fb37428..21103ebb224d 100644 --- a/sw/source/core/undo/unredln.cxx +++ b/sw/source/core/undo/unredln.cxx @@ -247,6 +247,12 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter ) // im aSaveRange steht der kopierte, sprich der originale. SwDoc& rDoc = rIter.GetDoc(); + SwPosition* pStart = rIter.pAktPam->Start(); + SwPosition* pEnd = rIter.pAktPam->End(); + + SwNodeIndex aPrevIdx( pStart->nNode, -1 ); + ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); + if( 0 == ( nsRedlineMode_t::REDLINE_SHOW_DELETE & rDoc.GetRedlineMode()) ) { // die beiden Redline Objecte suchen und diese dann anzeigen lassen, @@ -254,17 +260,17 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter ) // das Geloeschte ist versteckt, also suche das INSERT // Redline Object. Dahinter steht das Geloeschte USHORT nFnd = rDoc.GetRedlinePos( - *rDoc.GetNodes()[ nSttNode + nOffset + 1 ], + *rDoc.GetNodes()[ nSttNode + 1 ], nsRedlineType_t::REDLINE_INSERT ); ASSERT( USHRT_MAX != nFnd && nFnd+1 < rDoc.GetRedlineTbl().Count(), "kein Insert Object gefunden" ); ++nFnd; - rDoc.GetRedlineTbl()[nFnd]->Show(); - SetPaM( *rIter.pAktPam ); + rDoc.GetRedlineTbl()[nFnd]->Show( 1 ); } { SwPaM aTmp( *rIter.pAktPam->GetMark() ); + aTmp.GetMark()->nContent = 0; aTmp.SetMark(); aTmp.GetPoint()->nNode = nSaveEndNode; aTmp.GetPoint()->nContent.Assign( aTmp.GetCntntNode(), nSaveEndCntnt ); @@ -272,13 +278,52 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter ) } rDoc.DelFullPara( *rIter.pAktPam ); + + SwPaM* pPam = rIter.pAktPam; + pPam->DeleteMark(); + pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); + SwCntntNode* pCNd = pPam->GetCntntNode(); + pPam->GetPoint()->nContent.Assign(pCNd, 0 ); + pPam->SetMark(); + + pPam->GetPoint()->nNode += nOffsetTemp; + pCNd = pPam->GetCntntNode(); + pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); + + SetValues( *pPam ); + SetPaM( *rIter.pAktPam ); } void SwUndoRedlineSort::_Redo( SwUndoIter& rIter ) { SwPaM& rPam = *rIter.pAktPam; + + SwPaM* pPam = &rPam; + SwPosition* pStart = pPam->Start(); + SwPosition* pEnd = pPam->End(); + + SwNodeIndex aPrevIdx( pStart->nNode, -1 ); + ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); + xub_StrLen nCntStt = pStart->nContent.GetIndex(); + rIter.GetDoc().SortText( rPam, *pOpt ); + + pPam->DeleteMark(); + pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); + SwCntntNode* pCNd = pPam->GetCntntNode(); + xub_StrLen nLen = pCNd->Len(); + if( nLen > nCntStt ) + nLen = nCntStt; + pPam->GetPoint()->nContent.Assign(pCNd, nLen ); + pPam->SetMark(); + + pPam->GetPoint()->nNode += nOffsetTemp; + pCNd = pPam->GetCntntNode(); + pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); + + SetValues( rPam ); + SetPaM( rPam ); rPam.GetPoint()->nNode = nSaveEndNode; rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt ); diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index b09f4196d396..8103b924ae98 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -2061,6 +2061,7 @@ SwChartDataSequence::SwChartDataSequence( // which is required for some functions SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr); DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr"); + (void) pUnoTblCrsr; #endif } @@ -2111,6 +2112,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) : // which is required for some functions SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr); DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr"); + (void) pUnoTblCrsr; #endif } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 8c84dce7948a..194200bfad0c 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1032,9 +1032,11 @@ void makeRedline( SwPaM& rPaM, } SwRedline* pRedline = new SwRedline( aRedlineData, rPaM ); + RedlineMode_t nPrevMode = pRedlineAccess->GetRedlineMode( ); + pRedlineAccess->SetRedlineMode_intern(nsRedlineMode_t::REDLINE_ON); bool bRet = pRedlineAccess->AppendRedline( pRedline, false ); - pRedlineAccess->SetRedlineMode_intern(nsRedlineMode_t::REDLINE_NONE); + pRedlineAccess->SetRedlineMode_intern( nPrevMode ); if( !bRet ) throw lang::IllegalArgumentException(); } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 11b3eae5a16a..f8256a7ada0b 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2117,6 +2117,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) OTextCursorHelper* pCursor = 0; SwXTextPortion* pPortion = 0; SwXText* pText = 0; + SwXParagraph* pParagraph = 0; pRange = reinterpret_cast< SwXTextRange * >( sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); @@ -2126,6 +2127,8 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); pPortion = reinterpret_cast< SwXTextPortion * >( sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextPortion::getUnoTunnelId()) )); + pParagraph = reinterpret_cast< SwXParagraph * >( + sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXParagraph::getUnoTunnelId( ) ) ) ); if (pRange) pDoc = pRange->GetDoc(); @@ -2137,6 +2140,8 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) { pDoc = pPortion->GetCursor()->GetDoc(); } + else if ( !pDoc && pParagraph && pParagraph->GetTxtNode( ) ) + pDoc = pParagraph->GetTxtNode( )->GetDoc( ); } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 70d9560eef17..3f07ccf66b62 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2387,9 +2387,10 @@ void SAL_CALL SwXTextCursor::setAllPropertiesToDefault() // selection specific attribut ranges USHORT aResetableSetRange[] = { RES_CHRATR_BEGIN, RES_CHRATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, 0 }; SvUShortsSort aParaWhichIds; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index b7764778d31c..0d606ab2f50d 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1192,6 +1192,12 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) : m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), pMark(NULL) { + SwTable* pTable = SwTable::FindTable( &rTblFmt ); + SwTableNode* pTblNode = pTable->GetTableNode( ); + SwPosition aPosition( *pTblNode ); + SwPaM aPam( aPosition ); + + _CreateNewBookmark( aPam ); } SwXTextRange::~SwXTextRange() diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 04d073a09df3..7071eb59731d 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -719,10 +719,6 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: aResult.Result = beans::TolerantPropertySetResultType::SUCCESS; aResultVector.push_back( aResult ); } - // this assertion should never occur! - DBG_ASSERT( !aResultVector.size() || aResult.Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE, - "unknown failure while retrieving property" ); - } } catch (beans::UnknownPropertyException &) diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index b49816d9c9e3..a8426cf8b438 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -831,7 +831,6 @@ lcl_ExportHints( case RES_TXTATR_AUTOFMT: case RES_TXTATR_INETFMT: case RES_TXTATR_CHARFMT: - case RES_TXTATR_UNKNOWN_CONTAINER: break; // these are handled as properties of a "Text" portion default: DBG_ERROR("unknown attribute"); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 56e3cbacd822..7ae4b209f49f 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -66,6 +66,8 @@ #include <memory> #include <stdlib.h> +#include <iostream> + using namespace ::com::sun::star; using ::rtl::OUString; @@ -1827,19 +1829,11 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( */ if(aStartCellPam.Start()->nNode < aEndCellPam.End()->nNode) { - const SwNode& rStartNode = aStartCellPam.Start()->nNode.GetNode(); - if(!rStartNode.IsTxtNode() || - !aEndCellPam.End()->nNode.GetNode().IsTxtNode()) - { - //start and end of the cell must be on a SwTxtNode - bExcept = true; - break; - } // increment on each StartNode and decrement on each EndNode // we must reach zero at the end and must not go below zero long nOpenNodeBlock = 0; SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode; - while( ++aCellIndex < aEndCellPam.End()->nNode.GetIndex()) + while( aCellIndex < aEndCellPam.End()->nNode.GetIndex()) { if( aCellIndex.GetNode().IsStartNode() ) ++nOpenNodeBlock; @@ -1850,6 +1844,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( bExcept = true; break; } + ++aCellIndex; } if( nOpenNodeBlock != 0) { @@ -1895,7 +1890,9 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( //node border anyway } else + { bExcept = true; + } } //now check if there's a need to insert another paragraph break if( aEndCellPam.End()->nContent.GetIndex() < aEndCellPam.End()->nNode.GetNode().GetTxtNode()->Len()) @@ -1952,7 +1949,22 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( const beans::PropertyValue* pTableProperties = rTableProperties.getConstArray(); sal_Int32 nProperty = 0; for( ; nProperty < rTableProperties.getLength(); ++nProperty) - xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value ); + { + try + { + xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value ); + } + catch ( const uno::Exception e ) + { +#if DEBUG + std::clog << "Exception when setting property: "; + std::clog << rtl::OUStringToOString( pTableProperties[nProperty].Name, RTL_TEXTENCODING_UTF8 ).getStr( ); + std::clog << ". Message: "; + std::clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ); + std::clog << std::endl; +#endif + } + } //apply row properties uno::Reference< table::XTableRows > xRows = xRet->getRows(); @@ -2009,6 +2021,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( //--< #endif + //apply cell properties for( nRow = 0; nRow < rCellProperties.getLength(); ++nRow) { @@ -2021,7 +2034,8 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( uno::Reference< beans::XPropertySet > xCell( pTextTable->getCellByPosition(nCell, nRow), uno::UNO_QUERY ); for( nProperty = 0; nProperty < nCellProperties; ++nProperty) { - if(aCellProperties[nProperty].Name.equalsAsciiL( + const OUString& rName = aCellProperties[nProperty].Name; + if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "VerticalMerge"))) { //determine left border position @@ -2085,7 +2099,23 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( } } else - xCell->setPropertyValue(aCellProperties[nProperty].Name, aCellProperties[nProperty].Value); + { + try + { + xCell->setPropertyValue(rName, aCellProperties[nProperty].Value); + } + catch ( const uno::Exception e ) + { + // Apply the paragraph and char properties to the cell's content + uno::Reference< text::XText > xCellText( xCell, uno::UNO_QUERY ); + uno::Reference< text::XTextCursor > xCellCurs = xCellText->createTextCursor( ); + xCellCurs->gotoStart( false ); + xCellCurs->gotoEnd( true ); + + uno::Reference< beans::XPropertySet > xCellTextProps( xCellCurs, uno::UNO_QUERY ); + xCellTextProps->setPropertyValue( rName, aCellProperties[nProperty].Value ); + } + } } } } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 2c25ffbad82a..920c2d809f51 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2685,7 +2685,7 @@ const BitmapEx& ViewShell::GetReplacementBitmap( bool bIsErrorState ) if( !*ppRet ) { USHORT nBmpResId = - Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark() + Application::GetSettings().GetStyleSettings().GetHighContrastMode() ? nHCResId : nResId; *ppRet = new BitmapEx( SW_RES( nBmpResId ) ); } diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index aaa640de0ef4..e21433271845 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -158,7 +158,7 @@ ULONG SwReader::Read( const Reader& rOptions ) SwNodeIndex aSplitIdx( pDoc->GetNodes() ); RedlineMode_t eOld = pDoc->GetRedlineMode(); - pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE ); + RedlineMode_t ePostReadRedlineMode( nsRedlineMode_t::REDLINE_IGNORE ); // Array von FlyFormaten SwSpzFrmFmts aFlyFrmArr; @@ -170,6 +170,8 @@ ULONG SwReader::Read( const Reader& rOptions ) if( bSaveUndo ) pUndo = new SwUndoInsDoc( *pPam ); + pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE ); + SwPaM* pUndoPam = 0; if( bDocUndo || pCrsr ) { @@ -190,8 +192,15 @@ ULONG SwReader::Read( const Reader& rOptions ) xub_StrLen nEndCntnt = pCNd ? pCNd->Len() - nSttCntnt : 0; SwNodeIndex aEndPos( pPam->GetPoint()->nNode, 1 ); + pDoc->SetRedlineMode_intern( eOld ); + nError = po->Read( *pDoc, GetBaseURL(), *pPam, aFileName ); + // an ODF document may contain redline mode in settings.xml; save it! + ePostReadRedlineMode = pDoc->GetRedlineMode(); + + pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE ); + if( !IsError( nError )) // dann setzen wir das Ende mal richtig { aEndPos--; @@ -230,13 +239,27 @@ ULONG SwReader::Read( const Reader& rOptions ) const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); if( USHRT_MAX == aFlyFrmArr.GetPos( pFrmFmt) ) { - if( FLY_PAGE == rAnchor.GetAnchorId() || - ( FLY_AT_CNTNT == rAnchor.GetAnchorId() && - rAnchor.GetCntntAnchor() && - ( pUndoPam->GetPoint()->nNode == - rAnchor.GetCntntAnchor()->nNode || - pUndoPam->GetMark()->nNode == - rAnchor.GetCntntAnchor()->nNode ) ) ) + SwPosition const*const pFrameAnchor( + rAnchor.GetCntntAnchor()); + if ( (FLY_PAGE == rAnchor.GetAnchorId()) + || ( pFrameAnchor + && ( ( (FLY_AT_CNTNT == rAnchor.GetAnchorId()) + && ( (pUndoPam->GetPoint()->nNode == + pFrameAnchor->nNode) + || (pUndoPam->GetMark()->nNode == + pFrameAnchor->nNode) + ) + ) + // #i97570# also check frames anchored AT char + || ( (FLY_AUTO_CNTNT == rAnchor.GetAnchorId()) + && !IsDestroyFrameAnchoredAtChar( + *pFrameAnchor, + *pUndoPam->GetPoint(), + *pUndoPam->GetMark()) + ) + ) + ) + ) { if( bChkHeaderFooter && FLY_AT_CNTNT == rAnchor.GetAnchorId() && @@ -351,7 +374,9 @@ ULONG SwReader::Read( const Reader& rOptions ) pDoc->UpdateLinks( TRUE ); // <-- - eOld = (RedlineMode_t)(pDoc->GetRedlineMode() & ~nsRedlineMode_t::REDLINE_IGNORE); + // not insert: set the redline mode read from settings.xml + eOld = static_cast<RedlineMode_t>( + ePostReadRedlineMode & ~nsRedlineMode_t::REDLINE_IGNORE); pDoc->SetFieldsDirty(false, NULL, 0); } diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 2020efd3288e..01108a0d2567 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3755,22 +3755,22 @@ SwAttrFnTab aCSS1AttrFnTab = { /* RES_CHRATR_DUMMY1 */ 0, /* RES_CHRATR_DUMMY2 */ 0, -/* RES_TXTATR_NOLINEBREAK */ 0, -/* RES_TXTATR_NOHYPHEN */ 0, -/* RES_TXTATR_REFMARK*/ 0, +/* RES_TXTATR_REFMARK */ 0, /* RES_TXTATR_TOXMARK */ 0, -/* RES_TXTATR_CHARFMT */ 0, -/* RES_TXTATR_TWO_LINES */ 0, +/* RES_TXTATR_META */ 0, +/* RES_TXTATR_METAFIELD */ 0, +/* RES_TXTATR_AUTOFMT */ 0, +/* RES_TXTATR_INETFMT */ 0, +/* RES_TXTATR_CHARFMT */ 0, /* RES_TXTATR_CJK_RUBY */ 0, /* RES_TXTATR_UNKNOWN_CONTAINER */ 0, /* RES_TXTATR_DUMMY5 */ 0, -/* RES_TXTATR_DUMMY6 */ 0, /* RES_TXTATR_FIELD */ 0, /* RES_TXTATR_FLYCNT */ 0, /* RES_TXTATR_FTN */ 0, -/* RES_TXTATR_SOFTHYPH */ 0, -/* RES_TXTATR_HARDBLANK*/ 0, +/* RES_TXTATR_DUMMY4 */ 0, +/* RES_TXTATR_DUMMY3 */ 0, /* RES_TXTATR_DUMMY1 */ 0, // Dummy: /* RES_TXTATR_DUMMY2 */ 0, // Dummy: diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 0012d5dc0664..e788dc5da275 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -3391,22 +3391,22 @@ SwAttrFnTab aHTMLAttrFnTab = { /* RES_CHRATR_DUMMY1 */ 0, /* RES_CHRATR_DUMMY2 */ 0, -/* RES_TXTATR_DUMMY4 */ 0, -/* RES_TXTATR_INETFMT */ OutHTML_SwFmtINetFmt, -/* RES_TXTATR_REFMARK*/ 0, +/* RES_TXTATR_REFMARK */ 0, /* RES_TXTATR_TOXMARK */ 0, -/* RES_TXTATR_CHARFMT */ OutHTML_SwTxtCharFmt, -/* RES_TXTATR_TWO_LINES */ 0, +/* RES_TXTATR_META */ 0, +/* RES_TXTATR_METAFIELD */ 0, +/* RES_TXTATR_AUTOFMT */ 0, +/* RES_TXTATR_INETFMT */ OutHTML_SwFmtINetFmt, +/* RES_TXTATR_CHARFMT */ OutHTML_SwTxtCharFmt, /* RES_TXTATR_CJK_RUBY */ 0, /* RES_TXTATR_UNKNOWN_CONTAINER */ 0, /* RES_TXTATR_DUMMY5 */ 0, -/* RES_TXTATR_DUMMY6 */ 0, /* RES_TXTATR_FIELD */ OutHTML_SwFmtFld, /* RES_TXTATR_FLYCNT */ OutHTML_SwFlyCnt, /* RES_TXTATR_FTN */ OutHTML_SwFmtFtn, -/* RES_TXTATR_SOFTHYPH */ 0, -/* RES_TXTATR_HARDBLANK*/ 0, +/* RES_TXTATR_DUMMY4 */ 0, +/* RES_TXTATR_DUMMY3 */ 0, /* RES_TXTATR_DUMMY1 */ 0, // Dummy: /* RES_TXTATR_DUMMY2 */ 0, // Dummy: diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index 6b033fe73e52..fc60c857aedb 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -4251,22 +4251,22 @@ SwAttrFnTab aRTFAttrFnTab = { /* RES_CHRATR_DUMMY1 */ 0, /* RES_CHRATR_DUMMY2 */ 0, -/* RES_TXTATR_AUTOFMT */ OutRTF_SwTxtAutoFmt, -/* RES_TXTATR_INETFMT */ OutRTF_SwTxtINetFmt, // Dummy -/* RES_TXTATR_REFMARK*/ 0, // NOT USED!! OutRTF_SwRefMark, +/* RES_TXTATR_REFMARK */ 0, // NOT USED!! OutRTF_SwRefMark, /* RES_TXTATR_TOXMARK */ 0, // NOT USED!! OutRTF_SwTOXMark, -/* RES_TXTATR_CHARFMT */ OutRTF_SwTxtCharFmt, -/* RES_TXTATR_TWO_LINES */ 0, +/* RES_TXTATR_META */ 0, +/* RES_TXTATR_METAFIELD */ 0, +/* RES_TXTATR_AUTOFMT */ OutRTF_SwTxtAutoFmt, +/* RES_TXTATR_INETFMT */ OutRTF_SwTxtINetFmt, +/* RES_TXTATR_CHARFMT */ OutRTF_SwTxtCharFmt, /* RES_TXTATR_CJK_RUBY */ OutRTF_SwTxtRuby, /* RES_TXTATR_UNKNOWN_CONTAINER */ 0, /* RES_TXTATR_DUMMY5 */ 0, -/* RES_TXTATR_DUMMY6 */ 0, /* RES_TXTATR_FIELD */ OutRTF_SwField, /* RES_TXTATR_FLYCNT */ OutRTF_SwFlyCntnt, /* RES_TXTATR_FTN */ OutRTF_SwFtn, -/* RES_TXTATR_SOFTHYPH */ 0, // old attr. - coded now by character -/* RES_TXTATR_HARDBLANK*/ 0, +/* RES_TXTATR_DUMMY4 */ 0, +/* RES_TXTATR_DUMMY3 */ 0, /* RES_TXTATR_DUMMY1 */ 0, // Dummy: /* RES_TXTATR_DUMMY2 */ 0, // Dummy: diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx index 374ca58b6799..eb5618bcf967 100644 --- a/sw/source/filter/ww1/w1class.cxx +++ b/sw/source/filter/ww1/w1class.cxx @@ -257,7 +257,7 @@ Ww1StyleSheet::Ww1StyleSheet(Ww1Fib& _rFib) DBG_ASSERT(cbStshf==0, "Ww1StyleSheet"); bOK = cbStshf == 0; } - delete del; + delete [] del; } USHORT Ww1StyleSheet::ReadNames( BYTE*& p, USHORT& rnCountBytes ) diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx index 4021d449c286..9f177765a4f7 100644 --- a/sw/source/filter/ww1/w1filter.cxx +++ b/sw/source/filter/ww1/w1filter.cxx @@ -1899,11 +1899,11 @@ void Ww1Picture::WriteBmp(SvStream& rOut) nSize -= sizeof(BYTE); } if(rOut.Write(pBuf, padx) != padx){ - delete pBuf; + delete [] pBuf; goto error; } } - delete pBuf; + delete [] pBuf; } #else for (j=0;nSize>0&&j<maxy;j++) diff --git a/sw/source/filter/ww8/WW8FibData.cxx b/sw/source/filter/ww8/WW8FibData.cxx new file mode 100644 index 000000000000..fdf54c25b216 --- /dev/null +++ b/sw/source/filter/ww8/WW8FibData.cxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ + +#include "WW8FibData.hxx" + +namespace ww8 +{ +WW8FibData::WW8FibData() + : m_bReadOnlyRecommended(false), + m_bWriteReservation(false) +{ +} + +WW8FibData::~WW8FibData() +{ +} + +void WW8FibData::setReadOnlyRecommended(bool bReadOnlyRecommended) +{ + m_bReadOnlyRecommended = bReadOnlyRecommended; +} + +void WW8FibData::setWriteReservation(bool bWriteReservation) +{ + m_bWriteReservation = bWriteReservation; +} + +bool WW8FibData::getReadOnlyRecommended() const +{ + return m_bReadOnlyRecommended; +} + +bool WW8FibData::getWriteReservation() const +{ + return m_bWriteReservation; +} +} diff --git a/sw/source/filter/ww8/WW8FibData.hxx b/sw/source/filter/ww8/WW8FibData.hxx new file mode 100644 index 000000000000..597ab16a7ad5 --- /dev/null +++ b/sw/source/filter/ww8/WW8FibData.hxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ +#ifndef INCLUDED_WW8_FIB_DATA_HXX +#define INCLUDED_WW8_FIB_DATA_HXX +#include <IDocumentExternalData.hxx> + +namespace ww8 +{ +class WW8FibData : public ::sw::ExternalData +{ + bool m_bReadOnlyRecommended; + bool m_bWriteReservation; + +public: + WW8FibData(); + virtual ~WW8FibData(); + + void setReadOnlyRecommended(bool bReadOnlyRecommended); + void setWriteReservation(bool bWriteReservation); + + bool getReadOnlyRecommended() const; + bool getWriteReservation() const; +}; +} + +#endif // INCLUDED_WW8_FIB_DATA_HXX diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx new file mode 100644 index 000000000000..b03ec823292f --- /dev/null +++ b/sw/source/filter/ww8/WW8Sttbf.cxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ww8par2.hxx,v $ + * $Revision: 1.47.214.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ + +#include <iostream> +#include <dbgoutsw.hxx> +#include "WW8Sttbf.hxx" + +namespace ww8 +{ + WW8Struct::WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize) + : mn_offset(0), mn_size(nSize) + { + rSt.Seek(nPos); + + mp_data.reset(new BYTE[nSize]); + rSt.Read(mp_data.get(), nSize); + } + + WW8Struct::WW8Struct(WW8Struct * pStruct, sal_uInt32 nPos, sal_uInt32 nSize) + : mp_data(pStruct->mp_data), mn_offset(pStruct->mn_offset + nPos), + mn_size(nSize) + { + } + + WW8Struct::~WW8Struct() + { + } + + sal_uInt8 WW8Struct::getU8(sal_uInt32 nOffset) + { + sal_uInt8 nResult = 0; + + if (nOffset < mn_size) + { + nResult = mp_data[mn_offset + nOffset]; + } + + return nResult; + } + + ::rtl::OUString WW8Struct::getUString(sal_uInt32 nOffset, + sal_uInt32 nCount) + { + ::rtl::OUString aResult; + + if (nCount > 0) + { + rtl_uString * pNew = 0; + rtl_uString_newFromStr_WithLength + (&pNew, reinterpret_cast<const sal_Unicode *>(&mp_data[mn_offset + nOffset]), + nCount); + + aResult = rtl::OUString(pNew); + } + +#ifdef DEBUG + char sBuffer[256]; + snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"", + nOffset, nCount); + ::std::clog << "<WW8Struct-getUString" << sBuffer << ">" + << dbg_out(aResult) << "</WW8Struct-getUString>" + << ::std::endl; +#endif + + return aResult; + + } + + ::rtl::OUString WW8Struct::getString(sal_uInt32 nOffset, + sal_uInt32 nCount) + { + ::rtl::OUString aResult; + + if (nCount > 0) + { + ::rtl::OString aOStr(reinterpret_cast<const sal_Char *>(&mp_data[mn_offset + nOffset]), + nCount); + ::rtl::OUString aOUStr(rtl::OStringToOUString(aOStr, RTL_TEXTENCODING_ASCII_US)); + aResult = rtl::OUString(aOUStr); + } + +#ifdef DEBUG + char sBuffer[256]; + snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"", + nOffset, nCount); + ::std::clog << "<WW8Struct-getString " << sBuffer << ">" + << dbg_out(aResult) << "</WW8Struct-getUString>" + << ::std::endl; +#endif + + return aResult; + } +} diff --git a/sw/source/filter/ww8/WW8Sttbf.hxx b/sw/source/filter/ww8/WW8Sttbf.hxx new file mode 100644 index 000000000000..cb3c43cee86c --- /dev/null +++ b/sw/source/filter/ww8/WW8Sttbf.hxx @@ -0,0 +1,148 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ww8par2.hxx,v $ + * $Revision: 1.47.214.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ + +#include <vector> +#include <boost/shared_ptr.hpp> +#include <boost/shared_array.hpp> +#include <tools/solar.h> +#include <rtl/ustring.hxx> +#include <tools/stream.hxx> +#include <IDocumentExternalData.hxx> + +namespace ww8 +{ + typedef boost::shared_array<BYTE> DataArray_t; + +class WW8Struct : public ::sw::ExternalData + { + DataArray_t mp_data; + sal_uInt32 mn_offset; + sal_uInt32 mn_size; + + public: + WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize); + WW8Struct(WW8Struct * pStruct, sal_uInt32 nPos, sal_uInt32 nSize); + virtual ~WW8Struct(); + + sal_uInt8 getU8(sal_uInt32 nOffset); + + sal_uInt16 getU16(sal_uInt32 nOffset) + { return getU8(nOffset) + (getU8(nOffset + 1) << 8); } + + sal_uInt32 getU32(sal_uInt32 nOffset) + { return getU16(nOffset) + (getU16(nOffset + 1) << 16); } + + ::rtl::OUString getUString(sal_uInt32 nOffset, sal_uInt32 nCount); + + ::rtl::OUString getString(sal_uInt32 nOffset, sal_uInt32 nCount); + }; + +typedef ::std::vector<rtl::OUString> StringVector_t; + template <class T> + class WW8Sttb : public WW8Struct + { + typedef ::boost::shared_ptr< void > ExtraPointer_t; + typedef ::std::vector< ExtraPointer_t > ExtrasVector_t; + bool bDoubleByteCharacters; + StringVector_t m_Strings; + ExtrasVector_t m_Extras; + + public: + WW8Sttb(SvStream& rSt, INT32 nPos, sal_uInt32 nSize); + virtual ~WW8Sttb(); + + sal_uInt32 getCount() const; + ::rtl::OUString getEntry(sal_uInt32 nEntry) const + { + return m_Strings[nEntry]; + } + + StringVector_t & getStrings() + { + return m_Strings; + } + + const T * getExtra(sal_uInt32 nEntry) const + { + return dynamic_cast<const T *> (m_Extras[nEntry].get()); + } + }; + + template <class T> + WW8Sttb<T>::WW8Sttb(SvStream& rSt, INT32 nPos, sal_uInt32 nSize) + : WW8Struct(rSt, nPos, nSize), bDoubleByteCharacters(false) + { + sal_uInt32 nOffset = 0; + + if (getU16(nOffset) == 0xffff) + { + bDoubleByteCharacters = true; + nOffset += 2; + } + + sal_uInt16 nCount = getU16(nOffset); + sal_uInt16 ncbExtra = getU16(nOffset + 2); + + nOffset += 4; + for (sal_uInt16 i = 0; i < nCount; i++) + { + if (bDoubleByteCharacters) + { + sal_uInt16 nStrLen = getU16(nOffset); + + m_Strings.push_back(getUString(nOffset +2, nStrLen)); + + nOffset += 2 + 2 * nStrLen; + } + else + { + sal_uInt8 nStrLen = getU8(nOffset); + + m_Strings.push_back(getUString(nOffset, nStrLen)); + + nOffset += 1 + nStrLen; + } + + if (ncbExtra > 0) + { + ExtraPointer_t pExtra(new T(this, nOffset, ncbExtra)); + m_Extras.push_back(pExtra); + + nOffset += ncbExtra; + } + } + } + + template <class T> + WW8Sttb<T>::~WW8Sttb() + { + } +} diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk index 6697ceaec4b1..164a8fef28d6 100644 --- a/sw/source/filter/ww8/makefile.mk +++ b/sw/source/filter/ww8/makefile.mk @@ -69,7 +69,9 @@ EXCEPTIONSFILES = \ $(SLO)$/writerwordglue.obj \ $(SLO)$/ww8scan.obj \ $(SLO)$/WW8TableInfo.obj \ - $(SLO)$/WW8FFData.obj + $(SLO)$/WW8FFData.obj \ + $(SLO)$/WW8Sttbf.obj \ + $(SLO)$/WW8FibData.obj SLOFILES = \ @@ -96,7 +98,9 @@ SLOFILES = \ $(SLO)$/writerhelper.obj \ $(SLO)$/writerwordglue.obj \ $(SLO)$/WW8TableInfo.obj \ - $(SLO)$/WW8FFData.obj + $(SLO)$/WW8FFData.obj \ + $(SLO)$/WW8Sttbf.obj \ + $(SLO)$/WW8FibData.obj # --- Tagets ------------------------------------------------------- diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 53587bca451c..c015c13fc65b 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -117,6 +117,8 @@ #include <svx/mscodec.hxx> #include <osl/time.h> #include <rtl/random.h> +#include "WW8Sttbf.hxx" +#include "WW8FibData.hxx" using namespace sw::util; using namespace sw::types; @@ -2535,6 +2537,8 @@ void WW8Export::WriteMainText() #endif } +typedef ww8::WW8Sttb< ww8::WW8Struct > WW8SttbAssoc; + void WW8Export::WriteFkpPlcUsw() { if( !bWrtWW8 ) @@ -2656,9 +2660,36 @@ void WW8Export::WriteFkpPlcUsw() ExportDopTypography(pDop->doptypography); WriteDop( *this ); // Document-Properties + + // Write SttbfAssoc + WW8SttbAssoc * pSttbfAssoc = dynamic_cast<WW8SttbAssoc *> + (pDoc->getExternalData(::sw::STTBF_ASSOC).get()); + ::std::vector<String> aStrings; + + ::ww8::StringVector_t & aSttbStrings = pSttbfAssoc->getStrings(); + ::ww8::StringVector_t::const_iterator aItEnd = aSttbStrings.end(); + for (::ww8::StringVector_t::const_iterator aIt = aSttbStrings.begin(); + aIt != aItEnd; aIt++) + { + String aStr(aIt->getStr()); + aStrings.push_back(aStr); + } + + WriteAsStringTable(aStrings, pFib->fcSttbfAssoc, + pFib->lcbSttbfAssoc); + } Strm().Seek( 0 ); + // Reclaim stored FIB data from document. + ::ww8::WW8FibData * pFibData = dynamic_cast<ww8::WW8FibData *> + (pDoc->getExternalData(::sw::FIB).get()); + + pFib->fReadOnlyRecommended = + pFibData->getReadOnlyRecommended() ? 1 : 0; + pFib->fWriteReservation = + pFibData->getWriteReservation() ? 1 : 0; + pFib->Write( Strm() ); // FIB } @@ -3479,7 +3510,6 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) const sal_uInt8 aFldData[] = { - 0,0,0,0, // len of struct 0x44,0, // the start of "next" data 0,0,0,0,0,0,0,0,0,0, // PIC-Structure! /10 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // | /16 @@ -3487,7 +3517,8 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // | /16 0,0,0,0, // / /4 }; - int slen = sizeof( aFldData ) + sal_uInt32 slen=sizeof(sal_uInt32) + + sizeof(aFldData) + sizeof( aFldHeader ) + 2*ffname.getLength() + 4 + 2*ffdeftext.getLength() + 4 @@ -3496,12 +3527,11 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) + 2*ffstattext.getLength() + 4 + 2*ffentrymcr.getLength() + 4 + 2*ffexitmcr.getLength() + 4; -#ifdef OSL_BIGENDIAN - slen = SWAPLONG( slen ); -#endif // OSL_BIGENDIAN - *( (sal_uInt32 *)aFldData ) = slen; + + *pDataStrm << slen; + int len = sizeof( aFldData ); - OSL_ENSURE( len == 0x44, "SwWW8Writer::WriteFormData(..) - wrong aFldData length" ); + OSL_ENSURE( len == 0x44-sizeof(sal_uInt32), "SwWW8Writer::WriteFormData(..) - wrong aFldData length" ); pDataStrm->Write( aFldData, len ); len = sizeof( aFldHeader ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 241e339003d2..599c6b3ea1b6 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -138,6 +138,8 @@ #include <dbgoutsw.hxx> #endif +#include "WW8Sttbf.hxx" +#include "WW8FibData.hxx" #define MM_250 1417 // WW-Default fuer Hor. Seitenraender: 2.5 cm #define MM_200 1134 // WW-Default fuer u.Seitenrand: 2.0 cm @@ -3740,6 +3742,34 @@ ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) if (mbNewDoc && pStg && !pGloss) ReadDocInfo(); + ::ww8::WW8FibData * pFibData = new ::ww8::WW8FibData(); + + if (pWwFib->fReadOnlyRecommended) + pFibData->setReadOnlyRecommended(true); + else + pFibData->setReadOnlyRecommended(false); + + if (pWwFib->fWriteReservation) + pFibData->setWriteReservation(true); + else + pFibData->setWriteReservation(false); + + ::sw::tExternalDataPointer pExternalFibData(pFibData); + + rDoc.setExternalData(::sw::FIB, pExternalFibData); + + ::sw::tExternalDataPointer pSttbfAsoc + (new ::ww8::WW8Sttb<ww8::WW8Struct>(*pTableStream, pWwFib->fcSttbfAssoc, pWwFib->lcbSttbfAssoc)); + + rDoc.setExternalData(::sw::STTBF_ASSOC, pSttbfAsoc); + + if (pWwFib->fWriteReservation || pWwFib->fReadOnlyRecommended) + { + SwDocShell * pDocShell = rDoc.GetDocShell(); + if (pDocShell) + pDocShell->SetReadOnlyUI(sal_True); + } + pPaM = new SwPaM(rPos); pCtrlStck = new SwWW8FltControlStack( &rDoc, nFieldFlags, *this ); @@ -4349,7 +4379,7 @@ ULONG SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss) sal_uInt8 *pIn = new sal_uInt8[nUnencryptedHdr]; pStrm->Read(pIn, nUnencryptedHdr); aDecryptMain.Write(pIn, nUnencryptedHdr); - delete pIn; + delete [] pIn; DecryptXOR(aCtx, *pStrm, aDecryptMain); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 3a1f6e96c651..f20c13889f27 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -5488,7 +5488,8 @@ WW8Fib::WW8Fib(SvStream& rSt, BYTE nWantedVersion, UINT32 nOffset) cQuickSaves = ( aBits1 & 0xf0 ) >> 4; fEncrypted = aBits2 & 0x01 ; fWhichTblStm= ( aBits2 & 0x02 ) >> 1; - // dummy = ( aBits2 & 0x0e ) >> 1; + fReadOnlyRecommended = (aBits2 & 0x4) >> 2; + fWriteReservation = (aBits2 & 0x8) >> 3; fExtChar = ( aBits2 & 0x10 ) >> 4; // dummy = ( aBits2 & 0x20 ) >> 5; fFarEast = ( aBits2 & 0x40 ) >> 6; // #i90932# @@ -5661,6 +5662,12 @@ bool WW8Fib::WriteHeader(SvStream& rStrm) nBits16 |= (0xf0 & ( cQuickSaves << 4 )); if( fEncrypted ) nBits16 |= 0x0100; if( fWhichTblStm ) nBits16 |= 0x0200; + + if (fReadOnlyRecommended) + nBits16 |= 0x0400; + if (fWriteReservation) + nBits16 |= 0x0800; + if( fExtChar ) nBits16 |= 0x1000; if( fFarEast ) nBits16 |= 0x4000; // #i90932# if( fObfuscated ) nBits16 |= 0x8000; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 2bcf97819f21..3547eaf99391 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -1033,6 +1033,8 @@ public: UINT16 cQuickSaves :4; // 00F0 count of times file was quicksaved UINT16 fEncrypted :1; //0100 1 if file is encrypted, 0 if not UINT16 fWhichTblStm :1; //0200 When 0, this fib refers to the table stream + UINT16 fReadOnlyRecommended :1; + UINT16 fWriteReservation :1; // named "0Table", when 1, this fib refers to the // table stream named "1Table". Normally, a file // will have only one table stream, but under unusual diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 0c2a5cec8f71..cd3c5d1734d4 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -41,13 +41,9 @@ #include <com/sun/star/xforms/XFormsSupplier.hpp> #include <svx/svdmodel.hxx> #include <svx/svdpage.hxx> -#ifndef _XMLGRHLP_HXX -#ifndef _XMLGRHLP_HXX #include <svx/xmlgrhlp.hxx> -#endif #include <svx/xmleohlp.hxx> #include <svx/xmlgrhlp.hxx> -#endif #include <svx/eeitem.hxx> #include <svx/svddef.hxx> #include <xmloff/nmspmap.hxx> @@ -66,9 +62,7 @@ #include <xmltexte.hxx> #include <xmlexp.hxx> #include <sfx2/viewsh.hxx> -#ifndef _COMPHELPER_PROCESSFACTORYHXX_ #include <comphelper/processfactory.hxx> -#endif #include <docary.hxx> #include <svx/unolingu.hxx> #include <svx/forbiddencharacterstable.hxx> @@ -326,13 +320,15 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) // figures given above // The styles in pDoc also count the default style that never // gets exported -> subtract one. - sal_Int32 nRef = 1; + sal_Int32 nRef = 1; // meta.xml nRef += pDoc->GetCharFmts()->Count() - 1; nRef += pDoc->GetFrmFmts()->Count() - 1; nRef += pDoc->GetTxtFmtColls()->Count() - 1; // nRef += pDoc->GetPageDescCnt(); - nRef += aDocStat.nPara; - pProgress->SetReference( 2*nRef ); + nRef *= 2; // for the above styles, xmloff will increment by 2! + // #i93174#: count all paragraphs for the progress bar + nRef += aDocStat.nAllPara; // 1: only content, no autostyle + pProgress->SetReference( nRef ); pProgress->SetValue( 0 ); } } diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index f4a4a676c9a2..8a2586392a30 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -38,16 +38,11 @@ #include "xmlexpit.hxx" #include <xmloff/nmspmap.hxx> #include <xmloff/XMLTextListAutoStylePool.hxx> -#ifndef _XMLOFF_XMLTEXTMASTERPAGEEXPORT #include <xmloff/XMLTextMasterPageExport.hxx> -#endif -#ifndef _XMLOFF_TXTPRMAP_HXX #include <xmloff/txtprmap.hxx> -#endif #include <xmloff/xmlaustp.hxx> #include <xmloff/families.hxx> -#include <xmloff/ProgressBarHelper.hxx> #include <format.hxx> #include <fmtpdsc.hxx> #include <pagedesc.hxx> @@ -58,6 +53,7 @@ #include "xmlexp.hxx" #include <SwStyleNameMapper.hxx> + using ::rtl::OUString; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index f17af2f8061a..00219b8d9cdf 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -295,7 +295,7 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare #ifdef MSC #pragma warning (default : 4355) #endif - m_aImageList( SW_RES( GetSettings().GetStyleSettings().GetWindowColor().IsDark() ? ILIST_HC : ILIST) ), + m_aImageList( SW_RES( GetSettings().GetStyleSettings().GetHighContrastMode() ? ILIST_HC : ILIST) ), m_sTask( SW_RES( ST_TASK )), m_sStatus( SW_RES( ST_STATUS )), m_sEstablish( SW_RES( ST_ESTABLISH )), diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 4b85042d0003..114a57215d10 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1763,7 +1763,7 @@ void SwMarkPreview::InitColors( void ) const StyleSettings& rSettings = GetSettings().GetStyleSettings(); m_aBgCol = Color( rSettings.GetWindowColor() ); - BOOL bHC = m_aBgCol.IsDark(); + BOOL bHC = rSettings.GetHighContrastMode(); m_aLineCol = bHC? SwViewOption::GetFontColor() : Color( COL_BLACK ); m_aShadowCol = bHC? m_aBgCol : rSettings.GetShadowColor(); m_aTxtCol = bHC? SwViewOption::GetFontColor() : Color( COL_GRAY ); diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx index ca3489b99776..d70dea638297 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.cxx +++ b/sw/source/ui/dbui/mailmergechildwindow.cxx @@ -103,7 +103,7 @@ SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings, m_aBackTB(this, SW_RES( TB_BACK )) { m_aBackTB.SetSelectHdl(LINK(this, SwMailMergeChildWin, BackHdl)); - sal_uInt16 nIResId = GetSettings().GetStyleSettings().GetWindowColor().IsDark() ? + sal_uInt16 nIResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? ILIST_TBX_HC : ILIST_TBX; ResId aResId( nIResId, *pSwResMgr ); ImageList aIList(aResId); @@ -639,7 +639,7 @@ void SwSendMailDialog::IterateMails() { if(!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail )) { - ImageList& rImgLst = GetSettings().GetStyleSettings().GetWindowColor().IsDark() ? + ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? m_aImageListHC : m_aImageList; Image aInsertImg = rImgLst.GetImage( FN_FORMULA_CANCEL ); @@ -747,7 +747,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag Application::PostUserEvent( STATIC_LINK( this, SwSendMailDialog, StopSendMails ), this ); } - ImageList& rImgLst = GetSettings().GetStyleSettings().GetWindowColor().IsDark() ? + ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? m_aImageListHC : m_aImageList; Image aInsertImg = rImgLst.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL ); diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 75b24153573e..6bea77137ac6 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -154,14 +154,6 @@ SwPostItMgr::SwPostItMgr(SwView* pView) mbWaitingForCalcRects = true; mnEventId = Application::PostUserEvent( LINK( this, SwPostItMgr, CalcHdl), 0 ); } - - //#i# - if (HasNotes() && !mpWrtShell->GetViewOptions()->IsPostIts()) - { - SfxRequest aRequest(mpView->GetViewFrame(),FN_VIEW_NOTES); - mpView->ExecViewOptions(aRequest); - } - } SwPostItMgr::~SwPostItMgr() diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index 01b6bc394b5c..c54911294912 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -107,7 +107,7 @@ SwEnvPrtPage::~SwEnvPrtPage() IMPL_LINK( SwEnvPrtPage, ClickHdl, Button *, EMPTYARG ) { - sal_Bool bHC = GetDisplayBackground().GetColor().IsDark(); + sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); if (aBottomButton.IsChecked()) { // Briefumschlaege von unten diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 1531df836622..8603497ecaca 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -460,7 +460,7 @@ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl) { aListItemsLB.SetUpdateMode(FALSE); if(pControl == &aListAddPB || - pControl == &aListItemED && aListAddPB.IsEnabled()) + (pControl == &aListItemED && aListAddPB.IsEnabled())) { String sEntry(aListItemED.GetText()); aListItemsLB.InsertEntry(sEntry); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 3225e120248a..dc9fe2d1bf2e 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2641,8 +2641,8 @@ void BmpWindow::Paint( const Rectangle& ) aGraphic.Draw( this, aPntPos, aPntSz ); else { - bool bIsDark = ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() != FALSE ); - DrawBitmapEx( aPntPos, aPntSz, bIsDark ? aBmpHC : aBmp ); + bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + DrawBitmapEx( aPntPos, aPntSz, bHC ? aBmpHC : aBmp ); } } diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index f73d977969ab..b3828797fc07 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -748,7 +748,7 @@ void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt ) ---------------------------------------------------------------------------*/ void SwWrapTabPage::ApplyImageList() { - ImageList& rImgLst = GetDisplayBackground().GetColor().IsDark() ? + ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? aWrapILH : aWrapIL; aWrapThroughRB.SetModeRadioImage(rImgLst.GetImage(IMG_THROUGH)); diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 865908568cd6..771836c6ccd5 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -428,7 +428,7 @@ bGrammarResults(false) sal_Int16 nStringCount = static_cast< sal_Int16 >( aSuggestions.getLength() ); SvtLinguConfig aCfg; - const bool bIsDark = Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark(); + const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); PopupMenu *pMenu = GetPopupMenu(MN_AUTOCORR); pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); @@ -440,7 +440,7 @@ bGrammarResults(false) uno::Reference< container::XNamed > xNamed( xSpellAlt, uno::UNO_QUERY ); if (xNamed.is()) { - aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName(), bIsDark ); + aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName(), bHC ); aImage = Image( lcl_GetImageFromPngUrl( aSuggestionImageUrl ) ); } @@ -529,7 +529,7 @@ bGrammarResults(false) if (xSvcInfo.is()) { OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage( - xSvcInfo->getImplementationName(), bIsDark) ); + xSvcInfo->getImplementationName(), bHC) ); if (aDictionaryImageUrl.getLength() > 0) { Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) ); @@ -583,7 +583,7 @@ bGrammarResults(false) uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface(); Image rImg = ::GetImage( xFrame, ::rtl::OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False, - Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark() ); + Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); SetItemImage( MN_SPELLING, rImg ); ////////////////////////////////////////////////////////////////////////////////// @@ -717,7 +717,7 @@ aInfo16( SW_RES(IMG_INFO_16) ) uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame()->GetFrameInterface(); Image rImg = ::GetImage( xFrame, ::rtl::OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False, - Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark() ); + Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); SetItemImage( MN_SPELLING, rImg ); ////////////////////////////////////////////////////////////////////////////////// diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index 07745f3c01bb..764d83a8e8e7 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -95,10 +95,10 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind ) InsertWindow( ED_FORMULA, &aEdit); SetHelpId(ED_FORMULA, HID_EDIT_FORMULA); - BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); - SetItemImage( FN_FORMULA_CALC, pManager->GetImage(FN_FORMULA_CALC, bDark )); - SetItemImage( FN_FORMULA_CANCEL, pManager->GetImage(FN_FORMULA_CANCEL, bDark )); - SetItemImage( FN_FORMULA_APPLY, pManager->GetImage(FN_FORMULA_APPLY, bDark )); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + SetItemImage( FN_FORMULA_CALC, pManager->GetImage(FN_FORMULA_CALC, bHC )); + SetItemImage( FN_FORMULA_CANCEL, pManager->GetImage(FN_FORMULA_CANCEL, bHC )); + SetItemImage( FN_FORMULA_APPLY, pManager->GetImage(FN_FORMULA_APPLY, bHC )); SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | TIB_DROPDOWNONLY ); SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl )); @@ -156,12 +156,11 @@ void SwInputWindow::DataChanged( const DataChangedEvent& rDCEvt ) // update item images SwModule *pMod = SW_MOD(); SfxImageManager *pImgMgr = SfxImageManager::GetImageManager( pMod ); - //!! Don't use display-background to check for IsDark !! - BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); // - SetItemImage( FN_FORMULA_CALC, pImgMgr->GetImage(FN_FORMULA_CALC, bDark )); - SetItemImage( FN_FORMULA_CANCEL, pImgMgr->GetImage(FN_FORMULA_CANCEL, bDark )); - SetItemImage( FN_FORMULA_APPLY, pImgMgr->GetImage(FN_FORMULA_APPLY, bDark )); + SetItemImage( FN_FORMULA_CALC, pImgMgr->GetImage(FN_FORMULA_CALC, bHC )); + SetItemImage( FN_FORMULA_CANCEL, pImgMgr->GetImage(FN_FORMULA_CANCEL, bHC )); + SetItemImage( FN_FORMULA_APPLY, pImgMgr->GetImage(FN_FORMULA_APPLY, bHC )); } ToolBox::DataChanged( rDCEvt ); diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index c0f248dfcd66..51e818604dae 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -115,7 +115,7 @@ void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException) Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages(), - rTbx.GetDisplayBackground().GetColor().IsDark() ); + rTbx.GetSettings().GetStyleSettings().GetHighContrastMode() ); rTbx.SetItemImage(GetId(), aImage); rTbx.Invalidate(); @@ -146,11 +146,11 @@ void SwTbxInsertCtrl::StateChanged( USHORT /*nSID*/, rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nId )); + ToolBox& rBox = GetToolBox(); Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages(), - GetToolBox().GetDisplayBackground().GetColor().IsDark() ); - ToolBox& rBox = GetToolBox(); + rBox.GetSettings().GetStyleSettings().GetHighContrastMode() ); rBox.SetItemImage(GetId(), aImage); rBox.SetItemImageMirrorMode( GetId(), FALSE ); rBox.SetItemImageAngle( GetId(), pItem->GetRotation() ); @@ -572,7 +572,7 @@ void SwScrollNaviPopup::DataChanged( const DataChangedEvent& rDCEvt ) ---------------------------------------------------------------------------*/ void SwScrollNaviPopup::ApplyImageList() { - ImageList& rImgLst = aToolBox.GetDisplayBackground().GetColor().IsDark() ? + ImageList& rImgLst = aToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ? aIListH : aIList; for(USHORT i = 0; i < NID_COUNT; i++) { @@ -746,7 +746,7 @@ SwNaviImageButton::SwNaviImageButton( FreeResource(); SetStyle(GetStyle()|WB_NOPOINTERFOCUS); SetQuickHelpText(sQuickText); - SetModeImage( GetDisplayBackground().GetColor().IsDark() ? aImageH : aImage); + SetModeImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImageH : aImage); } /* -----------------------------2002/07/05 9:41------------------------------- @@ -755,7 +755,7 @@ void SwNaviImageButton::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - SetModeImage( GetDisplayBackground().GetColor().IsDark() ? aImageH : aImage); + SetModeImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImageH : aImage); Window::DataChanged( rDCEvt ); } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 77de4c0821ff..977dc77c98d3 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -488,9 +488,10 @@ void SwTextShell::Execute(SfxRequest &rReq) RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1, RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 }; diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index bfdb2b1d2460..ed6d61898804 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -576,17 +576,17 @@ void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, break; case HANDLE_PRINTSET_PROSPECT_RTL: { - rValue <<= mpPrtOpt->IsPrintProspect_RTL(); + bBoolVal = mpPrtOpt->IsPrintProspect_RTL(); } break; case HANDLE_PRINTSET_PLACEHOLDER: { - rValue <<= mpPrtOpt->IsPrintTextPlaceholder(); + bBoolVal = mpPrtOpt->IsPrintTextPlaceholder(); } break; case HANDLE_PRINTSET_HIDDEN_TEXT: { - rValue <<= mpPrtOpt->IsPrintHiddenText(); + bBoolVal = mpPrtOpt->IsPrintHiddenText(); } break; default: diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index db81543fb883..fe3d8639bf84 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3506,7 +3506,7 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix) if(USHRT_MAX != nImgId) { nImgId += 20000; - BOOL bHighContrast = Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark(); + BOOL bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); ImageList aEntryImages( SW_RES(bHighContrast ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP) ); const Image& rImage = aEntryImages.GetImage( nImgId ); Bitmap aBitmap( rImage.GetBitmapEx().GetBitmap() ); diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index e86270c55e12..1660f7da38c5 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -1354,7 +1354,7 @@ void SwContentTree::Display( sal_Bool bActive ) { if(!bIsImageListInitialized) { - USHORT nResId = GetDisplayBackground().GetColor().IsDark() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; + USHORT nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; aEntryImages = ImageList(SW_RES(nResId)); bIsImageListInitialized = sal_True; } @@ -3257,7 +3257,7 @@ void SwContentTree::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - USHORT nResId = GetDisplayBackground().GetColor().IsDark() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; + USHORT nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; aEntryImages = ImageList(SW_RES(nResId)); FindActiveTypeAndRemoveUserData(); Display(sal_True); diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index 613bbac403b2..eca568ca60a2 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -728,7 +728,7 @@ void SwGlobalTree::Display(BOOL bOnlyUpdateUserData) { if(!bIsImageListInitialized) { - USHORT nResId = GetDisplayBackground().GetColor().IsDark() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; + USHORT nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; aEntryImages = ImageList(SW_RES(nResId)); bIsImageListInitialized = TRUE; } @@ -1396,7 +1396,7 @@ void SwGlobalTree::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - USHORT nResId = GetDisplayBackground().GetColor().IsDark() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; + USHORT nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; aEntryImages = ImageList(SW_RES(nResId)); Update(sal_True); } diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index eb3500ea59c4..4776ae5b6bdc 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -1034,8 +1034,8 @@ void SwNavigationPI::StateChanged( USHORT nSID, SfxItemState /*eState*/, aContentTree.SetActiveShell(pWrtShell); BOOL bGlobal = IsGlobalDoc(); aContentToolBox.EnableItem(FN_GLOBAL_SWITCH, bGlobal); - if(!bGlobal && IsGlobalMode() || - !IsGlobalMode() && pConfig->IsGlobalActive()) + if( (!bGlobal && IsGlobalMode()) || + (!IsGlobalMode() && pConfig->IsGlobalActive()) ) { ToggleTree(); } @@ -1375,7 +1375,7 @@ void SwNavigationPI::SetRegionDropMode(USHORT nNewMode) else if(nRegionMode == REGION_MODE_EMBEDDED) nDropId = FN_DROP_REGION_COPY; - ImageList& rImgLst = aContentToolBox.GetDisplayBackground().GetColor().IsDark() + ImageList& rImgLst = aContentToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ? aContentImageListH : aContentImageList; aContentToolBox.SetItemImage( FN_DROP_REGION, @@ -1531,7 +1531,7 @@ void SwNavigationPI::InitImageList() { USHORT k; - ImageList& rImgLst = aContentToolBox.GetDisplayBackground().GetColor().IsDark() ? + ImageList& rImgLst = aContentToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ? aContentImageListH : aContentImageList; for( k = 0; k < aContentToolBox.GetItemCount(); k++) aContentToolBox.SetItemImage(aContentToolBox.GetItemId(k), diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx index 2741b668844b..9a8526c941b5 100644 --- a/sw/source/ui/utlui/viewlayoutctrl.cxx +++ b/sw/source/ui/utlui/viewlayoutctrl.cxx @@ -78,13 +78,13 @@ SwViewLayoutControl::SwViewLayoutControl( USHORT _nSlotId, USHORT _nId, StatusBa { mpImpl->mnState = 0; - const sal_Bool bIsDark = GetStatusBar().GetBackground().GetColor().IsDark(); - mpImpl->maImageSingleColumn = Image( bIsDark ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) ); - mpImpl->maImageSingleColumn_Active = Image( bIsDark ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) ); - mpImpl->maImageAutomatic = Image( bIsDark ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) ); - mpImpl->maImageAutomatic_Active = Image( bIsDark ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) ); - mpImpl->maImageBookMode = Image( bIsDark ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE) ); - mpImpl->maImageBookMode_Active = Image( bIsDark ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) ); + const sal_Bool bHC = GetStatusBar().GetSettings().GetStyleSettings().GetHighContrastMode(); + mpImpl->maImageSingleColumn = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) ); + mpImpl->maImageSingleColumn_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) ); + mpImpl->maImageAutomatic = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) ); + mpImpl->maImageAutomatic_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) ); + mpImpl->maImageBookMode = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE) ); + mpImpl->maImageBookMode_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) ); } // ----------------------------------------------------------------------- |