From 43a1cddd9704c2577542d2834e704ab147f7d869 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Wed, 2 Dec 2009 09:12:26 +0100 Subject: [cbosdo03]Applied the patches to upstream These patches are fixing docx import problems like: * Page breaks added at wrong places * Additionnal paragraphs added at the end of some sections * Hierarchy of numbering properties wasn't working nicely --- sw/source/core/unocore/unotext.cxx | 65 +++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 26 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 0373d8877a..25d95d7035 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -68,6 +68,7 @@ #include +using namespace std; using namespace ::com::sun::star; using ::rtl::OUString; @@ -148,6 +149,7 @@ uno::Any SAL_CALL SwXText::queryInterface( const uno::Type& rType ) throw(uno::R const uno::Type& rXTextConvert = ::getCppuType((uno::Reference< text::XTextConvert >*)0); const uno::Type& rXTextAppend = ::getCppuType((uno::Reference< text::XTextAppend >*)0); const uno::Type& rXTextAppendAndConvert = ::getCppuType((uno::Reference< text::XTextAppendAndConvert >*)0); + const uno::Type& rXTextCopy = ::getCppuType((uno::Reference< text::XTextCopy >*)0); uno::Any aRet; if(rType == rXTextType) @@ -225,6 +227,11 @@ uno::Any SAL_CALL SwXText::queryInterface( const uno::Type& rType ) throw(uno::R uno::Reference< XTextContentAppend > xRet = this; aRet.setValue(&xRet, rXTextContentAppend ); } + else if(rType == rXTextCopy ) + { + uno::Reference< XTextCopy > xRet = this; + aRet.setValue(&xRet, rXTextCopy ); + } return aRet; } /* -----------------------------15.03.00 17:42-------------------------------- @@ -270,8 +277,8 @@ void SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange, sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); } - if(pRange && pRange->GetDoc() == GetDoc() || - pCursor && pCursor->GetDoc() == GetDoc()) + if( ( pRange && pRange->GetDoc() == GetDoc() ) || + ( pCursor && pCursor->GetDoc() == GetDoc() ) ) { const SwStartNode* pOwnStartNode = GetStartNode(); if(pCursor) @@ -1787,6 +1794,36 @@ bool lcl_SimilarPosition( sal_Int32 nPos1, sal_Int32 nPos2 ) return abs( nPos1 - nPos2 ) < COL_POS_FUZZY; } +void SwXText::copyText( + const uno::Reference< text::XTextCopy >& xSource ) + throw ( uno::RuntimeException ) +{ +#if DEBUG + clog << "TODO - SwXText::copyText()" << endl; +#endif + uno::Reference< lang::XUnoTunnel > xTTunnel( xSource, uno::UNO_QUERY_THROW ); + SwXText* pText = 0; + pText = reinterpret_cast< SwXText* >( + sal::static_int_cast< sal_IntPtr >( xTTunnel->getSomething( SwXText::getUnoTunnelId()) )); + + + uno::Reference< text::XText > xText( xSource, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextCursor > xCursor = xText->createTextCursor( ); + xCursor->gotoEnd( sal_True ); + + uno::Reference< lang::XUnoTunnel > xTunnel( xCursor, uno::UNO_QUERY_THROW ); + + OTextCursorHelper* pCursor = 0; + pCursor = reinterpret_cast< OTextCursorHelper* >( + sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + if ( pCursor ) + { + SwNodeIndex rNdIndex( *GetStartNode( ), 1 ); + SwPosition rPos( rNdIndex ); + pDoc->CopyRange( *pCursor->GetPaM( ), rPos, false ); + } +} + uno::Reference< text::XTextTable > SwXText::convertToTable( const uno::Sequence< uno::Sequence< uno::Sequence< uno::Reference< text::XTextRange > > > >& rTableRanges, const uno::Sequence< uno::Sequence< uno::Sequence< beans::PropertyValue > > >& rCellProperties, @@ -2153,30 +2190,6 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( { (void)rBounds; } - - - bool bIllegalException = false; - bool bRuntimeException = false; - ::rtl::OUString sMessage; - pDoc->StartUndo(UNDO_START, NULL); - pDoc->EndUndo(UNDO_START, NULL); - if( bIllegalException || bRuntimeException ) - { - SwUndoIter aUndoIter( pFirstPaM.get(), UNDO_EMPTY ); - pDoc->Undo(aUndoIter); - if(bIllegalException) - { - lang::IllegalArgumentException aEx; - aEx.Message = sMessage; - throw aEx; - } - else //if(bRuntimeException) - { - uno::RuntimeException aEx; - aEx.Message = sMessage; - throw aEx; - } - } return xRet; } -- cgit v1.2.3 From 961e20a1a96ab3dba7e24f31d9d9bafd204d861b Mon Sep 17 00:00:00 2001 From: os Date: Fri, 8 Jan 2010 15:26:54 +0100 Subject: #i105734# patch applied (cmc) --- sw/source/core/swg/SwXMLSectionList.cxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx index 07a1781116..3fe21c2c46 100644 --- a/sw/source/core/swg/SwXMLSectionList.cxx +++ b/sw/source/core/swg/SwXMLSectionList.cxx @@ -71,18 +71,22 @@ SvXMLImportContext *SwXMLSectionList::CreateContext( { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken ( rLocalName, XML_BODY ) || - nPrefix == XML_NAMESPACE_TEXT && - (IsXMLToken ( rLocalName, XML_P ) || - IsXMLToken ( rLocalName, XML_H ) || - IsXMLToken ( rLocalName, XML_A ) || - IsXMLToken ( rLocalName, XML_SPAN ) || - IsXMLToken ( rLocalName, XML_SECTION ) || - IsXMLToken ( rLocalName, XML_INDEX_BODY ) || - IsXMLToken ( rLocalName, XML_INDEX_TITLE )|| - IsXMLToken ( rLocalName, XML_INSERTION ) || - IsXMLToken ( rLocalName, XML_DELETION ) ) ) + if(( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken ( rLocalName, XML_BODY )) || + ( nPrefix == XML_NAMESPACE_TEXT && + (IsXMLToken ( rLocalName, XML_P ) || + IsXMLToken ( rLocalName, XML_H ) || + IsXMLToken ( rLocalName, XML_A ) || + IsXMLToken ( rLocalName, XML_SPAN ) || + IsXMLToken ( rLocalName, XML_SECTION ) || + IsXMLToken ( rLocalName, XML_INDEX_BODY ) || + IsXMLToken ( rLocalName, XML_INDEX_TITLE )|| + IsXMLToken ( rLocalName, XML_INSERTION ) || + IsXMLToken ( rLocalName, XML_DELETION ) ) + ) + ) + { pContext = new SvXMLSectionListContext (*this, nPrefix, rLocalName, xAttrList); + } else pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList ); return pContext; -- cgit v1.2.3 From e033c5dfe806dc546f83d59ffae28a32ec171195 Mon Sep 17 00:00:00 2001 From: os Date: Mon, 11 Jan 2010 15:11:11 +0100 Subject: #i105646# unused code removed --- sw/inc/PostItMgr.hxx | 5 +- sw/inc/SwNumberTree.hxx | 7 --- sw/inc/crsrsh.hxx | 2 - sw/inc/postit.hxx | 4 +- sw/inc/postithelper.hxx | 1 - sw/inc/undobj.hxx | 11 ---- sw/inc/viewsh.hxx | 3 - sw/inc/viscrs.hxx | 2 - sw/inc/warnpassword.hxx | 50 ---------------- sw/source/core/SwNumberTree/SwNumberTree.cxx | 13 ---- sw/source/core/access/accportions.cxx | 6 -- sw/source/core/access/accportions.hxx | 1 - sw/source/core/crsr/crsrsh.cxx | 13 ---- sw/source/core/crsr/viscrs.cxx | 10 ---- sw/source/core/fields/postithelper.cxx | 16 ----- sw/source/core/inc/SwGrammarMarkUp.hxx | 2 - sw/source/core/text/SwGrammarMarkUp.cxx | 15 ----- sw/source/core/text/inftxt.cxx | 4 +- sw/source/core/text/inftxt.hxx | 2 + sw/source/core/text/porlay.cxx | 5 -- sw/source/core/undo/unbkmk.cxx | 17 ------ sw/source/core/undo/unins.cxx | 15 ----- sw/source/core/undo/unmove.cxx | 10 ---- sw/source/core/unocore/unotbl.cxx | 35 ----------- sw/source/core/view/viewsh.cxx | 15 ----- sw/source/filter/rtf/swparrtf.cxx | 73 ----------------------- sw/source/filter/ww8/WW8TableInfo.cxx | 8 +-- sw/source/filter/ww8/WW8TableInfo.hxx | 4 ++ sw/source/filter/ww8/writerhelper.cxx | 3 +- sw/source/filter/ww8/writerhelper.hxx | 3 +- sw/source/filter/ww8/ww8par.hxx | 4 +- sw/source/filter/ww8/ww8par2.hxx | 1 - sw/source/filter/ww8/ww8par3.cxx | 10 +--- sw/source/filter/ww8/ww8par6.cxx | 6 -- sw/source/ui/app/docsh.cxx | 1 - sw/source/ui/docvw/PostItMgr.cxx | 38 +----------- sw/source/ui/docvw/postit.cxx | 3 +- sw/source/ui/uno/makefile.mk | 3 +- sw/source/ui/uno/warnpassword.cxx | 89 ---------------------------- 39 files changed, 29 insertions(+), 481 deletions(-) delete mode 100644 sw/inc/warnpassword.hxx delete mode 100644 sw/source/ui/uno/warnpassword.cxx (limited to 'sw/source') diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index e2060e83d4..d7292cdeee 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -222,7 +222,9 @@ class SwPostItMgr: public SfxListener void Delete(String aAuthor); void Delete(); +#if 0 void Hide( SwPostItField* pPostItField ); +#endif void Hide( const String& rAuthor ); void Hide(); void Show(); @@ -245,7 +247,6 @@ class SwPostItMgr: public SfxListener SwMarginWin* GetPostIt(const SfxBroadcaster* pBroadcaster) const; SwMarginWin* GetPostIt(SfxBroadcaster* pBroadcaster) const; SwPostIt* GetPostIt(const SwPostItField* pFld) const; - SwPostIt* GetPostIt(SwPostItField* pFld) const; void SetShadowState(const SwPostItField* pFld,bool bCursor = true); @@ -255,8 +256,6 @@ class SwPostItMgr: public SfxListener Color GetColorLight(sal_uInt16 aAuthorIndex); Color GetColorAnkor(sal_uInt16 aAuthorIndex); - bool ShowPreview(const SwField* pFld,SwFmtFld*& pFmtFld) const; - void RegisterAnswer(OutlinerParaObject* pAnswer) { mpAnswer = pAnswer;} OutlinerParaObject* IsAnswer() {return mpAnswer;} void CheckMetaText(); diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx index 7f4c88b608..cf546f3547 100644 --- a/sw/inc/SwNumberTree.hxx +++ b/sw/inc/SwNumberTree.hxx @@ -167,13 +167,6 @@ public: return mpParent; } - /** - Returns the first child of this node. - - @return the child - */ - SwNumberTreeNode* GetFirstChild() const; - /** Returns number of this node. diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index a98e7c69a0..68c8ffab7f 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -877,8 +877,6 @@ public: @return the textual description of the current selection */ String GetCrsrDescr() const; - - SwRect GetRectOfCurrentChar(); }; diff --git a/sw/inc/postit.hxx b/sw/inc/postit.hxx index ddc75cc6e6..a24403124a 100644 --- a/sw/inc/postit.hxx +++ b/sw/inc/postit.hxx @@ -324,7 +324,9 @@ class SwMarginWin : public Window virtual bool CalcFollow(); SwMarginWin* GetTopReplyNote(); - bool IsAnyStackParentVisible(); +#if 0 + bool IsAnyStackParentVisible(); +#endif sal_Int32 GetMetaHeight(); sal_Int32 GetMinimumSizeWithMeta(); diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx index 5ff4bbbab4..8a6e14c902 100644 --- a/sw/inc/postithelper.hxx +++ b/sw/inc/postithelper.hxx @@ -66,7 +66,6 @@ namespace SwPostItHelper }; SwLayoutStatus getLayoutInfos( std::vector< SwLayoutInfo >&, SwPosition& ); - SwLayoutStatus getLayoutInfos( std::vector< SwLayoutInfo >&, SwTxtFld* ); long getLayoutHeight( const SwRootFrm* pRoot ); void setSidebarChanged( SwRootFrm* pRoot, bool bBrowseMode ); unsigned long getPageInfo( SwRect& rPageFrm, const SwRootFrm* , const Point& ); diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 9c5f337460..9da774408d 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -404,7 +404,6 @@ public: */ virtual SwRewriter GetRewriter() const; - BOOL CanGrouping( const SwPosition&, sal_Unicode cIns ); OUT_UNDOBJ( Insert ) DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert) @@ -566,7 +565,6 @@ public: ULONG GetEndNode() const { return nEndNode; } ULONG GetDestSttNode() const { return nDestSttNode; } xub_StrLen GetDestSttCntnt() const { return nDestSttCntnt; } - void AddTblMrgFlyHstry( SwHistory& rHstr ); void SetMoveRedlines( bool b ) { bMoveRedlines = b; } @@ -1143,15 +1141,6 @@ public: }; -class SwUndoDelBookmark : public SwUndoBookmark -{ -public: - SwUndoDelBookmark( const ::sw::mark::IMark& ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( DelBookmark ) -}; - class SwUndoInsBookmark : public SwUndoBookmark { public: diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index afff32a04d..10de134054 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -398,9 +398,6 @@ public: // compatible behaviour of tabs void SetTabCompat( bool bNew ); - //#i24363# tab stops relative to indent - void SetTabsRelativeToIndent( bool bNew ); - // font metric attribute "External Leading" should be considered void SetAddExtLeading( bool bNew ); diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx index 7988aaf209..bee72cdcd2 100644 --- a/sw/inc/viscrs.hxx +++ b/sw/inc/viscrs.hxx @@ -95,8 +95,6 @@ class SwSelPaintRects : public SwRects // die Shell const SwCrsrShell* pCShell; - void Paint( const SwRect& rRect ); - virtual void Paint( const Rectangle& rRect ); virtual void FillRects() = 0; diff --git a/sw/inc/warnpassword.hxx b/sw/inc/warnpassword.hxx deleted file mode 100644 index 45b8cc0d85..0000000000 --- a/sw/inc/warnpassword.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * 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: warnpassword.hxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SW_WARNPASSWORD_HXX -#define SW_WARNPASSWORD_HXX - - - -class SfxMedium; -/** Static API helper functions. */ -class SwWarnPassword -{ -public: - /** Opens a query warning dialog. - @descr Pop up Query on export with a choice of yes/no if a - an encrypted password is imported. - @return true if yes and false if no. default to true. - */ - static bool WarningOnPassword( SfxMedium& rMedium ); -}; - - -#endif diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index 8f9caf5f02..7a1a18b885 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -130,19 +130,6 @@ SwNumberTreeNode * SwNumberTreeNode::GetRoot() const return pResult; } -SwNumberTreeNode * SwNumberTreeNode::GetFirstChild() const -{ - SwNumberTreeNode * pResult = 0; - - tSwNumberTreeChildren::iterator aIt = mChildren.begin(); - - if (aIt != mChildren.end() ) - pResult = *aIt; - - return pResult; -} - - void SwNumberTreeNode::ClearObsoletePhantoms() { tSwNumberTreeChildren::iterator aIt = mChildren.begin(); diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 48f4b23136..973ed07ded 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -262,12 +262,6 @@ sal_Bool SwAccessiblePortionData::IsReadOnlyPortion( size_t nPortionNo ) const return IsPortionAttrSet(nPortionNo, PORATTR_READONLY); } -sal_Bool SwAccessiblePortionData::IsGrayPortion( size_t nPortionNo ) const -{ - return IsPortionAttrSet(nPortionNo, PORATTR_GRAY); -} - - sal_Bool SwAccessiblePortionData::IsGrayPortionType( USHORT nType ) const { // gray portions? diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index ab866dbc37..a281a40f0f 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -93,7 +93,6 @@ class SwAccessiblePortionData : public SwPortionHandler sal_Bool IsPortionAttrSet( size_t nPortionNo, sal_uInt8 nAttr ) const; sal_Bool IsSpecialPortion( size_t nPortionNo ) const; sal_Bool IsReadOnlyPortion( size_t nPortionNo ) const; - sal_Bool IsGrayPortion( size_t nPortionNo ) const; sal_Bool IsGrayPortionType( USHORT nType ) const; // helper method for GetEditableRange(...): diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index efb7c6bd76..4be578bafe 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3305,19 +3305,6 @@ String SwCrsrShell::GetCrsrDescr() const return aResult; } -SwRect SwCrsrShell::GetRectOfCurrentChar() -{ - SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->GetFrm( 0, pCurCrsr->GetPoint(), FALSE ); - SwRect aRet; - SwCrsrMoveState aTmpState( MV_NONE ); - aTmpState.bRealHeight = TRUE; - pFrm->GetCharRect( aRet, *pCurCrsr->GetPoint(), &aTmpState ); - //const SwTwips nRealHeight = aTmpState.aRealHeight.Y(); - if (aTmpState.aRealHeight.X() != 0) - aRet.Top(aRet.Top() + aTmpState.aRealHeight.X()); - return aRet; -} - // SMARTTAGS void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes, diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 1e0d6b3703..0c0dc8e5ee 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -669,16 +669,6 @@ void SwSelPaintRects::Paint( const Rectangle& /*rRect*/ ) // nothing to do with overlays } -/* - * Rectangle ist in Dokument-Koordianten !! - * pWin != 0 -> auch wirklich malen - * == 0 -> nur testen, ob es gemalt werden kann - */ - -void SwSelPaintRects::Paint( const SwRect& /*rRect*/ ) -{ - // nothing to do with overlays -} // check current MapMode of the shell and set possibly the static members. // Optional set the parameters pX, pY diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 9a4542b628..aa7078d842 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -129,22 +129,6 @@ unsigned long SwPostItHelper::getPageInfo( SwRect& rPageFrm, const SwRootFrm* pR return nRet; } -SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLayoutInfo >& rInfo, SwTxtFld* pFld ) -{ - SwLayoutStatus aRet = SwPostItHelper::INVISIBLE; - if( pFld ) - { - SwTxtNode* pTNd = pFld->GetpTxtNode(); - if( pTNd ) - { - SwPosition aPos( *pTNd ); - aPos.nContent.Assign( pTNd, *pFld->GetStart() ); - aRet = getLayoutInfos( rInfo, aPos ); - } - } - return aRet; -} - SwPosition SwPostItItem::GetPosition() { SwTxtFld* pFld = pFmtFld->GetTxtFld(); diff --git a/sw/source/core/inc/SwGrammarMarkUp.hxx b/sw/source/core/inc/SwGrammarMarkUp.hxx index d662a51ead..4150cbee2b 100644 --- a/sw/source/core/inc/SwGrammarMarkUp.hxx +++ b/sw/source/core/inc/SwGrammarMarkUp.hxx @@ -72,8 +72,6 @@ public: /* getSentenceEnd returns the first start position of a sentence which is greater than the given parameter */ xub_StrLen getSentenceEnd( xub_StrLen nPos ); - /* removeSentence removes all start positions in the given range */ - void removeSentence(xub_StrLen nStart, xub_StrLen nLength ); }; #endif diff --git a/sw/source/core/text/SwGrammarMarkUp.cxx b/sw/source/core/text/SwGrammarMarkUp.cxx index e060f4f59c..39460dae31 100644 --- a/sw/source/core/text/SwGrammarMarkUp.cxx +++ b/sw/source/core/text/SwGrammarMarkUp.cxx @@ -139,21 +139,6 @@ void SwGrammarMarkUp::setSentence( xub_StrLen nStart ) maSentence.insert( pIter, nStart ); } -void SwGrammarMarkUp::removeSentence(xub_StrLen nStart, xub_StrLen nLength ) -{ - std::vector< xub_StrLen >::iterator pIter = maSentence.begin(); - while( pIter != maSentence.end() && *pIter < nStart ) - ++pIter; - if( nLength == STRING_LEN ) - nStart = STRING_LEN; - else - nStart += nLength; - std::vector< xub_StrLen >::iterator pLast = pIter; - while( pLast != maSentence.end() && *pLast < nStart ) - ++pLast; - maSentence.erase( pIter, pLast ); -} - xub_StrLen SwGrammarMarkUp::getSentenceStart( xub_StrLen nPos ) { if( !maSentence.size() ) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index f374020964..27820f16bc 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1140,7 +1140,7 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, sal_Bool bScript ) const } } - +#if 0 void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const { SwRect aIntersect; @@ -1167,7 +1167,7 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) } } } - +#endif /************************************************************************* * SwTxtPaintInfo::DrawBackGround() *************************************************************************/ diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index c03a94d090..2988dec8e3 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -473,7 +473,9 @@ public: inline void DrawBackBrush( const SwLinePortion &rPor ) const { /* if( pFnt->GetBackColor() ) */ _DrawBackBrush( rPor ); } +#if 0 void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const; +#endif inline void NotifyURL( const SwLinePortion &rPor ) const { if( URLNotify() ) _NotifyURL( rPor ); } diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 73ad538c74..764d5bb876 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -125,11 +125,6 @@ sal_Bool isHahChar ( xub_Unicode cCh ) || cCh == 0x6BF ); } -sal_Bool isTahChar ( xub_Unicode cCh ) -{ - return ( cCh == 0x637 || cCh == 0x638 || cCh == 0x69F ); -} - sal_Bool isAinChar ( xub_Unicode cCh ) { return ( cCh == 0x639 || cCh == 0x63A || cCh == 0x6A0 || cCh == 0x6FC ); diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx index 6bc403478d..73dbeab718 100644 --- a/sw/source/core/undo/unbkmk.cxx +++ b/sw/source/core/undo/unbkmk.cxx @@ -91,23 +91,6 @@ SwRewriter SwUndoBookmark::GetRewriter() const //---------------------------------------------------------------------- -SwUndoDelBookmark::SwUndoDelBookmark( const ::sw::mark::IMark& rBkmk ) - : SwUndoBookmark( UNDO_DELBOOKMARK, rBkmk ) -{ -} - - -void SwUndoDelBookmark::Undo( SwUndoIter& rUndoIter ) -{ - SetInDoc( &rUndoIter.GetDoc() ); -} - - -void SwUndoDelBookmark::Redo( SwUndoIter& rUndoIter ) -{ - ResetInDoc( &rUndoIter.GetDoc() ); -} - SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::IMark& rBkmk ) : SwUndoBookmark( UNDO_INSBOOKMARK, rBkmk ) diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 36fc9bde50..6ab0a047a0 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -167,21 +167,6 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd ) // werden kann. Wenn ja, dann aender die Laenge und die InsPos. // Dann wird von SwDoc::Insert kein neues Object in die Undoliste gestellt. -BOOL SwUndoInsert::CanGrouping( const SwPosition& rInsPos, sal_Unicode cIns ) -{ - BOOL bRet = FALSE; - if( !bIsAppend ) - { - ++nCntnt; - bRet = CanGrouping( rInsPos ); - --nCntnt; - if( bRet ) - bRet = CanGrouping( cIns ); - } - return bRet; -} - - BOOL SwUndoInsert::CanGrouping( sal_Unicode cIns ) { if( !bIsAppend && bIsWordDelim == diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index a7491da0c8..3396dd54d5 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -357,13 +357,3 @@ void SwUndoMove::DelFtn( const SwPaM& rRange ) } } -void SwUndoMove::AddTblMrgFlyHstry( SwHistory& rHstr ) -{ - if( !pHistory ) - pHistory = new SwHistory; - - USHORT nInsPos = nFtnStt; - nFtnStt = nFtnStt + rHstr.Count(); - pHistory->Move( nInsPos, &rHstr ); -} - diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index b2e863595f..df3c089dcb 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -4429,41 +4429,6 @@ void SwXCellRange::GetDataSequence( pDblSeq->realloc( nDtaCnt ); } -/*-- 04.06.04 11:42:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ - -SwUnoCrsr * lcl_CreateCursor( SwFrmFmt &rTblFmt, - SwTableBox *pStartBox, // should be top-left cell of cell range - SwTableBox *pEndBox ) // should be bottom right-cell cell range -{ - // create a *new* UNO cursor spanning the cell range defined by - // the start and end box. Both boxes must be belong to the same table! - - SwUnoCrsr *pUnoCrsr = 0; - if (pStartBox && pEndBox) - { - // hier muessen die Actions aufgehoben werden um - // (zB dem Layout zu ermöglichen die Tabelle zu formatieren, da - // sonst kein Tabellen Cursor aufgespannt werden kann.) - UnoActionRemoveContext aRemoveContext(rTblFmt.GetDoc()); - - // set point of cursor to top left box of range - const SwStartNode* pSttNd = pStartBox->GetSttNd(); - SwPosition aPos(*pSttNd); - pUnoCrsr = rTblFmt.GetDoc()->CreateUnoCrsr(aPos, sal_True); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - pUnoCrsr->SetRemainInSection( sal_False ); - pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pEndBox->GetSttNd(); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); - SwUnoTableCrsr *pCrsr = dynamic_cast(pUnoCrsr); - pCrsr->MakeBoxSels(); - } - return pUnoCrsr; -} - - /*-- 29.04.02 11:42:47--------------------------------------------------- -----------------------------------------------------------------------*/ diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 7d280ff1b6..434c636a52 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -884,21 +884,6 @@ void ViewShell::SetTabCompat( bool bNew ) } } -/*-- 29.11.2007 09:03:18--------------------------------------------------- - //#i24363# tab stops relative to indent - -----------------------------------------------------------------------*/ -void ViewShell::SetTabsRelativeToIndent(bool bNew) -{ - IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); - if( pIDSA->get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT) != bNew ) - { - SwWait aWait( *GetDoc()->GetDocShell(), TRUE ); - pIDSA->set(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT, bNew ); - const BYTE nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; - lcl_InvalidateAllCntnt( *this, nInv ); - } -} - void ViewShell::SetAddExtLeading( bool bNew ) { IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index b07a93f0bb..94b232f166 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -1618,79 +1618,6 @@ USHORT SwRTFParser::ReadRevTbl() return nAuthorTableIndex; } -// #117910# simulate words behaviour of \keepn in table rows -void fixKeepAndSplitAttributes(SwTableNode *pTableNode) -{ - ASSERT(pTableNode!=NULL, "no table node!"); - if (!pTableNode) return; - SwDoc *pDoc=pTableNode->GetDoc(); - if (pTableNode==NULL) return; - SwTable& rTable=pTableNode->GetTable(); - SwTableLines& rLns = rTable.GetTabLines(); - USHORT nLines=rLns.Count(); - if (nLines==0) return; - // get first paragaph in left down-most box - SwTableLine* pLastLine = rLns[ nLines-1 ]; - SwTableBox* pBox = pLastLine->GetTabBoxes()[ 0 ]; - ULONG iFirstParagraph=pBox->GetSttIdx()+1; - SwTxtNode *pTxtNode=(SwTxtNode *)pDoc->GetNodes()[iFirstParagraph]; - SwFrmFmt* pFmt=rTable.GetFrmFmt(); - - SwFmtLayoutSplit *pTableSplit=(SwFmtLayoutSplit *)pFmt->GetAttrSet().GetItem(RES_LAYOUT_SPLIT); - BOOL isTableKeep = pTableSplit!=NULL && !pTableSplit->GetValue(); - SvxFmtKeepItem *pTableKeep=(SvxFmtKeepItem *)pFmt->GetAttrSet().GetItem(RES_KEEP); - BOOL isTableKeepNext = pTableKeep!=NULL && pTableKeep->GetValue(); - SvxFmtKeepItem *pKeepNext = (SvxFmtKeepItem *)pTxtNode->GetSwAttrSet().GetItem(RES_KEEP); - - if (isTableKeepNext) - { - if (nLines>2 && !isTableKeep) - { // split - SwTableLine* pSplitLine = rLns[ nLines-2 ]; - SwTableBox* pSplitBox = pSplitLine->GetTabBoxes()[ 0 ]; - SwNodeIndex aSplitIdx( *pSplitBox->GetSttNd() ); - pDoc->SplitTable( SwPosition(aSplitIdx), HEADLINE_NONE, - !isTableKeep ); - SwTable& rSplitTable=aSplitIdx.GetNode().FindTableNode()->GetTable(); - aSplitIdx-=2; - pDoc->GetNodes().Delete(aSplitIdx); - pFmt=rSplitTable.GetFrmFmt(); - pFmt->ResetFmtAttr(RES_PAGEDESC); - } - // set keep=1(i.e. split=0) attribut - SwFmtLayoutSplit aSplit(0); - SwAttrSet aNewSet(pFmt->GetAttrSet()); - aNewSet.Put(aSplit); - pFmt->SetFmtAttr(aNewSet); - } - else // !isTableKeepNext - { - if (isTableKeep) - { - SwNodeIndex aTmpIdx( *pBox->GetSttNd() ); - pDoc->SplitTable( SwPosition(aTmpIdx), HEADLINE_NONE, FALSE ); - SwTable& rSplitTable=aTmpIdx.GetNode().FindTableNode()->GetTable(); - aTmpIdx-=2; - pDoc->GetNodes().Delete(aTmpIdx); - pFmt=rSplitTable.GetFrmFmt(); - pFmt->ResetFmtAttr(RES_PAGEDESC); - } - // set keep=0(i.e. split=1) attribut - SwFmtLayoutSplit aSplit(1); - SwAttrSet aNewSet(pFmt->GetAttrSet()); - aNewSet.Put(aSplit); - pFmt->SetFmtAttr(aNewSet); - } - // move keepnext attribtue from last paragraph to table - if (pKeepNext!=NULL) - { - SvxFmtKeepItem aNewKeepItem(pKeepNext->GetValue(), RES_KEEP); - SwAttrSet aNewSet(pFmt->GetAttrSet()); - aNewSet.Put(aNewKeepItem); - pFmt->SetFmtAttr(aNewSet); - } -} - void SwRTFParser::NextToken( int nToken ) { USHORT eDateFmt; diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 965d997955..1f89a1d0d9 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -139,6 +139,7 @@ const SwTable * WW8TableNodeInfoInner::getTable() const return mpTable; } +#ifdef DEBUG string WW8TableNodeInfoInner::toString() const { static char buffer[256]; @@ -154,7 +155,7 @@ string WW8TableNodeInfoInner::toString() const return string(buffer); } - +#endif // WW8TableTextNodeInfo WW8TableNodeInfo::WW8TableNodeInfo(const SwNode * pNode) @@ -170,6 +171,7 @@ WW8TableNodeInfo::~WW8TableNodeInfo() { } +#ifdef DEBUG ::std::string WW8TableNodeInfo::toString() const { static char buffer[1024]; @@ -190,15 +192,13 @@ WW8TableNodeInfo::~WW8TableNodeInfo() aIt++; } -#ifdef DEBUG sResult += dbg_out(*mpNode); -#endif sResult +=""; return sResult; } - +#endif void WW8TableNodeInfo::setDepth(sal_uInt32 nDepth) { mnDepth = nDepth; diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index 0db4637465..d9340c992b 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -84,7 +84,9 @@ public: const SwNode * getNode() const; +#ifdef DEBUG string toString() const; +#endif }; class WW8TableNodeInfo @@ -131,7 +133,9 @@ public: sal_uInt32 getCell() const; sal_uInt32 getRow() const; +#ifdef DEBUG ::std::string toString() const; +#endif }; struct hashNode diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 8b6a98eca8..078c7084ea 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -570,6 +570,7 @@ namespace sw return aRet; } +#if 0 Frames GetFramesBetweenNodes(const Frames &rFrames, const SwNode &rStart, const SwNode &rEnd) { @@ -583,7 +584,7 @@ namespace sw return aRet; } - +#endif Frames GetFramesInNode(const Frames &rFrames, const SwNode &rNode) { Frames aRet; diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 68a474b227..3cc82dd384 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -666,6 +666,7 @@ namespace sw */ Frames GetFramesInNode(const Frames &rFrames, const SwNode &rNode); +#if 0 /** Get the Frames anchored for all nodes between two points Given a container of frames, find the ones anchored to the nodes @@ -688,7 +689,7 @@ namespace sw */ Frames GetFramesBetweenNodes(const Frames &rFrames, const SwNode &rStart, const SwNode &rEnd); - +#endif /** Get the Numbering Format used on a paragraph There are two differing types of numbering formats that may be on a diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 662b6d36f3..1cf43dcfa0 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -383,20 +383,18 @@ private: SwNodeIndex maPtNode; xub_StrLen mnPtCntnt; ::rtl::OUString msBookmarkName; - ::rtl::OUString msMarkType; typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> Param_t; typedef ::std::vector< Param_t > Params_t; Params_t maParams; SwPaM * mpPaM; public: - WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType); + WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName); ~WW8NewFieldCtx(); SwNodeIndex GetPtNode() { return maPtNode; }; xub_StrLen GetPtCntnt() { return mnPtCntnt; }; ::rtl::OUString GetBookmarkName(); - ::rtl::OUString GetMarkType(); void AddParam(::rtl::OUString name, ::rtl::OUString value); void SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark); }; diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index d8730b0c55..a6c89174c6 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -288,7 +288,6 @@ public: const WW8SwFlyPara* pFS, bool bGraf); WW8FlySet(SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic, long nWidth, long nHeight); - WW8FlySet(const SwWW8ImplReader& rReader, const SwPaM* pPaM); }; enum WW8LvlType {WW8_None, WW8_Outline, WW8_Numbering, WW8_Sequence, WW8_Pause}; diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index b6b91459fc..ba35fd2bfd 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -103,11 +103,10 @@ using namespace com::sun::star; using namespace sw::util; using namespace sw::types; -WW8NewFieldCtx::WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType) +WW8NewFieldCtx::WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName) : maPtNode(aStartPos.nNode) , mnPtCntnt(aStartPos.nContent.GetIndex()) , msBookmarkName(sBookmarkName) - , msMarkType(sMarkType) , mpPaM(NULL) { } @@ -123,11 +122,6 @@ WW8NewFieldCtx::~WW8NewFieldCtx() return msBookmarkName; } -::rtl::OUString WW8NewFieldCtx::GetMarkType() -{ - return msMarkType; -} - void WW8NewFieldCtx::AddParam(::rtl::OUString name, ::rtl::OUString value) { maParams.push_back( Param_t(name, value) ); @@ -233,7 +227,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr ) if (aBookmarkName.Len()>0) { - WW8NewFieldCtx *pFieldCtx=new WW8NewFieldCtx(*pPaM->GetPoint(), aBookmarkName, ::rtl::OUString::createFromAscii("ecma.office-open-xml.field.FORMTEXT")); + WW8NewFieldCtx *pFieldCtx=new WW8NewFieldCtx(*pPaM->GetPoint(), aBookmarkName/*, ::rtl::OUString::createFromAscii("ecma.office-open-xml.field.FORMTEXT"*/); maNewFieldCtxStack.push_back(pFieldCtx); pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip); pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Name"), aFormula.sTitle); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 9739922e4a..1c047e3e54 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2275,12 +2275,6 @@ WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM, + aSizeArray[WW8_BOT]) ); } -WW8FlySet::WW8FlySet(const SwWW8ImplReader& rReader, const SwPaM* pPaM) - : SfxItemSet(rReader.rDoc.GetAttrPool(),RES_FRMATR_BEGIN,RES_FRMATR_END-1) -{ - Init(rReader, pPaM); -} - void WW8FlySet::Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM) { if (!rReader.mbNewDoc) diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 8cb2cdb66c..6aa0d85057 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -106,7 +106,6 @@ #include #include #include -#include "warnpassword.hxx" #include #include diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 17673cd387..12089070bc 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -1295,7 +1295,7 @@ void SwPostItMgr::Delete() CalcRects(); LayoutPostIts(); } - +#if 0 void SwPostItMgr::Hide(SwPostItField* pPostItField ) { for(std::list::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) @@ -1314,7 +1314,7 @@ void SwPostItMgr::Hide(SwPostItField* pPostItField ) LayoutPostIts(); } - +#endif void SwPostItMgr::Hide( const String& rAuthor ) { for(SwMarginItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) @@ -1379,16 +1379,6 @@ SwMarginWin* SwPostItMgr::GetPostIt(SfxBroadcaster* pBroadcaster) const return NULL; } -SwPostIt* SwPostItMgr::GetPostIt(SwPostItField* pFld) const -{ - for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) - { - if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld() == pFld) ) - return static_cast((*i)->pPostIt); - } - return NULL; -} - SwMarginWin* SwPostItMgr::GetPostIt( const SfxBroadcaster* pBroadcaster) const { for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) @@ -1409,30 +1399,6 @@ SwPostIt* SwPostItMgr::GetPostIt(const SwPostItField* pFld) const return NULL; } -bool SwPostItMgr::ShowPreview(const SwField* pFld, SwFmtFld*& pFmtFld) const -{ - for (unsigned long n=0;nmList->size()>0) - { - for(const_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++) - { - if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld()==pFld) ) - { - pFmtFld = (*i)->GetFmtFld(); - const long aSidebarheight = mPages[n]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; - bool bTopPage = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y())).Y() >= (mPages[n]->mPageRect.Top()+aSidebarheight); - bool bBottomPage = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y()+(*i)->pPostIt->GetSizePixel().Height())).Y() <= (mPages[n]->mPageRect.Bottom()-aSidebarheight); - const bool bTopVis = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y())).Y() > mpView->GetVisArea().Top(); - const bool bBottomVis = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y()/*+(*i)->pPostIt->GetSizePixel().Height()*/)).Y() <= mpView->GetVisArea().Bottom(); - return !(bBottomPage && bTopPage && bBottomVis && bTopVis); - } - } - } - } - return false; -} - SwMarginWin* SwPostItMgr::GetNextPostIt(USHORT aDirection, SwMarginWin* aPostIt) { if (mvPostItFlds.size()>1) diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index c807e24ff8..9b241c9c3e 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -1517,6 +1517,7 @@ void SwMarginWin::SetViewState(ShadowState bState) } } +#if 0 bool SwMarginWin::IsAnyStackParentVisible() { SwMarginWin* pMarginWin = mpMgr->GetNextPostIt(KEY_PAGEUP, this); @@ -1533,7 +1534,7 @@ bool SwMarginWin::IsAnyStackParentVisible() } return false; } - +#endif SwMarginWin* SwMarginWin::GetTopReplyNote() { SwMarginWin* pTopNote = 0; diff --git a/sw/source/ui/uno/makefile.mk b/sw/source/ui/uno/makefile.mk index 41b2cc73ca..2632db2e89 100644 --- a/sw/source/ui/uno/makefile.mk +++ b/sw/source/ui/uno/makefile.mk @@ -63,8 +63,7 @@ SLO1FILES = \ $(SLO)$/SwXFilterOptions.obj\ $(SLO)$/RefreshListenerContainer.obj \ $(SLO)$/unomodule.obj \ - $(SLO)$/unodoc.obj \ - $(SLO)$/warnpassword.obj + $(SLO)$/unodoc.obj SLO2FILES = \ $(SLO)$/swdetect.obj \ diff --git a/sw/source/ui/uno/warnpassword.cxx b/sw/source/ui/uno/warnpassword.cxx deleted file mode 100644 index 1af8e77c25..0000000000 --- a/sw/source/ui/uno/warnpassword.cxx +++ /dev/null @@ -1,89 +0,0 @@ -/************************************************************************* - * - * 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: warnpassword.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * -+ ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -// ============================================================================ -#include "warnpassword.hxx" -#include -#include -#include -#include -#include -#include -#include - -using ::rtl::OUString; - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::ucb; -using namespace ::com::sun::star::task; - -bool SwWarnPassword::WarningOnPassword( SfxMedium& rMedium ) -{ - bool bReturn = true; - uno::Reference< task::XInteractionHandler > xHandler( rMedium.GetInteractionHandler()); - if( xHandler.is() ) - { - - OUString empty; - uno::Any xException( makeAny(InteractiveAppException(empty, - uno::Reference (), - InteractionClassification_QUERY, - ERRCODE_SVX_EXPORT_FILTER_CRYPT))); - - uno::Reference< ucbhelper::SimpleInteractionRequest > xRequest - = new ucbhelper::SimpleInteractionRequest( - xException, - ucbhelper::CONTINUATION_APPROVE - | ucbhelper::CONTINUATION_DISAPPROVE ); - - xHandler->handle( xRequest.get() ); - - const sal_Int32 nResp = xRequest->getResponse(); - - switch ( nResp ) - { - case ucbhelper::CONTINUATION_UNKNOWN: - break; - - case ucbhelper::CONTINUATION_APPROVE: - // Continue - break; - - case ucbhelper::CONTINUATION_DISAPPROVE: - bReturn = false; - break; - } - } - return bReturn; -} - -- cgit v1.2.3 From 47eaaebf0c798c53869bfe3115d2f39c2159c176 Mon Sep 17 00:00:00 2001 From: os Date: Mon, 18 Jan 2010 16:38:57 +0100 Subject: #i108426# missing increment added --- sw/source/core/unocore/unostyle.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sw/source') diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index bc3203f764..6aac093e95 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1266,6 +1266,7 @@ sal_Bool SwStyleProperties_Impl::GetProperty(const ::rtl::OUString& rName, uno:: bRet = sal_True; break; } + ++nPos; ++aIt; } -- cgit v1.2.3 From ec23ab025fa3f49d7552ed989f38bc0a12135e99 Mon Sep 17 00:00:00 2001 From: os Date: Wed, 20 Jan 2010 15:33:56 +0100 Subject: #i108455# check configuration pointers before call of RemoveListener() --- sw/source/ui/app/apphdl.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index c9ca781e7c..010e00b204 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -768,15 +768,20 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) DELETEZ(pWebToolbarConfig) ; DELETEZ(pAuthorNames) ; DELETEZ(pDBConfig); - pColorConfig->RemoveListener(this); + if( pColorConfig ) + pColorConfig->RemoveListener(this); DELETEZ(pColorConfig); - pAccessibilityOptions->RemoveListener(this); + if( pAccessibilityOptions ) + pAccessibilityOptions->RemoveListener(this); DELETEZ(pAccessibilityOptions); - pCTLOptions->RemoveListener(this); + if(pCTLOptions) + pCTLOptions->RemoveListener(this); DELETEZ(pCTLOptions); - pUserOptions->RemoveListener(this); + if(pUserOptions) + pUserOptions->RemoveListener(this); DELETEZ(pUserOptions); - pUndoOptions->RemoveListener(this); + if(pUndoOptions) + pUndoOptions->RemoveListener(this); DELETEZ(pUndoOptions); } } -- cgit v1.2.3 From f92fd37f4d19e5ee6cee4531ca4d700b09dc35a1 Mon Sep 17 00:00:00 2001 From: os Date: Wed, 20 Jan 2010 15:50:24 +0100 Subject: #i108081# take care of OLE objects in mail merge --- sw/inc/doc.hxx | 2 +- sw/source/core/doc/docnew.cxx | 233 ++---------------------------------------- sw/source/ui/dbui/dbmgr.cxx | 7 +- sw/source/ui/uno/unotxdoc.cxx | 15 ++- 4 files changed, 20 insertions(+), 237 deletions(-) (limited to 'sw/source') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 557f73ad13..d278e21348 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -2115,7 +2115,7 @@ public: ::sfx2::IXmlIdRegistry& GetXmlIdRegistry(); ::sw::MetaFieldManager & GetMetaFieldManager(); - SwDoc* CreateCopy() const; + SfxObjectShell* CreateCopy(bool bCallInitNew) const; }; diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index e791d5c4ad..dd177462e4 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1069,14 +1069,10 @@ void SwDoc::InitTOXTypes() /*-- 08.05.2009 10:07:57--------------------------------------------------- -----------------------------------------------------------------------*/ -SwDoc* SwDoc::CreateCopy() const +SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const { SwDoc* pRet = new SwDoc; //copy settings -/* - //aNodes( this ), - //aUndoNodes( this ), - mpAttrPool(new SwAttrPool(this)),*/ USHORT __FAR_DATA aRangeOfDefaults[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_CHRATR_BEGIN, RES_CHRATR_END-1, @@ -1105,143 +1101,8 @@ SwDoc* SwDoc::CreateCopy() const if( aNewDefaults.Count() ) pRet->SetDefault( aNewDefaults ); - /* - pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ), - pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ), - pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt ) ), - pDfltCharFmt( new SwCharFmt( GetAttrPool(), sCharFmtStr, 0 ) ), - pDfltTxtFmtColl( new SwTxtFmtColl( GetAttrPool(), sTxtCollStr ) ), - pDfltGrfFmtColl( new SwGrfFmtColl( GetAttrPool(), sGrfCollStr ) ), - pFrmFmtTbl( new SwFrmFmts() ), - pCharFmtTbl( new SwCharFmts() ), - pSpzFrmFmtTbl( new SwSpzFrmFmts() ), - pSectionFmtTbl( new SwSectionFmts() ), - pTblFrmFmtTbl( new SwFrmFmts() ), - pTxtFmtCollTbl( new SwTxtFmtColls() ), - pGrfFmtCollTbl( new SwGrfFmtColls() ), - pBookmarkTbl( new SwBookmarks( 0, 16 ) ), - pTOXTypes( new SwTOXTypes() ), - pDefTOXBases( new SwDefTOXBase_Impl() ), - pLayout( 0 ), // Rootframe des spezifischen Layouts. - pDrawModel( 0 ), - pUndos( new SwUndos( 0, 20 ) ), - pUpdtFlds( new SwDocUpdtFld() ), - pFldTypes( new SwFldTypes() ), - pVirDev( 0 ), - pPrt( 0 ), - pPrtData( 0 ), - pGlossaryDoc( 0 ), - pOutlineRule( 0 ), - pFtnInfo( new SwFtnInfo ), - pEndNoteInfo( new SwEndNoteInfo ), - pLineNumberInfo( new SwLineNumberInfo ), - pFtnIdxs( new SwFtnIdxs ), - pDocStat( new SwDocStat ), - pDocShell( 0 ), - pDocShRef( 0 ), - pLinkMgr( new SvxLinkManager( 0 ) ), - pACEWord( 0 ), - pURLStateChgd( 0 ), - pNumberFormatter( 0 ), - pNumRuleTbl( new SwNumRuleTbl ), - // --> OD 2008-03-26 #refactorlists# - maLists(), - maListStyleLists(), - // <-- - pRedlineTbl( new SwRedlineTbl ), - pAutoFmtRedlnComment( 0 ), - pUnoCrsrTbl( new SwUnoCrsrTbl( 0, 16 ) ), - pPgPViewPrtData( 0 ), - pExtInputRing( 0 ), - pLayouter( 0 ), - // --> OD 2008-03-07 #refactorlists# - pStyleAccess( 0 ), - // <-- - pLayoutCache( 0 ), - pUnoCallBack(new SwUnoCallBack(0)), - mpGrammarContact( 0 ), - aChartDataProviderImplRef(), - pChartControllerHelper( 0 ), - // --> OD 2007-10-31 #i83479# - mpListItemsList( new tImplSortedNodeNumList() ), - // <-- - nUndoPos( 0 ), - nUndoSavePos( 0 ), - nUndoCnt( 0 ), - nUndoSttEnd( 0 ), - nAutoFmtRedlnCommentNo( 0 ), - nLinkUpdMode( GLOBALSETTING ), - eFldUpdMode( AUTOUPD_GLOBALSETTING ), - eRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)), - eChrCmprType( CHARCOMPRESS_NONE ), - mReferenceCount(0), - mIdleBlockCount(0), - nLockExpFld( 0 ), - mbReadlineChecked(false), - mbWinEncryption(sal_False), - // --> OD 2005-02-11 #i38810# - mbLinksUpdated( sal_False ), - mbClipBoard( false ), - mbColumnSelection( false ), - // i#78591# - mbProtectForm(false),*/ pRet->n32DummyCompatabilityOptions1 = n32DummyCompatabilityOptions1; pRet->n32DummyCompatabilityOptions2 = n32DummyCompatabilityOptions2; - /* - mbStartIdleTimer(sal_False) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" ); - - mbGlossDoc = - mbModified = - mbDtor = - mbUndo = - mbPageNums = - mbLoaded = - mbUpdateExpFld = - mbNewDoc = - mbCopyIsMove = - mbNoDrawUndoObj = - mbBrowseMode = - mbInReading = - mbInXMLImport = - mbUpdateTOX = - mbInLoadAsynchron = - mbHTMLMode = - mbInCallModified = - mbIsGlobalDoc = - mbGlblDocSaveLinks = - mbIsLabelDoc = - mbIsAutoFmtRedline = - mbOLEPrtNotifyPending = - mbAllOLENotify = - mbIsRedlineMove = - mbInsOnlyTxtGlssry = - mbContains_MSVBasic = - mbKernAsianPunctuation = -#ifndef PRODUCT - mbXMLExport = -#endif - // --> OD 2006-03-21 #b6375613# - mbApplyWorkaroundForB6375613 = - // <-- - false; - - mbGroupUndo = - mbNewFldLst = - mbVisibleLinks = - mbPurgeOLE = - true; - - // - // COMPATIBILITY FLAGS START - // - - // Note: Any non-hidden compatibility flag should obtain its default - // by asking SvtCompatibilityOptions, see below. - // - const SvtCompatibilityOptions aOptions; - */ pRet->mbParaSpaceMax = mbParaSpaceMax ; pRet->mbParaSpaceMaxAtPages = mbParaSpaceMaxAtPages ; pRet->mbTabCompat = mbTabCompat ; @@ -1271,92 +1132,16 @@ SwDoc* SwDoc::CreateCopy() const // // COMPATIBILITY FLAGS END // - /* - pMacroTable = new SvxMacroTableDtor; - - mpGrammarContact = ::createGrammarContact(); - - // Formate - pFrmFmtTbl->Insert(pDfltFrmFmt, 0 ); - pCharFmtTbl->Insert(pDfltCharFmt, 0 ); - - // FmtColls - // TXT - pTxtFmtCollTbl->Insert(pDfltTxtFmtColl, 0 ); - // GRF - pGrfFmtCollTbl->Insert(pDfltGrfFmtColl, 0 ); - - // PageDesc, EmptyPageFmt und ColumnFmt anlegen - if ( !aPageDescs.Count() ) - GetPageDescFromPool( RES_POOLPAGE_STANDARD ); - - //Leere Seite Einstellen. - pEmptyPageFmt->SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE ) ); - //BodyFmt fuer Spalten Einstellen. - pColumnContFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) ); - - _InitFieldTypes(); - - // lege (fuer die Filter) eine Default-OutlineNumRule an - // --> OD 2008-02-11 #newlistlevelattrs# - pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ), - // --> OD 2008-06-06 #i89178# - numfunc::GetDefaultPositionAndSpaceMode(), - // <-- - OUTLINE_RULE ); - // <-- - // #115901# - AddNumRule(pOutlineRule); - // --> OD 2005-10-21 - counting of phantoms depends on - pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) ); - // <-- - - new SwTxtNode( SwNodeIndex( aUndoNodes.GetEndOfContent() ), pDfltTxtFmtColl ); - new SwTxtNode( SwNodeIndex( aNodes.GetEndOfContent() ), - GetTxtCollFromPool( RES_POOLCOLL_STANDARD )); - - // den eigenen IdleTimer setzen - aIdleTimer.SetTimeout( 600 ); - aIdleTimer.SetTimeoutHdl( LINK(this, SwDoc, DoIdleJobs) ); - - aOLEModifiedTimer.SetTimeout( 1000 ); - aOLEModifiedTimer.SetTimeoutHdl( LINK( this, SwDoc, DoUpdateModifiedOLE )); - - // DBMgr anlegen - pNewDBMgr = new SwNewDBMgr; - - // create TOXTypes - ShellResource* pShellRes = ViewShell::GetShellRes(); - - SwTOXType * pNew = new SwTOXType(TOX_CONTENT, pShellRes->aTOXContentName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - pNew = new SwTOXType(TOX_INDEX, pShellRes->aTOXIndexName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - pNew = new SwTOXType(TOX_USER, pShellRes->aTOXUserName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - pNew = new SwTOXType(TOX_ILLUSTRATIONS, pShellRes->aTOXIllustrationsName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - pNew = new SwTOXType(TOX_OBJECTS, pShellRes->aTOXObjectsName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - pNew = new SwTOXType(TOX_TABLES, pShellRes->aTOXTablesName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - pNew = new SwTOXType(TOX_AUTHORITIES, pShellRes->aTOXAuthoritiesName ); - pTOXTypes->Insert( pNew, pTOXTypes->Count() ); - - { - SfxItemSet aIgnorableParagraphItems( GetAttrPool(), - RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, - 0 ); - pStyleAccess = createStyleManager( &aIgnorableParagraphItems ); - } - - ResetModified(); - -*/ - pRet->ReplaceStyles( *(SwDoc*)this ); + pRet->ReplaceStyles( * const_cast< SwDoc*>( this )); + SfxObjectShellRef aDocShellRef = const_cast< SwDocShell* >( GetDocShell() ); + pRet->SetRefForDocShell( boost::addressof(aDocShellRef) ); + SfxObjectShellRef xRetShell = new SwDocShell( pRet, SFX_CREATE_MODE_STANDARD ); + if( bCallInitNew ) + xRetShell->DoInitNew(); //copy content pRet->Paste( *this ); - return pRet; + pRet->SetRefForDocShell( 0 ); + return xRetShell; } /*-- 08.05.2009 10:52:40--------------------------------------------------- copy document content - code from SwFEShell::Paste( SwDoc* , BOOL ) diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 6573946433..a2f9d928f2 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -3239,9 +3239,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, } else { - SwDoc* pNewDoc = rSourceView.GetDocShell()->GetDoc()->CreateCopy(); - xWorkDocSh = new SwDocShell( pNewDoc, SFX_CREATE_MODE_STANDARD ); - xWorkDocSh->DoInitNew(); + xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true); } //create a ViewFrame SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, sal_True )->GetViewShell() ); @@ -3364,8 +3362,9 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, pTargetShell->SttDoc(); // } - catch( Exception& ) + catch( Exception& rEx) { + (void)rEx; DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments"); } DELETEZ(pImpl->pMergeData); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 044c5bd78f..8e233c537c 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -107,6 +107,8 @@ #include #include #include +#include + // --> FME 2004-06-08 #i12836# enhanced pdf export #include @@ -2864,16 +2866,13 @@ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno:: if(!IsValid()) throw RuntimeException(); //create a new document - hidden - copy the storage and return it - SwDoc* pCopyDoc = pDocShell->GetDoc()->CreateCopy(); - SfxObjectShell* pShell = new SwDocShell( pCopyDoc, SFX_CREATE_MODE_STANDARD ); - pShell->DoInitNew(); - - uno::Reference< embed::XStorage > xSourceStorage = getDocumentStorage(); + SfxObjectShell* pShell = pDocShell->GetDoc()->CreateCopy(false); uno::Reference< frame::XModel > xNewModel = pShell->GetModel(); - //copy this storage + uno::Reference< embed::XStorage > xNewStorage = ::comphelper::OStorageHelper::GetTemporaryStorage( ); + uno::Sequence< beans::PropertyValue > aTempMediaDescriptor; + storeToStorage( xNewStorage, aTempMediaDescriptor ); uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY ); - uno::Reference< embed::XStorage > xNewStorage = xStorageDoc->getDocumentStorage(); - xSourceStorage->copyToStorage( xNewStorage ); + xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor ); return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY ); } /* -----------------------------20.06.00 09:54-------------------------------- -- cgit v1.2.3 From 5516cda28df7d8c21f38c5e8ec82d99b911f5b0c Mon Sep 17 00:00:00 2001 From: os Date: Mon, 25 Jan 2010 11:36:33 +0100 Subject: #i108582# strict aliasing warning fixed (cmc) --- sw/source/ui/dbui/dbinsdlg.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index c4913d65f3..1939548be6 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1937,7 +1937,7 @@ void SwInsertDBColAutoPilot::Load() SwInsDBColumn& rSet = *aDBColumns[ n ]; for( USHORT m = 0; m < pNewData->aDBColumns.Count() ; ++m ) { - const SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ]; + SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ]; if(rGet.sColumn == rSet.sColumn) { if( rGet.bHasFmt && !rGet.bIsDBFmt ) @@ -1949,8 +1949,10 @@ void SwInsertDBColAutoPilot::Load() { xub_StrLen nCheckPos; short nType; - rNFmtr.PutEntry( (String&)rGet.sUsrNumFmt, nCheckPos, nType, + String sTmpFmt = rGet.sUsrNumFmt; + rNFmtr.PutEntry( sTmpFmt, nCheckPos, nType, rSet.nUsrNumFmt, rGet.eUsrNumFmtLng ); + rGet.sUsrNumFmt = sTmpFmt; } } break; -- cgit v1.2.3 From 1a05cdd7ba1a05014c6924fb78bf8fc4d29da9b3 Mon Sep 17 00:00:00 2001 From: os Date: Tue, 2 Feb 2010 13:46:50 +0100 Subject: #i108736# acces to TableBorder: find top/left bottom/right cell --- sw/source/core/unocore/unotbl.cxx | 48 +++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 7 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index df3c089dcb..265f61eda6 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -498,6 +498,40 @@ String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow ) return sCellName; } +/** Find the top left or bottom right corner box in given table. + Consider nested lines when finding the box. + + @param i_pTable the table + + @param i_bTopLeft if true, find top left box, otherwise find bottom + right box + */ + +const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const bool i_bTopLeft) +{ + bool bFirst = true; + const SwTableBox* pBox = 0; + do + { + const SwTableLines& rLines(bFirst ? rTableLines : pBox->GetTabLines()); + bFirst = false; + OSL_ASSERT(rLines.Count() != 0); + if (rLines.Count() != 0) + { + const SwTableLine* pLine(rLines[i_bTopLeft ? 0 : rLines.Count() - 1]); + OSL_ASSERT(pLine); + const SwTableBoxes& rBoxes(pLine->GetTabBoxes()); + OSL_ASSERT(rBoxes.Count() != 0); + pBox = rBoxes[i_bTopLeft ? 0 : rBoxes.Count() - 1]; + OSL_ASSERT(pBox); + } + else + { + pBox = 0; + } + } while (pBox && !pBox->GetSttNd()); + return pBox; +} /* -----------------21.11.05 14:46------------------- @@ -3306,7 +3340,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, // hier muessen die Actions aufgehoben werden UnoActionRemoveContext aRemoveContext(pDoc); - SwTableBox* pTLBox = rLines[0]->GetTabBoxes()[0]; + const SwTableBox* pTLBox = lcl_FindCornerTableBox(rLines, true); const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // Cursor in die obere linke Zelle des Ranges setzen @@ -3316,7 +3350,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, SwTableLine* pLastLine = rLines[rLines.Count() - 1]; SwTableBoxes &rBoxes = pLastLine->GetTabBoxes(); - const SwTableBox* pBRBox = rBoxes[rBoxes.Count() -1]; + const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); pUnoCrsr->SetMark(); pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); pUnoCrsr->Move( fnMoveForward, fnGoNode ); @@ -3501,7 +3535,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be // hier muessen die Actions aufgehoben werden UnoActionRemoveContext aRemoveContext(pDoc); - SwTableBox* pTLBox = rLines[0]->GetTabBoxes()[0]; + const SwTableBox* pTLBox = lcl_FindCornerTableBox(rLines, true); const SwStartNode* pSttNd = pTLBox->GetSttNd(); SwPosition aPos(*pSttNd); // Cursor in die obere linke Zelle des Ranges setzen @@ -3509,11 +3543,11 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be pUnoCrsr->Move( fnMoveForward, fnGoNode ); pUnoCrsr->SetRemainInSection( sal_False ); - SwTableLine* pLastLine = rLines[rLines.Count() - 1]; - SwTableBoxes &rBoxes = pLastLine->GetTabBoxes(); - const SwTableBox* pBRBox = rBoxes[rBoxes.Count() -1]; + const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); pUnoCrsr->SetMark(); - pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); + const SwStartNode* pLastNd = pBRBox->GetSttNd(); + pUnoCrsr->GetPoint()->nNode = *pLastNd; + pUnoCrsr->Move( fnMoveForward, fnGoNode ); SwUnoTableCrsr* pCrsr = dynamic_cast(pUnoCrsr); pCrsr->MakeBoxSels(); -- cgit v1.2.3 From 26058738c01d5d6933b8c4ec6eae944c1f30b0de Mon Sep 17 00:00:00 2001 From: os Date: Tue, 2 Feb 2010 14:58:27 +0100 Subject: #i107142# crash in mail merge of single-paragraph-documents fixed --- sw/source/core/docnode/nodes.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 489d1c4dcf..c2396b0d3f 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -2057,11 +2057,19 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, // falls aEnd-1 auf keinem ContentNode steht, dann suche den vorherigen aRg.aEnd--; - while( (( pAktNode = (*this)[ aRg.aEnd ])->GetStartNode() && - !pAktNode->IsSectionNode() ) || - ( pAktNode->IsEndNode() && - ND_STARTNODE == pAktNode->pStartOfSection->GetNodeType()) ) - aRg.aEnd--; + // #i107142#: if aEnd is start node of a special section, do nothing. + // Otherwise this could lead to crash: going through all previous + // special section nodes and then one before the first. + if (aRg.aEnd.GetNode().StartOfSectionIndex() != 0) + { + while( (( pAktNode = (*this)[ aRg.aEnd ])->GetStartNode() && + !pAktNode->IsSectionNode() ) || + ( pAktNode->IsEndNode() && + ND_STARTNODE == pAktNode->pStartOfSection->GetNodeType()) ) + { + aRg.aEnd--; + } + } aRg.aEnd++; // wird im selben Array's verschoben, dann ueberpruefe die Einfuegepos. -- cgit v1.2.3 From f1fba610072f935d75a02b877f141226a659903e Mon Sep 17 00:00:00 2001 From: os Date: Thu, 4 Feb 2010 12:32:20 +0100 Subject: #i108920# GotoNext/PrevMark: Check if field exists --- sw/source/ui/shells/basesh.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 993772ad76..f90cf2c5e8 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -709,8 +709,9 @@ void SwBaseShell::Execute(SfxRequest &rReq) rSh.EndSelect(); } BOOL bRet = rSh.MoveFldType(pFldType, nSlot == FN_GOTO_NEXT_MARK); - if (bRet) - rSh.ClickToField(*rSh.GetCurFld()); + SwField* pCurField = bRet ? rSh.GetCurFld() : 0; + if (pCurField) + rSh.ClickToField(*pCurField); rReq.SetReturnValue(SfxBoolItem( nSlot, bRet)); } } -- cgit v1.2.3 From 7478cbcc4cca4fce9b0f995a7fa5a81c63ccb109 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 5 Feb 2010 10:44:14 +0100 Subject: cbosdo03: fixed a wrong property for image import + clenaup --- sw/source/core/unocore/unotext.cxx | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 5b8b5f88d9..f7cbb36e01 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -79,8 +79,6 @@ #include #include - -using namespace std; using namespace ::com::sun::star; using ::rtl::OUString; @@ -1871,9 +1869,6 @@ void SwXText::copyText( const uno::Reference< text::XTextCopy >& xSource ) throw ( uno::RuntimeException ) { -#if DEBUG - clog << "TODO - SwXText::copyText()" << endl; -#endif uno::Reference< lang::XUnoTunnel > xTTunnel( xSource, uno::UNO_QUERY_THROW ); SwXText* pText = 0; pText = reinterpret_cast< SwXText* >( -- cgit v1.2.3 From 1273878636fe1a470d238b897365845c9b2b8d86 Mon Sep 17 00:00:00 2001 From: os Date: Mon, 8 Feb 2010 12:08:54 +0100 Subject: #i103024# display and use of tab stops fixed --- sw/source/core/text/txttab.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index ed4f7059a0..c4bd93c1a7 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -192,13 +192,8 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) } SwTwips nCount = nSearchPos; - // Bei negativen Werten rundet "/" auf, "%" liefert negative Reste, - // bei positiven Werten rundet "/" ab, "%" liefert positvie Reste! - if ( nCount < 0 ) - nCount = 0; - nCount /= nDefTabDist; - nNextPos = ( nCount + 1 ) * nDefTabDist ; + nNextPos = nCount < 0 || (!nCount && nSearchPos <= 0)? nCount * nDefTabDist :( nCount + 1 ) * nDefTabDist ; // --> FME 2004-09-21 #117919 Minimum tab stop width is 1 or 51 twips: const SwTwips nMinimumTabWidth = pFrm->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) ? 0 : 50; // <-- -- cgit v1.2.3 From 11d8ea29f01ea3ca48b19c07e5a241b640ecc20e Mon Sep 17 00:00:00 2001 From: os Date: Mon, 15 Feb 2010 09:51:03 +0100 Subject: unused code removed --- sw/source/core/unocore/unotbl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 309d14b24c..868a9fc07d 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -3362,8 +3362,8 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, pUnoCrsr->Move( fnMoveForward, fnGoNode ); pUnoCrsr->SetRemainInSection( sal_False ); - SwTableLine* pLastLine = rLines[rLines.Count() - 1]; - SwTableBoxes &rBoxes = pLastLine->GetTabBoxes(); + + const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); pUnoCrsr->SetMark(); pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); -- cgit v1.2.3 From 99470f3c6d454dc9665ee3c0e0b5c0fe226d50bc Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Tue, 16 Feb 2010 17:26:41 +0100 Subject: hb33issues01: #i109284# SwRTFWriter::OutBookmarks: Do not read name of NULL bookmark pointer --- sw/source/filter/rtf/wrtrtf.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx index 65828f6d53..393c5f1d48 100644 --- a/sw/source/filter/rtf/wrtrtf.cxx +++ b/sw/source/filter/rtf/wrtrtf.cxx @@ -1305,8 +1305,17 @@ void SwRTFWriter::OutBookmarks( xub_StrLen nCntntPos) Strm() << '}'; } OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKEND ) << ' '; - RTFOutFuncs::Out_String( Strm(), pAsBookmark->GetName(), + + { + ::rtl::OUString aEmpty; + ::rtl::OUString & rBookmarkName = aEmpty; + + if (pAsBookmark) + rBookmarkName = pAsBookmark->GetName(); + + RTFOutFuncs::Out_String( Strm(), rBookmarkName, eDefaultEncoding, bWriteHelpFmt ) << '}'; + } if(++nBkmkTabPos >= pMarkAccess->getMarksCount()) nBkmkTabPos = -1; -- cgit v1.2.3 From 2d6437a056acb00a4b67c969b4e21730edc52150 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 19 Mar 2010 11:13:29 +0100 Subject: cws tl79: #i110254# new 'Security' tab page --- sw/source/ui/uiview/view2.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 sw/source/ui/uiview/view2.cxx (limited to 'sw/source') diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx old mode 100644 new mode 100755 index 4c393be565..d905762fd2 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -540,8 +541,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) // xmlsec05: new password dialog Window* pParent; const SfxPoolItem* pParentItem; - if( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_PARENTWINDOW, FALSE, &pParentItem ) ) - pParent = ( Window* ) ( ( const OfaPtrItem* ) pParentItem )->GetValue(); + if( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) ) + pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); SfxPasswordDialog aPasswdDlg( pParent ); @@ -576,8 +577,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) // message box for wrong password Window* pParent; const SfxPoolItem* pParentItem; - if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_PARENTWINDOW, FALSE, &pParentItem ) ) - pParent = ( Window* ) ( ( const OfaPtrItem* ) pParentItem )->GetValue(); + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) ) + pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); SfxPasswordDialog aPasswdDlg( pParent ); -- cgit v1.2.3 From 317bb39133c33519ffb6ee00a27dba1ee5b6e171 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 30 Mar 2010 16:34:51 +0200 Subject: tl78: #i110383# support password to modify --- sw/source/ui/uno/SwXDocumentSettings.cxx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index df8e740438..96213e8de6 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -122,8 +122,9 @@ enum SwDocumentSettingsPropertyHandles HANDLE_PROTECT_FORM, HANDLE_TABS_RELATIVE_TO_INDENT, // --> OD 2008-06-05 #i89181# - HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST + HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- + HANDLE_MODIFYPASSWORDHASH }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -177,6 +178,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0}, // --> OD 2008-06-05 #i89181# { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordHash"), HANDLE_MODIFYPASSWORDHASH, CPPUTYPE_INT32, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -671,6 +673,21 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf } break; // <-- + case HANDLE_MODIFYPASSWORDHASH: + { + sal_Int32 nHash = 0; + if ( !( rValue >>= nHash ) || nHash < 0 || nHash > SAL_MAX_UINT16 ) + throw lang::IllegalArgumentException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value of type INT32, representing UINT16 expected!" ) ), + uno::Reference< uno::XInterface >(), + 2 ); + + if ( !mpDocSh->SetModifyPasswordHash( static_cast< sal_uInt16 >( nHash ) ) ) + throw beans::PropertyVetoException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The hash is not allowed to be changed now!" ) ), + uno::Reference< uno::XInterface >() ); + } + break; default: throw UnknownPropertyException(); } @@ -998,6 +1015,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf } break; // <-- + case HANDLE_MODIFYPASSWORDHASH: + { + rValue <<= static_cast< sal_Int32 >( mpDocSh->GetModifyPasswordHash() ); + } + break; default: throw UnknownPropertyException(); -- cgit v1.2.3 From 8e444939ac6d24a66eb359b126e433a397ba4d73 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 22 Apr 2010 13:08:19 +0200 Subject: cws tl80: #i110341# problems with spell check dialog fixed --- sw/inc/crsrsh.hxx | 1 + sw/inc/editsh.hxx | 7 +- sw/inc/swcrsr.hxx | 1 + sw/source/core/crsr/crstrvl1.cxx | 4 + sw/source/core/crsr/swcrsr.cxx | 80 +++++++++++-- sw/source/core/edit/edlingu.cxx | 58 ++++++++- sw/source/filter/ww8/wrtww8.cxx | 24 ++-- sw/source/ui/dialog/SwSpellDialogChildWindow.cxx | 146 ++++++++++++++--------- sw/source/ui/inc/SwSpellDialogChildWindow.hxx | 4 +- sw/source/ui/inc/view.hxx | 2 +- sw/source/ui/uiview/viewdraw.cxx | 7 +- 11 files changed, 249 insertions(+), 85 deletions(-) mode change 100644 => 100755 sw/source/filter/ww8/wrtww8.cxx (limited to 'sw/source') diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index d8683707b7..41a6e73c50 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -746,6 +746,7 @@ public: BOOL GoStartSentence(); BOOL GoEndSentence(); BOOL SelectWord( const Point* pPt = 0 ); + BOOL ExpandToSentenceBorders(); // Position vom akt. Cursor erfragen BOOL IsStartWord()const; diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index d64358d333..1ed1d5a3b7 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -743,9 +743,14 @@ public: bool SpellSentence(::svx::SpellPortions& rToFill, bool bIsGrammarCheck ); // make SpellIter start with the current sentence when called next time void PutSpellingToSentenceStart(); + // moves the continuation position to the end of the currently checked sentence + void MoveContinuationPosToEndOfCheckedSentence(); //applies a changed sentence - void ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bIsGrammarCheck); + void ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck); + + // check SwSpellIter data to see if the last sentence got grammar checked + bool HasLastSentenceGotGrammarChecked() const; // Is text conversion active somewhere else? BOOL HasConvIter() const; // Is hyphenation active somewhere else? diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index a21d6cbf59..6085b1e1bb 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -162,6 +162,7 @@ public: BOOL GoEndSentence(){return GoSentence(END_SENT);} BOOL GoPrevSentence(){return GoSentence(PREV_SENT);} BOOL GoStartSentence(){return GoSentence(START_SENT);} + BOOL ExpandToSentenceBorders(); virtual BOOL LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, BOOL bAllowVisual, BOOL bSkipHidden, BOOL bInsertCrsr ); diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx index b240921998..1901cc373b 100644 --- a/sw/source/core/crsr/crstrvl1.cxx +++ b/sw/source/core/crsr/crstrvl1.cxx @@ -94,4 +94,8 @@ BOOL SwCrsrShell::SelectWord( const Point* pPt ) return pCurCrsr->SelectWord( pPt ); } +BOOL SwCrsrShell::ExpandToSentenceBorders() +{ + return pCurCrsr->ExpandToSentenceBorders(); +} diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 0c782643f1..794c949c35 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1401,11 +1401,11 @@ BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) } //----------------------------------------------------------------------------- -BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) + +static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd ) { - BOOL bRet = FALSE; - const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); - if( pTxtNd && pBreakIt->GetBreakIter().is() ) + String aRes; + if (pTxtNd) { //mask deleted redlines String sNodeText(pTxtNd->GetTxt()); @@ -1430,11 +1430,30 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) } } } + aRes = sNodeText; + } + return aRes; +} + +BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) +{ + BOOL bRet = FALSE; + const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); + if( pTxtNd && pBreakIt->GetBreakIter().is() ) + { + String sNodeText( lcl_MaskDeletedRedlines( pTxtNd ) ); + SwCrsrSaveState aSave( *this ); xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); switch ( eMoveType ) { - case END_SENT: + case START_SENT: /* when modifying: see also ExpandToSentenceBorders below! */ + nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence( + sNodeText, + nPtPos, pBreakIt->GetLocale( + pTxtNd->GetLang( nPtPos ) )); + break; + case END_SENT: /* when modifying: see also ExpandToSentenceBorders below! */ nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfSentence( sNodeText, nPtPos, pBreakIt->GetLocale( @@ -1451,12 +1470,6 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) ; break; } - case START_SENT: - nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence( - sNodeText, - nPtPos, pBreakIt->GetLocale( - pTxtNd->GetLang( nPtPos ) )); - break; case PREV_SENT: nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence( sNodeText, @@ -1484,6 +1497,51 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) return bRet; } + +BOOL SwCursor::ExpandToSentenceBorders() +{ + BOOL bRes = FALSE; + const SwTxtNode* pStartNd = Start()->nNode.GetNode().GetTxtNode(); + const SwTxtNode* pEndNd = End()->nNode.GetNode().GetTxtNode(); + if (pStartNd && pEndNd && pBreakIt->GetBreakIter().is()) + { + if (!HasMark()) + SetMark(); + + String sStartText( lcl_MaskDeletedRedlines( pStartNd ) ); + String sEndText( pStartNd == pEndNd? sStartText : lcl_MaskDeletedRedlines( pEndNd ) ); + + SwCrsrSaveState aSave( *this ); + xub_StrLen nStartPos = Start()->nContent.GetIndex(); + xub_StrLen nEndPos = End()->nContent.GetIndex(); + + nStartPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence( + sStartText, nStartPos, + pBreakIt->GetLocale( pStartNd->GetLang( nStartPos ) ) ); + nEndPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfSentence( + sEndText, nEndPos, + pBreakIt->GetLocale( pEndNd->GetLang( nEndPos ) ) ); + + // it is allowed to place the PaM just behind the last + // character in the text thus <= ...Len + bool bChanged = false; + if (nStartPos <= pStartNd->GetTxt().Len()) + { + GetMark()->nContent = nStartPos; + bChanged = true; + } + if (nEndPos <= pEndNd->GetTxt().Len()) + { + GetPoint()->nContent = nEndPos; + bChanged = true; + } + if (bChanged && !IsSelOvr()) + bRes = TRUE; + } + return bRes; +} + + BOOL SwTableCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT /*nMode*/, BOOL /*bVisualAllowed*/, BOOL /*bSkipHidden*/, BOOL /*bInsertCrsr*/ ) { diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 6c9f6c2f3b..d136102a2f 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -136,6 +136,7 @@ class SwSpellIter : public SwLinguIter SpellContentPositions aLastPositions; bool bBackToStartOfSentence; + bool bMoveToEndOfSentence; void CreatePortion(uno::Reference< XSpellAlternatives > xAlt, @@ -147,7 +148,7 @@ class SwSpellIter : public SwLinguIter const SpellContentPositions& rDeletedRedlines); public: SwSpellIter() : - bBackToStartOfSentence(false) {} + bBackToStartOfSentence(false), bMoveToEndOfSentence(false) {} void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd ); @@ -157,6 +158,7 @@ public: void ToSentenceStart(); const ::svx::SpellPortions GetLastPortions(){ return aLastPortions;} SpellContentPositions GetLastPositions() {return aLastPositions;} + void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; } }; /************************************************************************* @@ -693,6 +695,24 @@ void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos ) // --------------------- Methoden der SwEditShell ------------------------ +bool SwEditShell::HasLastSentenceGotGrammarChecked() const +{ + bool bTextWasGrammarChecked = false; + if (pSpellIter) + { + ::svx::SpellPortions aLastPortions( pSpellIter->GetLastPortions() ); + for (size_t i = 0; i < aLastPortions.size() && !bTextWasGrammarChecked; ++i) + { + // bIsGrammarError is also true if the text was only checked but no + // grammar error was found. (That is if a ProofreadingResult was obtained in + // SwDoc::Spell and in turn bIsGrammarError was set in SwSpellIter::CreatePortion) + if (aLastPortions[i].bIsGrammarError) + bTextWasGrammarChecked = true; + } + } + return bTextWasGrammarChecked; +} + /************************************************************************* * SwEditShell::HasConvIter *************************************************************************/ @@ -1283,7 +1303,20 @@ sal_uInt32 lcl_CountRedlines( /*-- 18.09.2003 15:08:20--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bIsGrammarCheck) + +void SwEditShell::MoveContinuationPosToEndOfCheckedSentence() +{ + // give hint that continuation position for spell/grammar checking is + // at the end of this sentence + if (pSpellIter) + { + pSpellIter->SetCurr( new SwPosition( *pSpellIter->GetCurrX() ) ); + pSpellIter->ContinueAfterThisSentence(); + } +} + + +void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck) { ASSERT( pSpellIter, "SpellIter missing" ); if(pSpellIter) @@ -1300,9 +1333,14 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, if(!rLastPortions.size()) return; - SwPaM *pCrsr = GetCrsr(); pDoc->StartUndo( UNDO_OVERWRITE, NULL ); StartAction(); + + SwPaM *pCrsr = GetCrsr(); + // save cursor position (which should be at the end of the current sentence) + // for later restoration + Push(); + sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions); if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size()) { @@ -1391,16 +1429,24 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, //set the cursor to the end of the inserted string *pCrsr->Start() = *pCrsr->End(); ++aCurrentNewPortion; - } } - //set the cursor to the end of the new sentence + + // restore cursor to the end of the sentence + // (will work also if the sentence length has changed, + // since cursors get updated automatically!) + Pop( FALSE ); + + // collapse cursor to the end of the modified sentence *pCrsr->Start() = *pCrsr->End(); - if( bIsGrammarCheck) + if (bRecheck) { //in grammar check the current sentence has to be checked again GoStartSentence(); } + // set continuation position for spell/grammar checking to the end of this sentence + pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) ); + pDoc->EndUndo( UNDO_OVERWRITE, NULL ); EndAction(); } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx old mode 100644 new mode 100755 index 916ad970df..8b8204752d --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2433,13 +2433,15 @@ typedef ::std::deque SwNodeDeque; void MSWordExportBase::WriteText() { -#ifdef DEBUG - ::std::clog << "" << ::std::endl; - ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl; - - SwNodeHashSet aNodeSet; - SwNodeDeque aNodeDeque; -#endif +// whoever has need of the missing function should go and implement it! +// This damned piece of code always breaks builds... +//#ifdef DEBUG +// ::std::clog << "" << ::std::endl; +// ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl; +// +// SwNodeHashSet aNodeSet; +// SwNodeDeque aNodeDeque; +//#endif while( pCurPam->GetPoint()->nNode < pCurPam->GetMark()->nNode || ( pCurPam->GetPoint()->nNode == pCurPam->GetMark()->nNode && @@ -2447,6 +2449,9 @@ void MSWordExportBase::WriteText() { SwNode * pNd = pCurPam->GetNode(); +// whoever has need of the missing function should go and implement it! +// This damned piece of code always breaks builds... +#if 0 #ifdef DEBUG if (aNodeSet.find(pNd) == aNodeSet.end()) { @@ -2468,6 +2473,7 @@ void MSWordExportBase::WriteText() ::std::clog << "" << ::std::endl; } +#endif #endif if ( pNd->IsTxtNode() ) @@ -3722,7 +3728,9 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) { #ifdef DEBUG - ::std::clog << "" << dbg_out(&rNode) << ::std::endl; +// whoever has need of the missing function should go and implement it! +// This damned piece of code always breaks builds... +// ::std::clog << "" << dbg_out(&rNode) << ::std::endl; #endif ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = mpTableInfo->getTableNodeInfo( &rNode ); diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index 4ae70d26db..b7fd189741 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -32,13 +32,13 @@ #include #include #include -#ifndef _SVX_SVXIDS_HRC #include -#endif #include #include #include #include +#include +#include #include #include #include @@ -56,9 +56,7 @@ #include #include #include -#ifndef _DIALOG_HXX #include -#endif #include @@ -202,12 +200,19 @@ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const -----------------------------------------------------------------------*/ -svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) +svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck) { svx::SpellPortions aRet; SwWrtShell* pWrtShell = GetWrtShell_Impl(); if(pWrtShell) { + if (!bRecheck) + { + // first set continuation point for spell/grammar check to the + // end of the current sentence + pWrtShell->MoveContinuationPosToEndOfCheckedSentence(); + } + ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; bool bNormalText = @@ -239,7 +244,10 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) if(!pWrtShell->HasSelection()) pWrtShell->GoStartSentence(); else + { + pWrtShell->ExpandToSentenceBorders(); m_pSpellState->m_bStartedInSelection = true; + } //determine if the selection is outside of the body text bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY); m_pSpellState->m_SpellStartPosition = bOtherText ? SPELL_START_OTHER : SPELL_START_BODY; @@ -269,7 +277,24 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) m_pSpellState->m_SpellStartPosition = SPELL_START_DRAWTEXT; m_pSpellState->m_pStartDrawing = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - m_pSpellState->m_aStartDrawingSelection = pOLV->GetSelection(); + // start checking at the top of the drawing object + pOLV->SetSelection( ESelection() ); + m_pSpellState->m_aStartDrawingSelection = ESelection(); +/* +Note: spelling in a selection only, or starting in a mid of a drawing object requires +further changes elsewhere. (Especially if it should work in sc and sd as well.) +The code below would only be part of the solution. +(Keeping it a as a comment for the time being) + ESelection aCurSel( pOLV->GetSelection() ); + ESelection aSentenceSel( pOLV->GetEditView().GetEditEngine()->SelectSentence( aCurSel ) ); + if (!aCurSel.HasRange()) + { + aSentenceSel.nEndPara = aSentenceSel.nStartPara; + aSentenceSel.nEndPos = aSentenceSel.nStartPos; + } + pOLV->SetSelection( aSentenceSel ); + m_pSpellState->m_aStartDrawingSelection = aSentenceSel; +*/ } m_pSpellState->m_bInitialCall = false; @@ -316,61 +341,66 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) //spell inside of the Writer text if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) { - //find out which text has been spelled body or other - bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY); - if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor) + // if there is a selection (within body or header/footer text) + // then spell/grammar checking should not move outside of it. + if (!m_pSpellState->m_bStartedInSelection) { - m_pSpellState->m_bStartedInOther = false; - pWrtShell->SetSelection(*m_pSpellState->pOtherCursor); - pWrtShell->SpellEnd(); - delete m_pSpellState->pOtherCursor; - m_pSpellState->pOtherCursor = 0; - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, FALSE ); - pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn); - } - if(!aRet.size()) - { - //end spelling - pWrtShell->SpellEnd(); - if(bOtherText) + //find out which text has been spelled body or other + bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY); + if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor) { - m_pSpellState->m_bOtherSpelled = true; - //has the body been spelled? - if(!m_pSpellState->m_bBodySpelled) + m_pSpellState->m_bStartedInOther = false; + pWrtShell->SetSelection(*m_pSpellState->pOtherCursor); + pWrtShell->SpellEnd(); + delete m_pSpellState->pOtherCursor; + m_pSpellState->pOtherCursor = 0; + pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, FALSE ); + pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn); + } + if(!aRet.size()) + { + //end spelling + pWrtShell->SpellEnd(); + if(bOtherText) { - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, FALSE ); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) + m_pSpellState->m_bOtherSpelled = true; + //has the body been spelled? + if(!m_pSpellState->m_bBodySpelled) { - m_pSpellState->m_bBodySpelled = true; - pWrtShell->SpellEnd(); + pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, FALSE ); + if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) + { + m_pSpellState->m_bBodySpelled = true; + pWrtShell->SpellEnd(); + } } } + else + { + m_pSpellState->m_bBodySpelled = true; + if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt()) + { + pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, FALSE ); + if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) + { + pWrtShell->SpellEnd(); + m_pSpellState->m_bOtherSpelled = true; + } + } + else + m_pSpellState->m_bOtherSpelled = true; + } } - else + + //search for a draw text object that contains error and spell it + if(!aRet.size() && + (m_pSpellState->m_bDrawingsSpelled || + !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet))) { - m_pSpellState->m_bBodySpelled = true; - if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt()) - { - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, FALSE ); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - { - pWrtShell->SpellEnd(); - m_pSpellState->m_bOtherSpelled = true; - } - } - else - m_pSpellState->m_bOtherSpelled = true; + lcl_LeaveDrawText(*pWrtShell); + m_pSpellState->m_bDrawingsSpelled = true; } } - - //search for a draw text object that contains error and spell it - if(!aRet.size() && - (m_pSpellState->m_bDrawingsSpelled || - !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet))) - { - lcl_LeaveDrawText(*pWrtShell); - m_pSpellState->m_bDrawingsSpelled = true; - } } } // now only the rest of the body text can be spelled - @@ -430,7 +460,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) /*-- 09.09.2003 10:39:40--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged) +void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck) { SwWrtShell* pWrtShell = GetWrtShell_Impl(); DBG_ASSERT(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume"); @@ -443,13 +473,19 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC SHELL_MODE_LIST_TEXT == eSelMode || SHELL_MODE_TABLE_LIST_TEXT == eSelMode || SHELL_MODE_TEXT == eSelMode; + + // evaluate if the same sentence should be rechecked or not. + // Sentences that got grammar checked should always be rechecked in order + // to detect possible errors that get introduced with the changes + bRecheck |= pWrtShell->HasLastSentenceGotGrammarChecked(); + if(bNormalText) - pWrtShell->ApplyChangedSentence(rChanged, m_bIsGrammarCheckingOn); + pWrtShell->ApplyChangedSentence(rChanged, bRecheck); else if(bDrawText ) { SdrView* pDrView = pWrtShell->GetDrawView(); SdrOutliner *pOutliner = pDrView->GetTextEditOutliner(); - pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, m_bIsGrammarCheckingOn); + pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, bRecheck); } } } @@ -847,7 +883,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) Point aTmp( 0,0 ); rSh.SelectObj( aTmp, 0, pTextObj ); SdrPageView* pPV = pDrView->GetSdrPageView(); - rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), FALSE ); + rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), FALSE, TRUE ); rView.AttrChangedNotify(&rSh); bNextDoc = true; } diff --git a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx index 5628aed15b..cc7462f6d8 100644 --- a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx +++ b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx @@ -48,8 +48,8 @@ class SwSpellDialogChildWindow void LockFocusNotification(bool bLock); protected: - virtual svx::SpellPortions GetNextWrongSentence (void); - virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged); + virtual svx::SpellPortions GetNextWrongSentence(bool bRecheck); + virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck); virtual void AddAutoCorrection(const String& rOld, const String& rNew, LanguageType eLanguage); virtual bool HasAutoCorrection(); virtual bool HasGrammarChecking(); diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 4712c76e24..436375c094 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -574,7 +574,7 @@ public: BOOL HasDrwObj(SdrObject *pSdrObj) const; BOOL HasOnlyObj(SdrObject *pSdrObj, UINT32 eObjInventor) const; BOOL BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL, - Window* pWin=NULL, BOOL bIsNewObj=FALSE); + Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false ); void StateTabWin(SfxItemSet&); diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index 8d67a14603..11022252e9 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -520,7 +520,8 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos) /****************************************************************************** * Beschreibung: DrawTextEditMode einschalten ******************************************************************************/ -sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, sal_Bool bIsNewObj) +sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, + bool bIsNewObj, bool bSetSelectionToStart) { SwWrtShell *pSh = &GetWrtShell(); SdrView *pSdrView = pSh->GetDrawView(); @@ -606,7 +607,11 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, Color aBackground(pSh->GetShapeBackgrd()); pView->SetBackgroundColor(aBackground); } + + // editing should start at the end of text, spell checking at the beginning ... ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); + if (bSetSelectionToStart) + aNewSelection = ESelection(); pView->SetSelection(aNewSelection); } -- cgit v1.2.3 From 1f181f252cb04a9a61e75127f133d37583c846ad Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 23 Apr 2010 11:43:57 +0200 Subject: cws tl80: #i110180# printing options UI fixed --- sw/source/ui/config/optpage.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) mode change 100644 => 100755 sw/source/ui/config/optpage.cxx (limited to 'sw/source') diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx old mode 100644 new mode 100755 index 40c17f9866..8d3943834c --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -542,10 +542,15 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) aFaxLB.SelectEntry( pAddPrinterAttr->sFaxName ); } if (aProspectCB.IsChecked()) + { aProspectCB_RTL.Enable(TRUE); + aNoRB.Enable( FALSE ); + aOnlyRB.Enable( FALSE ); + aEndRB.Enable( FALSE ); + aEndPageRB.Enable( FALSE ); + } else - aProspectCB_RTL.Disable(); - + aProspectCB_RTL.Enable( FALSE ); } //----------------------------------------------------------------------- @@ -560,13 +565,14 @@ void SwAddPrinterTabPage::Init() IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) { bAttrModified = TRUE; - if (aProspectCB.IsChecked()) - aProspectCB_RTL.Enable(TRUE); - else - { + bool bIsProspect = aProspectCB.IsChecked(); + if (!bIsProspect) aProspectCB_RTL.Check( FALSE ); - aProspectCB_RTL.Disable(); - } + aProspectCB_RTL.Enable( bIsProspect ); + aNoRB.Enable( !bIsProspect ); + aOnlyRB.Enable( !bIsProspect ); + aEndRB.Enable( !bIsProspect ); + aEndPageRB.Enable( !bIsProspect ); return 0; } IMPL_LINK_INLINE_END( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) -- cgit v1.2.3 From fdef3e80c75cc006744c85d09c28c685dd977d9f Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 28 Apr 2010 09:43:21 +0200 Subject: cws tl80: #162104# remove Writer easter egg --- sw/inc/dochdl.hrc | 4 +--- sw/source/ui/dochdl/dochdl.src | 9 --------- sw/source/ui/dochdl/gloshdl.cxx | 45 +++-------------------------------------- 3 files changed, 4 insertions(+), 54 deletions(-) mode change 100644 => 100755 sw/inc/dochdl.hrc mode change 100644 => 100755 sw/source/ui/dochdl/dochdl.src mode change 100644 => 100755 sw/source/ui/dochdl/gloshdl.cxx (limited to 'sw/source') diff --git a/sw/inc/dochdl.hrc b/sw/inc/dochdl.hrc old mode 100644 new mode 100755 index b423351723..8e5980e244 --- a/sw/inc/dochdl.hrc +++ b/sw/inc/dochdl.hrc @@ -43,10 +43,8 @@ #define STR_PRIVATEOLE (RC_DOCHDL_BEGIN + 10) #define STR_DDEFORMAT (RC_DOCHDL_BEGIN + 11) -#define BMP_SW_TEAM_MUGSHOT (RC_DOCHDL_BEGIN + 12) -#define STR_SW_TEAM_NAMES (RC_DOCHDL_BEGIN + 13) -#define DOCHDL_ACT_END STR_SW_TEAM_NAMES +#define DOCHDL_ACT_END STR_DDEFORMAT #if DOCHDL_ACT_END > RC_DOCHDL_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/dochdl/dochdl.src b/sw/source/ui/dochdl/dochdl.src old mode 100644 new mode 100755 index fb4db99410..2afd19c92b --- a/sw/source/ui/dochdl/dochdl.src +++ b/sw/source/ui/dochdl/dochdl.src @@ -73,13 +73,4 @@ String STR_DDEFORMAT { Text [ en-US ] = "DDE link" ; }; -Bitmap BMP_SW_TEAM_MUGSHOT -{ - File ="writerteam.bmp"; -}; - -String STR_SW_TEAM_NAMES -{ - Text = "Back row: Aidan Butler, Hans-Peter Burow, Caolan McNamara, Michael Brauer, Martin Maher, Gunnar Timm\nFront row: Thomas Lange, Oliver-Rainer Duesterhoeft, Henning Brinkmann, Andreas Martens, Oliver Specht, Frank Meies, Daniel Vogelheim"; -}; diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx old mode 100644 new mode 100755 index f51cfde701..c19fb0bd9d --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -607,48 +607,9 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName, aShortName.Erase(nMaxLen); aShortName.AppendAscii(" ..."); } - if ( aShortName.EqualsAscii ( "StarWriterTeam", 0, 14 ) ) - { - String sGraphicName ( RTL_CONSTASCII_USTRINGPARAM ( "StarWriter team photo" ) ); - String sTeamCredits ( RTL_CONSTASCII_USTRINGPARAM ( "StarWriter team credits" ) ); - pWrtShell->StartUndo ( UNDO_INSGLOSSARY ); - pWrtShell->StartAllAction(); - if(pWrtShell->HasSelection()) - pWrtShell->DelLeft(); - Bitmap aBitmap ( SW_RES ( BMP_SW_TEAM_MUGSHOT ) ); - pWrtShell->Insert ( aEmptyStr, aEmptyStr, aBitmap); - pWrtShell->SetFlyName ( sGraphicName ); - SwTxtFmtColl* pColl = pWrtShell->GetTxtCollFromPool ( RES_POOLCOLL_LABEL_ABB ); - const IDocumentFieldsAccess* pIDFA = pWrtShell->getIDocumentFieldsAccess(); - SwFieldType* pType = pIDFA->GetFldType( RES_SETEXPFLD, pColl->GetName(), false ); - sal_uInt16 nId = pIDFA->GetFldTypes()->GetPos( pType ); - pWrtShell->InsertLabel( LTYPE_OBJECT, aEmptyStr, aEmptyStr, aEmptyStr, FALSE, nId, aEmptyStr ); - pWrtShell->SwFEShell::SetFlyName( sTeamCredits ); - pWrtShell->SwFEShell::SelectObj ( Point ( ULONG_MAX, ULONG_MAX ) ); - pWrtShell->EnterStdMode(); - pWrtShell->EndPara ( TRUE ); - String aTmp ( SW_RES ( STR_SW_TEAM_NAMES ) ); - pWrtShell->Insert ( aTmp ); - SvxAdjustItem aAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ); - pWrtShell->SetAttr( aAdjustItem ); - pWrtShell->SttPara (); - pWrtShell->SplitNode(); - pWrtShell->Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE ); - SvxWeightItem aWeightItem ( WEIGHT_BOLD, RES_CHRATR_WEIGHT ); - pWrtShell->Insert ( String ( RTL_CONSTASCII_USTRINGPARAM ( "The StarWriter team!" ) ) ); - pWrtShell->SttPara ( TRUE ); - pWrtShell->SetAttr( aWeightItem); - pWrtShell->GotoFly ( sTeamCredits); - pWrtShell->EndAllAction(); - pWrtShell->EndUndo( UNDO_INSGLOSSARY ); - } - else - { - String aTmp( SW_RES(STR_NOGLOS)); - aTmp.SearchAndReplaceAscii("%1", aShortName); - InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute(); - - } + String aTmp( SW_RES(STR_NOGLOS)); + aTmp.SearchAndReplaceAscii("%1", aShortName); + InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute(); } return FALSE; -- cgit v1.2.3 From 9140787c117fc3a43693d8b839207fe5da4bdbd3 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 29 Apr 2010 11:10:06 +0200 Subject: cws tl80: #i98575# memory leak fixed --- sw/source/ui/docvw/postit.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) mode change 100644 => 100755 sw/source/ui/docvw/postit.cxx (limited to 'sw/source') diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx old mode 100644 new mode 100755 index 44bf3263a9..637484c702 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -1259,7 +1259,12 @@ void SwMarginWin::ExecuteCommand(USHORT nSlot) SwView* pView = DocView(); if (Engine()->GetEditEngine().GetText() != String(EMPTYSTRING)) { - OutlinerParaObject* pPara = new OutlinerParaObject(*View()->GetEditView().CreateTextObject()); + // since we will be owner of the object returned by CreateTextObject, + // and OutlinerParaObject will clone that one, we need to delete the + // original object. + EditTextObject* pTemporaryText = View()->GetEditView().CreateTextObject(); + OutlinerParaObject* pPara = new OutlinerParaObject( *pTemporaryText ); + delete pTemporaryText; Mgr()->RegisterAnswer(pPara); } if (Mgr()->GetActivePostIt()) -- cgit v1.2.3 From 4fff7a7bc9e9e25540788fc57152c37a4ee093db Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 10 May 2010 13:59:35 +0200 Subject: CWS mba33issues01: #i93818#: prevent crash by not forwarding reference device --- sw/source/ui/docvw/postit.cxx | 6 ------ 1 file changed, 6 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index 363a653670..37ddfef978 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -730,12 +730,6 @@ void SwMarginWin::InitControls() mpOutliner->SetUpdateMode( TRUE ); Rescale(); - OutputDevice* pDev = aShell->GetDoc()->getReferenceDevice(TRUE); - if ( pDev ) - { - mpOutliner->SetRefDevice( pDev ); - } - mpOutlinerView = new OutlinerView ( mpOutliner, mpPostItTxt ); mpOutlinerView->SetBackgroundColor(COL_TRANSPARENT); mpOutliner->InsertView(mpOutlinerView ); -- cgit v1.2.3 From d0d49414696149c8ecb15ef03f47b12ea395ad06 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Wed, 12 May 2010 12:42:08 +0200 Subject: tl78: get/set password to modify from SwDocShell --- sw/source/filter/ww8/wrtww8.cxx | 22 +++++++++++++++++++--- sw/source/filter/ww8/ww8par.cxx | 13 +++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 916ad970df..6168f2c4a4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -255,13 +255,30 @@ static void WriteDop( WW8Export& rWrt ) SwDocShell *pDocShell(rWrt.pDoc->GetDocShell()); DBG_ASSERT(pDocShell, "no SwDocShell"); uno::Reference xDocProps; + uno::Reference xProps; if (pDocShell) { + uno::Reference xModelComp(pDocShell->GetModel(), + uno::UNO_QUERY); + xProps = uno::Reference(xModelComp, + uno::UNO_QUERY); uno::Reference xDPS( - pDocShell->GetModel(), uno::UNO_QUERY_THROW); + xModelComp, uno::UNO_QUERY_THROW); xDocProps = xDPS->getDocumentProperties(); DBG_ASSERT(xDocProps.is(), "DocumentProperties is null"); + + rDop.lKeyProtDoc = pDocShell->GetModifyPasswordHash(); } + if ((rWrt.pSepx && rWrt.pSepx->DocumentIsProtected()) || + rDop.lKeyProtDoc != 0) + { + rDop.fProtEnabled = 1; + } + else + { + rDop.fProtEnabled = 0; + } + if (!xDocProps.is()) { rDop.dttmCreated = rDop.dttmRevised = rDop.dttmLastPrint = 0x45FBAC69; } else { @@ -277,9 +294,8 @@ static void WriteDop( WW8Export& rWrt ) Date aD3(uDT.Day, uDT.Month, uDT.Year); Time aT3(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); rDop.dttmLastPrint = sw::ms::DateTime2DTTM(DateTime(aD3,aT3)); - } - rDop.fProtEnabled = rWrt.pSepx ? rWrt.pSepx->DocumentIsProtected() : 0; + } // auch damit werden die DocStat-Felder in Kopf-/Fusszeilen nicht korrekt // berechnet. diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 58257baebb..dd48e2ec25 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1387,14 +1387,19 @@ void SwWW8ImplReader::ImportDop() uno::Reference xInfo = xDocProps->getPropertySetInfo(); sal_Bool bValue = false; - if (xInfo.is() && - xInfo->hasPropertyByName(C2U("ApplyFormDesignMode"))) + if (xInfo.is()) { - xDocProps->setPropertyValue(C2U("ApplyFormDesignMode"), - cppu::bool2any(bValue)); + if (xInfo->hasPropertyByName(C2U("ApplyFormDesignMode"))) + { + xDocProps->setPropertyValue(C2U("ApplyFormDesignMode"), + cppu::bool2any(bValue)); + } } } } + + mpDocShell->SetModifyPasswordHash(pWDop->lKeyProtDoc); + const SvtFilterOptions* pOpt = SvtFilterOptions::Get(); sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields()); if (bUseEnhFields) { -- cgit v1.2.3 From 8d28b7d4cdbe6db1dd220abb832638a8ac4a2c02 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 18 May 2010 17:08:55 +0200 Subject: CWS mba33issues01: #i99402#: typo RapairPackage --- starmath/source/smdetect.cxx | 2 +- sw/source/ui/uno/swdetect.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source') diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index bc01b2d7c9..e6f4e12373 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -168,7 +168,7 @@ SmFilterDetect::~SmFilterDetect() } else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")) ) lDescriptor[nProperty].Value >>= xInteraction; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RapairPackage")) ) + else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")) ) lDescriptor[nProperty].Value >>= bRepairPackage; else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")) ) nIndexOfDocumentTitle = nProperty; diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index 95153b0019..5bbf2bdf07 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -167,7 +167,7 @@ SwFilterDetect::~SwFilterDetect() lDescriptor[nProperty].Value >>= xInteraction; nIndexOfInteractionHandler = nProperty; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RapairPackage")) ) + else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")) ) lDescriptor[nProperty].Value >>= bRepairPackage; else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")) ) nIndexOfDocumentTitle = nProperty; -- cgit v1.2.3 From f1d9fc466b96e54f80f9d29f6666c8b242c88e44 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 19 May 2010 14:28:33 +0200 Subject: cws tl79: #i110254# new security tap page in 'File/Properties' --- sw/inc/docsh.hxx | 7 +++++ sw/sdi/swriter.sdi | 2 +- sw/source/filter/ww8/wrtww8.cxx | 6 +++- sw/source/ui/app/docsh.cxx | 66 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) mode change 100644 => 100755 sw/sdi/swriter.sdi mode change 100644 => 100755 sw/source/filter/ww8/wrtww8.cxx mode change 100644 => 100755 sw/source/ui/app/docsh.cxx (limited to 'sw/source') diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 0f1a15be56..5ac0a010b4 100755 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -302,6 +303,12 @@ public: SfxInPlaceClient* GetIPClient( const ::svt::EmbeddedObjectRef& xObjRef ); virtual const ::sfx2::IXmlIdRegistry* GetXmlIdRegistry() const; + + // passwword protection for Writer (derived from SfxObjectShell) + // see also: FN_REDLINE_ON, FN_REDLINE_ON + virtual void SetChangeRecording( bool bActivate ); + virtual bool SetProtectionPassword( const String &rPassword ); + virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash ); }; class Graphic; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi old mode 100644 new mode 100755 index aede24688e..7d7bb04db3 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -6623,7 +6623,7 @@ SfxBoolItem ProtectTraceChangeMode FN_REDLINE_PROTECT FastCall = FALSE, HasCoreId = FALSE, HasDialog = FALSE, - ReadOnlyDoc = TRUE, + ReadOnlyDoc = FALSE, Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx old mode 100644 new mode 100755 index 916ad970df..1bfa70b5b3 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2434,11 +2434,13 @@ typedef ::std::deque SwNodeDeque; void MSWordExportBase::WriteText() { #ifdef DEBUG +#if 0 ::std::clog << "" << ::std::endl; ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl; SwNodeHashSet aNodeSet; SwNodeDeque aNodeDeque; +#endif #endif while( pCurPam->GetPoint()->nNode < pCurPam->GetMark()->nNode || @@ -2448,6 +2450,7 @@ void MSWordExportBase::WriteText() SwNode * pNd = pCurPam->GetNode(); #ifdef DEBUG +#if 0 if (aNodeSet.find(pNd) == aNodeSet.end()) { aNodeSet.insert(pNd); @@ -2468,6 +2471,7 @@ void MSWordExportBase::WriteText() ::std::clog << "" << ::std::endl; } +#endif #endif if ( pNd->IsTxtNode() ) @@ -3722,7 +3726,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) { #ifdef DEBUG - ::std::clog << "" << dbg_out(&rNode) << ::std::endl; +// ::std::clog << "" << dbg_out(&rNode) << ::std::endl; #endif ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = mpTableInfo->getTableNodeInfo( &rNode ); diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx old mode 100644 new mode 100755 index b80b567ebf..4e3931bbe7 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1361,3 +1362,68 @@ const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const { return pDoc ? &pDoc->GetXmlIdRegistry() : 0; } + + +void SwDocShell::SetChangeRecording( bool bActivate ) +{ + USHORT nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0; + USHORT nMode = pWrtShell->GetRedlineMode(); + pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); +} + + +bool SwDocShell::SetProtectionPassword( const String &rNewPassword ) +{ + const SfxAllItemSet aSet( GetPool() ); + const SfxItemSet* pArgs = &aSet; + const SfxPoolItem* pItem = NULL; + + IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); + + Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword(); + if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem ) + && ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() != 0)) + return false; + + bool bRes = false; + + if (rNewPassword.Len()) + { + // when password protection is applied change tracking must always be active + SetChangeRecording( true ); + + Sequence< sal_Int8 > aNewPasswd; + SvPasswordHelper::GetHashPassword( aNewPasswd, rNewPassword ); + pIDRA->SetRedlinePassword( aNewPasswd ); + bRes = true; + } + else + { + pIDRA->SetRedlinePassword( Sequence< sal_Int8 >() ); + bRes = true; + } + + return bRes; +} + + +bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash ) +{ + bool bRes = false; + + const SfxAllItemSet aSet( GetPool() ); + const SfxItemSet* pArgs = &aSet; + const SfxPoolItem* pItem = NULL; + + IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); + Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() ); + if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem ) + && ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0)) + return false; + rPasswordHash = aPasswdHash; + bRes = true; + + return bRes; +} + + -- cgit v1.2.3 From 65387962ed1d5406461429c6489b250616182301 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 20 May 2010 16:10:52 +0100 Subject: cmcfixes75: #i111728# overly const warnings --- sw/inc/SidebarWin.hxx | 2 +- sw/source/ui/docvw/AnchorOverlayObject.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source') diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx index 41decf8024..d0be8f4716 100644 --- a/sw/inc/SidebarWin.hxx +++ b/sw/inc/SidebarWin.hxx @@ -168,7 +168,7 @@ class SwSidebarWin : public Window virtual bool IsProtected() {return mbReadonly;}; DECL_LINK( WindowEventListener, VclSimpleEvent* ); - inline const bool IsMouseOverSidebarWin() const { return mbMouseOver; } + inline bool IsMouseOverSidebarWin() const { return mbMouseOver; } void SetLanguage(const SvxLanguageItem aNewItem); diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx index 53afaf6257..5ed5b076a9 100644 --- a/sw/source/ui/docvw/AnchorOverlayObject.cxx +++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx @@ -95,7 +95,7 @@ public: const basegfx::B2DPolygon& getTriangle() const { return maTriangle; } const basegfx::B2DPolygon& getLine() const { return maLine; } const basegfx::B2DPolygon& getLineTop() const { return maLineTop; } - const AnchorState getAnchorState() const { return maAnchorState; } + AnchorState getAnchorState() const { return maAnchorState; } const basegfx::BColor& getColor() const { return maColor; } double getLogicLineWidth() const { return mfLogicLineWidth; } bool getShadow() const { return mbShadow; } -- cgit v1.2.3 From e8011d697e0bd75013a38eeedef4c3a1bfe3693e Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 21 May 2010 13:21:37 +0200 Subject: mtclip01: #i111749# Removed SwMod::pClipboard, introduced SwTransferable::GetSWTransferable(...) --- sw/inc/swmodule.hxx | 2 +- sw/source/ui/app/swmodule.cxx | 1 - sw/source/ui/dochdl/swdtflvr.cxx | 113 +++++++++++++++++++-------------------- sw/source/ui/inc/swdtflvr.hxx | 1 + sw/source/ui/uiview/srcview.cxx | 14 ++--- 5 files changed, 61 insertions(+), 70 deletions(-) (limited to 'sw/source') diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 24e7fa0fc8..e0ee17fc05 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -133,7 +133,7 @@ protected: public: // public Data - used for internal Clipboard / Drag & Drop / XSelection - SwTransferable *pClipboard, *pDragDrop, *pXSelection; + SwTransferable *pDragDrop, *pXSelection; TYPEINFO(); SFX_DECL_INTERFACE(SW_INTERFACE_MODULE) diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 0790eb4c4d..fca869011a 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -206,7 +206,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, pView(0), bAuthorInitialised(sal_False), bEmbeddedLoadSave( sal_False ), - pClipboard( 0 ), pDragDrop( 0 ), pXSelection( 0 ) { diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 04819c586e..789cfe1b3c 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -300,9 +300,7 @@ SwTransferable::~SwTransferable() SwModule* pMod = SW_MOD(); if(pMod) { - if ( pMod->pClipboard == this ) - pMod->pClipboard = 0; - else if ( pMod->pDragDrop == this ) + if ( pMod->pDragDrop == this ) pMod->pDragDrop = 0; else if ( pMod->pXSelection == this ) pMod->pXSelection = 0; @@ -325,9 +323,7 @@ SwTransferable::~SwTransferable() void SwTransferable::ObjectReleased() { SwModule *pMod = SW_MOD(); - if( this == pMod->pClipboard ) - pMod->pClipboard = 0; - else if( this == pMod->pDragDrop ) + if( this == pMod->pDragDrop ) pMod->pDragDrop = 0; else if( this == pMod->pXSelection ) pMod->pXSelection = 0; @@ -1000,7 +996,6 @@ int SwTransferable::Copy( BOOL bIsCut ) int nRet = PrepareForCopy( bIsCut ); if ( nRet ) { - SW_MOD()->pClipboard = this; CopyToClipboard( &pWrtShell->GetView().GetEditWin() ); } return nRet; @@ -1021,7 +1016,6 @@ int SwTransferable::CalculateAndCopy() eBufferType = TRNSFR_DOCUMENT; AddFormat( FORMAT_STRING ); - SW_MOD()->pClipboard = this; CopyToClipboard( &pWrtShell->GetView().GetEditWin() ); return 1; @@ -1072,7 +1066,6 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, PrepareOLE( aObjDesc ); AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - SW_MOD()->pClipboard = this; CopyToClipboard( &pWrtShell->GetView().GetEditWin() ); return 1; @@ -1090,20 +1083,14 @@ BOOL SwTransferable::IsPaste( const SwWrtShell& rSh, // Check the common case first: We can always paste our own data! // #106503#: If _only_ the internal format can be pasted, this check will // yield 'true', while the one below would give a (wrong) result 'false'. - bool bIsPaste = ( SW_MOD()->pClipboard != NULL ); + + bool bIsPaste = ( GetSwTransferable( rData ) != NULL ); // if it's not our own data, we need to have a closer look: - if( ! bIsPaste ) + if( ! bIsPaste ) { // determine the proper paste action, and return true if we find one uno::Reference xTransferable( rData.GetXTransferable() ); - uno::Reference xTunnel( xTransferable, UNO_QUERY ); - if ( xTunnel.is() ) - { - sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); - if ( nHandle ) - return TRUE; - } USHORT nDestination = SwTransferable::GetSotDestination( rSh ); USHORT nSourceOptions = @@ -1139,36 +1126,27 @@ int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData ) nDestination = SwTransferable::GetSotDestination( rSh ); ULONG nFormat = 0; - if( SW_MOD()->pClipboard ) + if( GetSwTransferable( rData ) ) + { nAction = EXCHG_OUT_ACTION_INSERT_PRIVATE; + } else { - uno::Reference xTunnel( rData.GetTransferable(), UNO_QUERY ); - if ( xTunnel.is() ) - { - sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); - if ( nHandle ) - nAction = EXCHG_OUT_ACTION_INSERT_PRIVATE; - } - - if ( !nAction ) - { - USHORT nSourceOptions = - (( EXCHG_DEST_DOC_TEXTFRAME == nDestination || - EXCHG_DEST_SWDOC_FREE_AREA == nDestination || - EXCHG_DEST_DOC_TEXTFRAME_WEB == nDestination || - EXCHG_DEST_SWDOC_FREE_AREA_WEB == nDestination ) - ? EXCHG_IN_ACTION_COPY - : EXCHG_IN_ACTION_MOVE); - uno::Reference xTransferable( rData.GetXTransferable() ); - nAction = SotExchange::GetExchangeAction( - rData.GetDataFlavorExVector(), - nDestination, - nSourceOptions, /* ?? */ - EXCHG_IN_ACTION_DEFAULT, /* ?? */ - nFormat, nEventAction, 0, - lcl_getTransferPointer ( xTransferable ) ); - } + USHORT nSourceOptions = + (( EXCHG_DEST_DOC_TEXTFRAME == nDestination || + EXCHG_DEST_SWDOC_FREE_AREA == nDestination || + EXCHG_DEST_DOC_TEXTFRAME_WEB == nDestination || + EXCHG_DEST_SWDOC_FREE_AREA_WEB == nDestination ) + ? EXCHG_IN_ACTION_COPY + : EXCHG_IN_ACTION_MOVE); + uno::Reference xTransferable( rData.GetXTransferable() ); + nAction = SotExchange::GetExchangeAction( + rData.GetDataFlavorExVector(), + nDestination, + nSourceOptions, /* ?? */ + EXCHG_IN_ACTION_DEFAULT, /* ?? */ + nFormat, nEventAction, 0, + lcl_getTransferPointer ( xTransferable ) ); } // special case for tables from draw application @@ -1202,7 +1180,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, int nRet = 0; bool bCallAutoCaption = false; - + if( pPt ) { // external Drop @@ -1231,7 +1209,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, } } } - else if( ( !pMod->pClipboard || bIsPasteFmt ) && + else if( ( !GetSwTransferable( rData ) || bIsPasteFmt ) && !rSh.IsTableMode() && rSh.HasSelection() ) { // dann die Selektionen loeschen @@ -1259,14 +1237,14 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, // <-- } - SwTransferable *pTrans=0, *pTunneledTrans=0; - uno::Reference xTunnel( rData.GetTransferable(), UNO_QUERY ); - if ( xTunnel.is() ) - { - sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); - if ( nHandle ) - pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle; - } + SwTransferable *pTrans=0, *pTunneledTrans=GetSwTransferable( rData ); +// uno::Reference xTunnel( rData.GetTransferable(), UNO_QUERY ); +// if ( xTunnel.is() ) +// { +// sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); +// if ( nHandle ) +// pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle; +// } if( pPt && ( bPasteSelection ? 0 != ( pTrans = pMod->pXSelection ) : 0 != ( pTrans = pMod->pDragDrop) )) @@ -1275,7 +1253,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, nRet = pTrans->PrivateDrop( rSh, *pPt, DND_ACTION_MOVE == nDropAction, bPasteSelection ); } - else if( !pPt && ( pTunneledTrans || 0 != ( pTunneledTrans = pMod->pClipboard ) ) && + else if( !pPt && pTunneledTrans && EXCHG_OUT_ACTION_INSERT_PRIVATE == nAction ) { // then internal paste @@ -2801,7 +2779,7 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh, int nRet = 0; ULONG nPrivateFmt = FORMAT_PRIVATE; - SwTransferable *pClipboard = SW_MOD()->pClipboard; + SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard && ((TRNSFR_DOCUMENT|TRNSFR_GRAPHIC|TRNSFR_OLE) & pClipboard->eBufferType )) nPrivateFmt = SOT_FORMATSTR_ID_EMBED_SOURCE; @@ -2897,7 +2875,7 @@ int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData USHORT nDest = SwTransferable::GetSotDestination( rSh ); - SwTransferable *pClipboard = SW_MOD()->pClipboard; + SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard ) { aDesc = pClipboard->aObjDesc; @@ -2963,7 +2941,8 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh, SvxClipboardFmtItem & rToFill ) { USHORT nDest = SwTransferable::GetSotDestination( rSh ); - SwTransferable *pClipboard = SW_MOD()->pClipboard; + + SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard ) { USHORT nResId; @@ -3619,6 +3598,22 @@ sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) throw( return nRet; } +SwTransferable* SwTransferable::GetSwTransferable( const TransferableDataHelper& rData ) +{ + SwTransferable* pSwTransferable = NULL; + + uno::Reference xTunnel( rData.GetTransferable(), UNO_QUERY ); + if ( xTunnel.is() ) + { + sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); + if ( nHandle ) + pSwTransferable = (SwTransferable*) (sal_IntPtr) nHandle; + } + + return pSwTransferable; + +} + /* */ // ----------------------------------------------------------------------- diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx index 3e93acb021..94620d73dd 100644 --- a/sw/source/ui/inc/swdtflvr.hxx +++ b/sw/source/ui/inc/swdtflvr.hxx @@ -93,6 +93,7 @@ class SwTransferable : public TransferableHelper void DeleteSelection(); // helper methods for the paste + static SwTransferable* GetSwTransferable( const TransferableDataHelper& rData ); static void SetSelInShell( SwWrtShell& , BOOL , const Point* ); static BOOL _CheckForURLOrLNKFile( TransferableDataHelper& rData, String& rFileName, String* pTitle = 0 ); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index aaa1e80808..d418216a39 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -599,15 +599,11 @@ void SwSrcView::GetState(SfxItemSet& rSet) break; case SID_PASTE: { - BOOL bDisable = 0 == SW_MOD()->pClipboard; - if( bDisable ) - { - TransferableDataHelper aDataHelper( - TransferableDataHelper::CreateFromSystemClipboard( - &aEditWin) ); - bDisable = !aDataHelper.GetXTransferable().is() || - 0 == aDataHelper.GetFormatCount(); - } + TransferableDataHelper aDataHelper( + TransferableDataHelper::CreateFromSystemClipboard( + &aEditWin) ); + BOOL bDisable = !aDataHelper.GetXTransferable().is() || + 0 == aDataHelper.GetFormatCount(); if( bDisable ) rSet.DisableItem(nWhich); } -- cgit v1.2.3 From f55e5e9f6a35b1b2b794eeb3998d27b818d66aa6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 25 May 2010 10:17:24 +0200 Subject: unoawt: completely separated the controller functionality of a wizard page from the wizard page itself, by moving the canAdvance method from OWizardPage to the IWizardPage interface, which in this course has been renamed to IWizardPageController. This will later on allow to have implementations where the TabPage is provided by an external component (e.g. as UNO Service), but the controlling of those pages is still intercepted and handled internally. --- sw/source/ui/dbui/mailmergewizard.cxx | 2 +- sw/source/ui/dbui/mmaddressblockpage.cxx | 4 ++-- sw/source/ui/dbui/mmaddressblockpage.hxx | 2 +- sw/source/ui/dbui/mmdocselectpage.cxx | 8 ++++---- sw/source/ui/dbui/mmdocselectpage.hxx | 2 +- sw/source/ui/dbui/mmgreetingspage.cxx | 2 +- sw/source/ui/dbui/mmgreetingspage.hxx | 2 +- sw/source/ui/dbui/mmlayoutpage.cxx | 4 ++-- sw/source/ui/dbui/mmlayoutpage.hxx | 2 +- sw/source/ui/dbui/mmpreparemergepage.cxx | 4 ++-- sw/source/ui/dbui/mmpreparemergepage.hxx | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index fd601bdfb1..4a412991e0 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -260,7 +260,7 @@ void SwMailMergeWizard::UpdateRoadmap() //#i97436# if a document has to be loaded then enable output type page only m_bDocumentLoad = false; bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) || - static_cast(pCurPage)->commitPage( eValidate ); + static_cast(pCurPage)->commitPage( ::svt::WizardTypes::eValidate ); for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_OUTPUTPAGE; ++nPage) { diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index d179e02e51..ae6b6b0cb0 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -175,9 +175,9 @@ void SwMailMergeAddressBlockPage::ActivatePage() /*-- 27.05.2004 13:59:15--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwMailMergeAddressBlockPage::commitPage( CommitPageReason _eReason ) +sal_Bool SwMailMergeAddressBlockPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { - if ( eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() ) + if ( ::svt::WizardTypes::eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() ) return sal_False; return sal_True; } diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index 8bbd2fdc8d..2436a170d4 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -98,7 +98,7 @@ class SwMailMergeAddressBlockPage : public svt::OWizardPage void EnableAddressBlock(sal_Bool bAll, sal_Bool bSelective); virtual void ActivatePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); virtual bool canAdvance() const; public: diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index 57b3b15cfc..7427bfc687 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -197,11 +197,11 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) /*-- 06.04.2004 12:52:24--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwMailMergeDocSelectPage::commitPage( CommitPageReason _eReason ) +sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { sal_Bool bReturn = sal_False; - bool bNext = _eReason == eTravelForward; - if(bNext || _eReason == eValidate ) + bool bNext = _eReason == ::svt::WizardTypes::eTravelForward; + if(bNext || _eReason == ::svt::WizardTypes::eValidate ) { ::rtl::OUString sReloadDocument; bReturn = m_aCurrentDocRB.IsChecked() || @@ -209,7 +209,7 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( CommitPageReason _eReason ) ((sReloadDocument = m_sLoadFileName).getLength() && m_aLoadDocRB.IsChecked() )|| ((sReloadDocument = m_sLoadTemplateName).getLength() && m_aLoadTemplateRB.IsChecked())|| (m_aRecentDocRB.IsChecked() && (sReloadDocument = m_aRecentDocLB.GetSelectEntry()).getLength()); - if( _eReason == eValidate ) + if( _eReason == ::svt::WizardTypes::eValidate ) m_pWizard->SetDocumentLoad(!m_aCurrentDocRB.IsChecked()); if(bNext && !m_aCurrentDocRB.IsChecked()) diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx index f9f4cc897c..363aecdddc 100644 --- a/sw/source/ui/dbui/mmdocselectpage.hxx +++ b/sw/source/ui/dbui/mmdocselectpage.hxx @@ -61,7 +61,7 @@ class SwMailMergeDocSelectPage : public svt::OWizardPage DECL_LINK(DocSelectHdl, RadioButton*); DECL_LINK(FileSelectHdl, PushButton*); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); public: SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent); diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 4e287a5a28..db0038274a 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -390,7 +390,7 @@ void SwMailMergeGreetingsPage::ActivatePage() /*-- 11.05.2004 14:47:10--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwMailMergeGreetingsPage::commitPage( CommitPageReason ) +sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPageReason ) { SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem(); diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx index c41e804da8..230beab4c3 100644 --- a/sw/source/ui/dbui/mmgreetingspage.hxx +++ b/sw/source/ui/dbui/mmgreetingspage.hxx @@ -122,7 +122,7 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage, virtual void UpdatePreview(); virtual void ActivatePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); public: SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent); ~SwMailMergeGreetingsPage(); diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 8efda3455a..91312c9914 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -254,11 +254,11 @@ void SwMailMergeLayoutPage::ActivatePage() /*-- 11.05.2004 10:41:26--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwMailMergeLayoutPage::commitPage( CommitPageReason _eReason ) +sal_Bool SwMailMergeLayoutPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { //now insert the frame and the greeting SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - if(eTravelForward == _eReason) + if(::svt::WizardTypes::eTravelForward == _eReason) { long nLeft = static_cast< long >(m_aLeftMF.Denormalize(m_aLeftMF.GetValue(FUNIT_TWIP))); long nTop = static_cast< long >(m_aTopMF.Denormalize(m_aTopMF.GetValue(FUNIT_TWIP))); diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx index 79bc1e1d15..137eb7bf04 100644 --- a/sw/source/ui/dbui/mmlayoutpage.hxx +++ b/sw/source/ui/dbui/mmlayoutpage.hxx @@ -98,7 +98,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage static void InsertGreeting(SwWrtShell& rShell, SwMailMergeConfigItem& rConfigItem, bool bExample); virtual void ActivatePage(); - virtual sal_Bool commitPage(CommitPageReason _eReason); + virtual sal_Bool commitPage(::svt::WizardTypes::CommitPageReason _eReason); public: SwMailMergeLayoutPage( SwMailMergeWizard* _pParent); ~SwMailMergeLayoutPage(); diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index a6dc5d09c1..5fe51c094e 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -191,10 +191,10 @@ void SwMailMergePrepareMergePage::ActivatePage() /*-- 13.05.2004 15:38:32--------------------------------------------------- merge the data into a new file -----------------------------------------------------------------------*/ -sal_Bool SwMailMergePrepareMergePage::commitPage( CommitPageReason _eReason ) +sal_Bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - if(eTravelForward == _eReason && !rConfigItem.IsMergeDone()) + if(::svt::WizardTypes::eTravelForward == _eReason && !rConfigItem.IsMergeDone()) { m_pWizard->CreateTargetDocument(); m_pWizard->SetRestartPage(MM_MERGEPAGE); diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx index 25aded367e..53494b36d5 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.hxx +++ b/sw/source/ui/dbui/mmpreparemergepage.hxx @@ -64,7 +64,7 @@ class SwMailMergePrepareMergePage : public svt::OWizardPage DECL_LINK(MoveHdl_Impl, void*); virtual void ActivatePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); public: SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent); -- cgit v1.2.3 From ec3e52d44ef23a2023c527493b27d54f9bea7ef9 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 25 May 2010 11:45:06 +0200 Subject: cws tl79: #i110254# security tab page in 'File/Properties' --- sw/inc/docsh.hxx | 2 ++ sw/source/ui/app/docsh.cxx | 15 +++++++++++++-- sw/source/ui/uiview/view2.cxx | 2 ++ sw/source/ui/uiview/viewstat.cxx | 8 +++----- 4 files changed, 20 insertions(+), 7 deletions(-) mode change 100644 => 100755 sw/source/ui/uiview/viewstat.cxx (limited to 'sw/source') diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 5ac0a010b4..3840d59a16 100755 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -306,6 +306,8 @@ public: // passwword protection for Writer (derived from SfxObjectShell) // see also: FN_REDLINE_ON, FN_REDLINE_ON + virtual bool IsChangeRecording() const; + virtual bool HasChangeRecordProtection() const; virtual void SetChangeRecording( bool bActivate ); virtual bool SetProtectionPassword( const String &rPassword ); virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash ); diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 4e3931bbe7..2dbe7def8b 100755 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -1364,6 +1364,18 @@ const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const } +bool SwDocShell::IsChangeRecording() const +{ + return (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0; +} + + +bool SwDocShell::HasChangeRecordProtection() const +{ + return pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0; +} + + void SwDocShell::SetChangeRecording( bool bActivate ) { USHORT nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0; @@ -1379,10 +1391,9 @@ bool SwDocShell::SetProtectionPassword( const String &rNewPassword ) const SfxPoolItem* pItem = NULL; IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); - Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword(); if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem ) - && ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() != 0)) + && ((SfxBoolItem*)pItem)->GetValue() == aPasswd.getLength() > 0) return false; bool bRes = false; diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index d6e150dcb4..4258a47683 100755 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -545,6 +545,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) else pParent = &GetViewFrame()->GetWindow(); SfxPasswordDialog aPasswdDlg( pParent ); + aPasswdDlg.SetMinLen( 1 ); //#i69751# the result of Execute() can be ignored aPasswdDlg.Execute(); String sNewPasswd( aPasswdDlg.GetPassword() ); @@ -581,6 +582,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) else pParent = &GetViewFrame()->GetWindow(); SfxPasswordDialog aPasswdDlg( pParent ); + aPasswdDlg.SetMinLen( 1 ); if(!aPasswd.getLength()) aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM); if (aPasswdDlg.Execute()) diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx old mode 100644 new mode 100755 index 4022042cf9..1dd3d30cd9 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -269,12 +269,10 @@ void SwView::GetState(SfxItemSet &rSet) } break; case FN_REDLINE_ON: - rSet.Put( SfxBoolItem( nWhich, (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0 ) ); - break; + rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) ); + break; case FN_REDLINE_PROTECT : - { - rSet.Put( SfxBoolItem( nWhich, pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0 ) ); - } + rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) ); break; case FN_REDLINE_SHOW: { -- cgit v1.2.3 From 4986a9d0207450349c18686b7dd6e55ee33931cb Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 26 May 2010 15:54:55 +0200 Subject: fwk139: #i111034# integrate patch --- sw/source/ui/app/apphdl.cxx | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 708d6ceed3..f61b6434f1 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -765,16 +765,31 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) DELETEZ(pWebToolbarConfig) ; DELETEZ(pAuthorNames) ; DELETEZ(pDBConfig); - pColorConfig->RemoveListener(this); - DELETEZ(pColorConfig); - pAccessibilityOptions->RemoveListener(this); - DELETEZ(pAccessibilityOptions); - pCTLOptions->RemoveListener(this); - DELETEZ(pCTLOptions); - pUserOptions->RemoveListener(this); - DELETEZ(pUserOptions); - pUndoOptions->RemoveListener(this); - DELETEZ(pUndoOptions); + if( pColorConfig ) + { + pColorConfig->RemoveListener(this); + DELETEZ(pColorConfig); + } + if( pAccessibilityOptions ) + { + pAccessibilityOptions->RemoveListener(this); + DELETEZ(pAccessibilityOptions); + } + if( pCTLOptions ) + { + pCTLOptions->RemoveListener(this); + DELETEZ(pCTLOptions); + } + if( pUserOptions ) + { + pUserOptions->RemoveListener(this); + DELETEZ(pUserOptions); + } + if( pUndoOptions ) + { + pUndoOptions->RemoveListener(this); + DELETEZ(pUndoOptions); + } } } } -- cgit v1.2.3 From 75822d8a7c4780e007091d8d7ddfb64cd0968c90 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Thu, 27 May 2010 11:57:15 +0200 Subject: hb33issues01: #b6951450# export table spacing --- sw/source/filter/ww8/attributeoutputbase.hxx | 2 ++ sw/source/filter/ww8/docxattributeoutput.cxx | 7 +++++ sw/source/filter/ww8/wrtww8.cxx | 38 ++++++++++++++++++++++++++++ sw/source/filter/ww8/ww8attributeoutput.hxx | 2 ++ 4 files changed, 49 insertions(+) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 47a42b2079..b0cd811e35 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -232,6 +232,8 @@ public: virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) = 0; + virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) = 0; + virtual void TableRowEnd( sal_uInt32 nDepth ) = 0; /// Start of the styles table. diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 76eea38544..2dbd7a8d7e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1460,6 +1460,13 @@ void DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_ #endif } +void DocxAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ +#if OSL_DEBUG_LEVEL > 0 + fprintf( stderr, "TODO: DocxAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )\n" ); +#endif +} + void DocxAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ ) { #if OSL_DEBUG_LEVEL > 0 diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 916ad970df..1ecc6caa02 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -58,10 +58,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -1910,6 +1912,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa TableBidi( pTableTextNodeInfoInner ); TableVerticalCell( pTableTextNodeInfoInner ); TableOrientation( pTableTextNodeInfoInner ); + TableSpacing( pTableTextNodeInfoInner ); } } } @@ -2091,6 +2094,41 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t } } +void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) +{ + const SwTable * pTable = pTableTextNodeInfoInner->getTable(); + const SwTableFmt * pTableFmt = dynamic_cast(pTable->GetRegisteredIn()); + + if (pTableFmt != NULL) + { + const SvxULSpaceItem & rUL = pTableFmt->GetULSpace(); + + if (rUL.GetUpper() > 0) + { + sal_uInt8 nPadding = 2; + sal_uInt8 nPcVert = 0; + sal_uInt8 nPcHorz = 0; + + sal_uInt8 nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz; + + m_rWW8Export.InsUInt16(NS_sprm::LN_TPc); + m_rWW8Export.pO->Insert( nTPc, m_rWW8Export.pO->Count() ); + + m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaAbs); + m_rWW8Export.InsUInt16(rUL.GetUpper()); + + m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaFromText); + m_rWW8Export.InsUInt16(rUL.GetUpper()); + } + + if (rUL.GetLower() > 0) + { + m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaFromTextBottom); + m_rWW8Export.InsUInt16(rUL.GetLower()); + } + } +} + void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index c8b39265d0..c064da270b 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -124,6 +124,8 @@ public: virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + virtual void TableRowEnd( sal_uInt32 nDepth = 1 ); /// Start of the styles table. -- cgit v1.2.3 From 59346897bd4b908cae8c11959e6a7b77ac72f6f9 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Fri, 28 May 2010 14:31:14 +0200 Subject: #b6951450# WW8TableInfo: Store information that text node is first in a table. OutputTextNode: Output page break before on first paragraph in table, if table has page break before. --- sw/source/filter/ww8/WW8TableInfo.cxx | 32 ++++++++++++++++++++++++++++++++ sw/source/filter/ww8/WW8TableInfo.hxx | 14 ++++++++++++++ sw/source/filter/ww8/wrtw8nds.cxx | 12 ++++++++++++ 3 files changed, 58 insertions(+) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index f0d65a7544..12f1f0c1ba 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -47,6 +47,7 @@ WW8TableNodeInfoInner::WW8TableNodeInfoInner(WW8TableNodeInfo * pParent) , mnRow(0) , mbEndOfLine(false) , mbEndOfCell(false) +, mbFirstInTable(false) , mpTableBox(NULL) , mpTable(NULL) { @@ -81,6 +82,11 @@ void WW8TableNodeInfoInner::setEndOfCell(bool bEndOfCell) mbEndOfCell = bEndOfCell; } +void WW8TableNodeInfoInner::setFirstInTable(bool bFirstInTable) +{ + mbFirstInTable = bFirstInTable; +} + void WW8TableNodeInfoInner::setTableBox(const SwTableBox * pTableBox) { mpTableBox = pTableBox; @@ -116,6 +122,11 @@ bool WW8TableNodeInfoInner::isEndOfLine() const return mbEndOfLine; } +bool WW8TableNodeInfoInner::isFirstInTable() const +{ + return mbFirstInTable; +} + const SwNode * WW8TableNodeInfoInner::getNode() const { const SwNode * pResult = NULL; @@ -230,6 +241,17 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell) #endif } +void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable) +{ + WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth); + pInner->setFirstInTable(bFirstInTable); + +#ifdef DEBUG + ::std::clog << "" + << toString() << "" << ::std::endl; +#endif +} + void WW8TableNodeInfo::setTableBox(const SwTableBox * pTableBox) { getInnerForDepth(mnDepth)->setTableBox(pTableBox); @@ -590,6 +612,16 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo pNodeInfo->setCell(nCell); pNodeInfo->setRow(nRow); + + if (pNode->IsTxtNode()) + { + FirstInTableMap_t::const_iterator aIt = mFirstInTableMap.find(pTable); + if (aIt == mFirstInTableMap.end()) + { + mFirstInTableMap[pTable] = pNode; + pNodeInfo->setFirstInTable(true); + } + } #ifdef DEBUG ::std::clog << pNodeInfo->toString() << ::std::endl; diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index 620fa620e4..fe8b6a1765 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -54,6 +54,7 @@ class WW8TableNodeInfoInner sal_uInt32 mnRow; bool mbEndOfLine; bool mbEndOfCell; + bool mbFirstInTable; const SwTableBox * mpTableBox; const SwTable * mpTable; @@ -68,6 +69,7 @@ public: void setRow(sal_uInt32 nRow); void setEndOfLine(bool bEndOfLine); void setEndOfCell(bool bEndOfCell); + void setFirstInTable(bool bFirstInTable); void setTableBox(const SwTableBox * pTableBox); void setTable(const SwTable * pTable); @@ -76,6 +78,7 @@ public: sal_uInt32 getRow() const; bool isEndOfCell() const; bool isEndOfLine() const; + bool isFirstInTable() const; const SwTableBox * getTableBox() const; const SwTable * getTable() const; @@ -105,6 +108,7 @@ public: void setDepth(sal_uInt32 nDepth); void setEndOfLine(bool bEndOfLine); void setEndOfCell(bool bEndOfCell); + void setFirstInTable(bool bFirstInTable); void setTableBox(const SwTableBox *pTableBox); void setTable(const SwTable * pTable); void setCell(sal_uInt32 nCell); @@ -115,6 +119,7 @@ public: sal_uInt32 getDepth() const; bool isEndOfLine() const; bool isEndOfCell() const; + bool isFirstInTable() const; const SwNode * getNode() const; const SwTableBox * getTableBox() const; const SwTable * getTable() const; @@ -137,10 +142,18 @@ struct hashNode { return reinterpret_cast(pNode); } }; +struct hashTable +{ + size_t operator()(const SwTable * pTable) const + { return reinterpret_cast(pTable); } +}; + class WW8TableInfo { typedef hash_map Map_t; Map_t mMap; + typedef hash_map FirstInTableMap_t; + FirstInTableMap_t mFirstInTableMap; WW8TableNodeInfo * processTableLine(const SwTable * pTable, @@ -180,6 +193,7 @@ public: void processSwTable(const SwTable * pTable); WW8TableNodeInfo::Pointer_t getTableNodeInfo(const SwNode * pNode); const SwNode * getNextNode(const SwNode * pNode); + const WW8TableNodeInfo * getFirstTableNodeInfo() const; }; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index d0a9f5ee3e..e3ed586c71 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -1899,6 +1900,17 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) #endif AttrOutput().TableInfoCell( pTextNodeInfoInner ); + if (pTextNodeInfoInner->isFirstInTable()) + { + const SwTable * pTable = pTextNodeInfoInner->getTable(); + const SwTableFmt * pTabFmt = + dynamic_cast(pTable->GetRegisteredIn()); + if (pTabFmt != NULL) + { + if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE) + AttrOutput().PageBreakBefore(true); + } + } } if ( !bFlyInTable ) -- cgit v1.2.3 From aa2868fb6f39629b0df05dcce702b2b91406b3da Mon Sep 17 00:00:00 2001 From: hb Date: Mon, 31 May 2010 11:21:00 +0200 Subject: hb33issues01: building errors in sw --- sw/inc/swtblfmt.hxx | 2 +- sw/source/filter/rtf/wrtrtf.cxx | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'sw/source') diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx index e94ba5c5e8..ee78d93e53 100644 --- a/sw/inc/swtblfmt.hxx +++ b/sw/inc/swtblfmt.hxx @@ -31,7 +31,7 @@ class SwDoc; -class SwTableFmt : public SwFrmFmt +class SW_DLLPUBLIC SwTableFmt : public SwFrmFmt { friend class SwDoc; diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx index d960dc662e..31c77c5f86 100644 --- a/sw/source/filter/rtf/wrtrtf.cxx +++ b/sw/source/filter/rtf/wrtrtf.cxx @@ -85,9 +85,6 @@ const sal_Char SwRTFWriter::sNewLine = '\012'; const sal_Char __FAR_DATA SwRTFWriter::sNewLine[] = "\015\012"; #endif -static ::rtl::OUString aEmpty; - - SV_DECL_VARARR( RTFColorTbl, Color, 5, 8 ) SV_IMPL_VARARR( RTFColorTbl, Color ) -- cgit v1.2.3 From 15707541a5ec0fe17b7303c6b97a378a6ae4dc9e Mon Sep 17 00:00:00 2001 From: tono Date: Mon, 31 May 2010 21:53:32 +0900 Subject: i#111958: MinGW port enhancement: runtime-pseude-reloc-v2 --- sw/source/filter/rtf/rtfatr.cxx | 4 ---- 1 file changed, 4 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index fde66c4d2b..6241d94f37 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -3773,11 +3773,7 @@ static Writer& OutRTF_SwFmtBox( Writer& rWrt, const SfxPoolItem& rHt ) static USHORT __READONLY_DATA aBorders[] = { BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT }; -#ifdef __MINGW32__ // for runtime pseudo reloc - static const sal_Char* aBorderNames[] = { -#else static const sal_Char* __READONLY_DATA aBorderNames[] = { -#endif OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR }; USHORT nDist = rBox.GetDistance(); -- cgit v1.2.3 From 714ad7f113f6b3927cd417e406adffd02abb9b95 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Tue, 1 Jun 2010 12:53:45 +0200 Subject: hb33issues: #i111595# check for NULL pointer --- sw/source/filter/ww8/ww8par.cxx | 95 +++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 46 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9586a78f58..45470f0c1e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -573,60 +573,63 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, aSet.Put( SdrTextVertAdjustItem( eTVA ) ); aSet.Put( SdrTextHorzAdjustItem( eTHA ) ); - pObj->SetMergedItemSet(aSet); - pObj->SetModel(pSdrModel); - - if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) ) - dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True); - - if ( bIsSimpleDrawingTextBox ) + if (pObj != NULL) { - if ( nTextRotationAngle ) + pObj->SetMergedItemSet(aSet); + pObj->SetModel(pSdrModel); + + if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) ) + dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True); + + if ( bIsSimpleDrawingTextBox ) { - long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ? - rTextRect.GetWidth() : rTextRect.GetHeight(); - nMinWH /= 2; - Point aPivot(rTextRect.TopLeft()); - aPivot.X() += nMinWH; - aPivot.Y() += nMinWH; - double a = nTextRotationAngle * nPi180; - pObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a)); + if ( nTextRotationAngle ) + { + long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ? + rTextRect.GetWidth() : rTextRect.GetHeight(); + nMinWH /= 2; + Point aPivot(rTextRect.TopLeft()); + aPivot.X() += nMinWH; + aPivot.Y() += nMinWH; + double a = nTextRotationAngle * nPi180; + pObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a)); + } } - } - - if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) ) - { - SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj ); - double fExtraTextRotation = 0.0; - if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) ) - { // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false - fExtraTextRotation = -mnFix16Angle; - } - if ( rObjData.nSpFlags & SP_FFLIPV ) // sj: in ppt the text is flipped, whereas in word the text - { // remains unchanged, so we have to take back the flipping here - fExtraTextRotation += 18000.0; // because our core will flip text if the shape is flipped. + if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) ) + { + SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj ); + + double fExtraTextRotation = 0.0; + if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) ) + { // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false + fExtraTextRotation = -mnFix16Angle; + } + if ( rObjData.nSpFlags & SP_FFLIPV ) // sj: in ppt the text is flipped, whereas in word the text + { // remains unchanged, so we have to take back the flipping here + fExtraTextRotation += 18000.0; // because our core will flip text if the shape is flipped. + } + fExtraTextRotation += nTextRotationAngle; + if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) ) + { + fExtraTextRotation /= 100.0; + SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); + com::sun::star::beans::PropertyValue aPropVal; + aPropVal.Name = sTextRotateAngle; + aPropVal.Value <<= fExtraTextRotation; + aGeometryItem.SetPropertyValue( aPropVal ); + pCustomShape->SetMergedItem( aGeometryItem ); + } } - fExtraTextRotation += nTextRotationAngle; - if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) ) + else if ( mnFix16Angle ) { - fExtraTextRotation /= 100.0; - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); - const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); - com::sun::star::beans::PropertyValue aPropVal; - aPropVal.Name = sTextRotateAngle; - aPropVal.Value <<= fExtraTextRotation; - aGeometryItem.SetPropertyValue( aPropVal ); - pCustomShape->SetMergedItem( aGeometryItem ); + // rotate text with shape ? + double a = mnFix16Angle * nPi180; + pObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle, + sin( a ), cos( a ) ); } } - else if ( mnFix16Angle ) - { - // rotate text with shape ? - double a = mnFix16Angle * nPi180; - pObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle, - sin( a ), cos( a ) ); - } } else if( !pObj ) { -- cgit v1.2.3 From 3c9e62c0d5ed8934342c448a64f194517c12490a Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 3 Jun 2010 00:10:45 +0200 Subject: tl78: #i110383# password to modify support for binary types only --- sw/source/ui/uno/SwXDocumentSettings.cxx | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 96213e8de6..59fbcef91f 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -124,7 +124,6 @@ enum SwDocumentSettingsPropertyHandles // --> OD 2008-06-05 #i89181# HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- - HANDLE_MODIFYPASSWORDHASH }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -178,7 +177,6 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0}, // --> OD 2008-06-05 #i89181# { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, - { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordHash"), HANDLE_MODIFYPASSWORDHASH, CPPUTYPE_INT32, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -673,21 +671,6 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf } break; // <-- - case HANDLE_MODIFYPASSWORDHASH: - { - sal_Int32 nHash = 0; - if ( !( rValue >>= nHash ) || nHash < 0 || nHash > SAL_MAX_UINT16 ) - throw lang::IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value of type INT32, representing UINT16 expected!" ) ), - uno::Reference< uno::XInterface >(), - 2 ); - - if ( !mpDocSh->SetModifyPasswordHash( static_cast< sal_uInt16 >( nHash ) ) ) - throw beans::PropertyVetoException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The hash is not allowed to be changed now!" ) ), - uno::Reference< uno::XInterface >() ); - } - break; default: throw UnknownPropertyException(); } @@ -1015,11 +998,6 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf } break; // <-- - case HANDLE_MODIFYPASSWORDHASH: - { - rValue <<= static_cast< sal_Int32 >( mpDocSh->GetModifyPasswordHash() ); - } - break; default: throw UnknownPropertyException(); -- cgit v1.2.3 From f47349a6bcb722a9fb9a0a31740850fc2f856b82 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 3 Jun 2010 10:54:44 +0200 Subject: sw33bf05: #i111964# - provide default sidebar position at instance and include access guards for the anchor overlay object of annotations. --- sw/source/core/layout/pagechg.cxx | 10 +++++++--- sw/source/ui/docvw/PostItMgr.cxx | 40 +++++++++++++++++++++++---------------- sw/source/ui/docvw/SidebarWin.cxx | 39 +++++++++++++++++++++++++++++++------- 3 files changed, 63 insertions(+), 26 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 0e50ee3e3a..8ca7c2db14 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1385,11 +1385,15 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) return pPage; } -// false = right, true = left sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const { - if (!GetShell() || GetShell()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) - return sw::sidebarwindows::SIDEBAR_NONE; + if ( !GetShell() || + GetShell()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + { + // --> OD 2010-06-03 #i111964# - provide default sidebar position + return sw::sidebarwindows::SIDEBAR_RIGHT; + // <-- + } else { const bool bLTR = GetUpper() ? static_cast(GetUpper())->IsLeftToRightViewLayout() : true; diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index e8de9b4be8..9afc8455f6 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -1669,28 +1669,36 @@ void SwPostItMgr::CorrectPositions() if (!pFirstPostIt) return; - // yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it - const long aAnchorX = mpEditWin->LogicToPixel( Point((long)(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X(); - const long aAnchorY = mpEditWin->LogicToPixel( Point(0,(long)(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1; - if (Point(aAnchorX,aAnchorY) != pFirstPostIt->GetPosPixel()) - { - long aAnchorPosX = 0; - long aAnchorPosY = 0; - for (unsigned long n=0;nmList->begin(); i!= mPages[n]->mList->end(); i++) - { - if ((*i)->bShow && (*i)->pPostIt) - { + // yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it + // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists. + const long aAnchorX = pFirstPostIt->Anchor() + ? mpEditWin->LogicToPixel( Point((long)(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X() + : 0; + const long aAnchorY = pFirstPostIt->Anchor() + ? mpEditWin->LogicToPixel( Point(0,(long)(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1 + : 0; + // <-- + if (Point(aAnchorX,aAnchorY) != pFirstPostIt->GetPosPixel()) + { + long aAnchorPosX = 0; + long aAnchorPosY = 0; + for (unsigned long n=0;nmList->begin(); i!= mPages[n]->mList->end(); i++) + { + // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists. + if ( (*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->Anchor() ) + // <-- + { aAnchorPosX = mPages[n]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT ? mpEditWin->LogicToPixel( Point((long)((*i)->pPostIt->Anchor()->GetSeventhPosition().getX()),0)).X() : mpEditWin->LogicToPixel( Point((long)((*i)->pPostIt->Anchor()->GetSixthPosition().getX()),0)).X(); aAnchorPosY = mpEditWin->LogicToPixel( Point(0,(long)((*i)->pPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1; (*i)->pPostIt->SetPosPixel(Point(aAnchorPosX,aAnchorPosY)); } - } - } - } + } + } + } } diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index cce6db3a89..a166c25913 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -560,14 +560,28 @@ void SwSidebarWin::SetPosAndSize() { if (IsFollow() && !HasChildPathFocus()) { - mpAnchor->SetAnchorState(AS_END); + // --> OD 2010-06-03 #i111964# + if ( mpAnchor ) + { + mpAnchor->SetAnchorState(AS_END); + } + // <-- } else { - mpAnchor->SetAnchorState(AS_ALL); + // --> OD 2010-06-03 #i111964# + if ( mpAnchor ) + { + mpAnchor->SetAnchorState(AS_ALL); + } + // <-- SwSidebarWin* pWin = GetTopReplyNote(); - if (pWin) + // --> OD 2010-06-03 #i111964# + if ( pWin && pWin->Anchor() ) + // <-- + { pWin->Anchor()->SetAnchorState(AS_END); + } } } } @@ -1127,8 +1141,12 @@ void SwSidebarWin::SetViewState(ViewState bViewState) { mpAnchor->SetAnchorState(AS_ALL); SwSidebarWin* pWin = GetTopReplyNote(); - if (pWin) + // --> OD 2010-06-03 #i111964# + if ( pWin && pWin->Anchor() ) + // <-- + { pWin->Anchor()->SetAnchorState(AS_END); + } mpAnchor->setLineSolid(true); } if (mpShadow) @@ -1156,17 +1174,24 @@ void SwSidebarWin::SetViewState(ViewState bViewState) SwSidebarWin* pTopWinActive = mrMgr.HasActiveSidebarWin() ? mrMgr.GetActiveSidebarWin()->GetTopReplyNote() : 0; - if (pTopWinSelf && (pTopWinSelf!=pTopWinActive)) + // --> OD 2010-06-03 #i111964# + if ( pTopWinSelf && ( pTopWinSelf != pTopWinActive ) && + pTopWinSelf->Anchor() ) + // <-- { - if (pTopWinSelf!=mrMgr.GetActiveSidebarWin()) + if ( pTopWinSelf != mrMgr.GetActiveSidebarWin() ) + { pTopWinSelf->Anchor()->setLineSolid(false); + } pTopWinSelf->Anchor()->SetAnchorState(AS_ALL); } } mpAnchor->setLineSolid(false); } - if (mpShadow) + if ( mpShadow ) + { mpShadow->SetShadowState(SS_NORMAL); + } break; } } -- cgit v1.2.3 From 4b5c2bd021009396827d2ba0f24b707cf1816195 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 3 Jun 2010 16:40:59 +0200 Subject: fwk139: #i10000# avoid warnings on solaris --- starmath/source/makefile.mk | 1 + sw/source/ui/cctrl/makefile.mk | 3 +++ sw/source/ui/ribbar/makefile.mk | 5 +++++ sw/source/ui/shells/makefile.mk | 1 + sw/source/ui/uiview/makefile.mk | 5 +++++ sw/source/ui/utlui/makefile.mk | 2 ++ 6 files changed, 17 insertions(+) (limited to 'sw/source') diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk index a69a900107..eda4d91083 100644 --- a/starmath/source/makefile.mk +++ b/starmath/source/makefile.mk @@ -94,6 +94,7 @@ EXCEPTIONSFILES = \ $(SLO)$/mathmlimport.obj \ $(SLO)$/mathmlexport.obj \ $(SLO)$/mathtype.obj \ + $(SLO)$/smdll.obj \ $(SLO)$/view.obj \ $(SLO)$/unomodel.obj \ $(SLO)$/smdetect.obj \ diff --git a/sw/source/ui/cctrl/makefile.mk b/sw/source/ui/cctrl/makefile.mk index c724f287fc..33ba83f34d 100644 --- a/sw/source/ui/cctrl/makefile.mk +++ b/sw/source/ui/cctrl/makefile.mk @@ -50,6 +50,9 @@ SLOFILES = \ $(SLO)$/popbox.obj \ $(SLO)$/swlbox.obj +EXCEPTIONSFILES = \ + $(SLO)$/popbox.obj + # --- Tagets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/sw/source/ui/ribbar/makefile.mk b/sw/source/ui/ribbar/makefile.mk index 72acc79307..2405d4b16d 100644 --- a/sw/source/ui/ribbar/makefile.mk +++ b/sw/source/ui/ribbar/makefile.mk @@ -45,6 +45,11 @@ SRC1FILES = \ tblctrl.src \ workctrl.src +EXCEPTIONSFILES = \ + $(SLO)$/tblctrl.obj \ + $(SLO)$/tbxanchr.obj \ + $(SLO)$/workctrl.obj + SLOFILES = \ $(SLO)$/inputwin.obj \ $(SLO)$/tbxanchr.obj \ diff --git a/sw/source/ui/shells/makefile.mk b/sw/source/ui/shells/makefile.mk index e9a03a5a41..dce62a2c93 100644 --- a/sw/source/ui/shells/makefile.mk +++ b/sw/source/ui/shells/makefile.mk @@ -83,6 +83,7 @@ EXCEPTIONSFILES = \ $(SLO)$/drwtxtsh.obj \ $(SLO)$/frmsh.obj \ $(SLO)$/drwtxtex.obj \ + $(SLO)$/slotadd.obj \ $(SLO)$/textsh1.obj # --- Tagets ------------------------------------------------------- diff --git a/sw/source/ui/uiview/makefile.mk b/sw/source/ui/uiview/makefile.mk index d06bb58a7d..337ee85da5 100644 --- a/sw/source/ui/uiview/makefile.mk +++ b/sw/source/ui/uiview/makefile.mk @@ -49,8 +49,13 @@ EXCEPTIONSFILES= \ $(SLO)$/swcli.obj \ $(SLO)$/uivwimp.obj \ $(SLO)$/view.obj \ + $(SLO)$/view0.obj \ + $(SLO)$/view1.obj \ $(SLO)$/view2.obj \ + $(SLO)$/viewdraw.obj \ + $(SLO)$/viewport.obj \ $(SLO)$/viewprt.obj \ + $(SLO)$/viewsrch.obj \ $(SLO)$/viewling.obj \ $(SLO)$/viewmdi.obj \ diff --git a/sw/source/ui/utlui/makefile.mk b/sw/source/ui/utlui/makefile.mk index 7f2aa91c0e..da000994fe 100644 --- a/sw/source/ui/utlui/makefile.mk +++ b/sw/source/ui/utlui/makefile.mk @@ -51,8 +51,10 @@ SRC1FILES = \ EXCEPTIONSFILES= \ $(SLO)$/bookctrl.obj \ + $(SLO)$/glbltree.obj \ $(SLO)$/navipi.obj \ $(SLO)$/unotools.obj \ + $(SLO)$/content.obj \ $(SLO)$/swrenamexnameddlg.obj SLOFILES = $(EXCEPTIONSFILES) \ -- cgit v1.2.3 From dce15569e0bf80f0f123eb64d9b05b0e583c2c00 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 3 Jun 2010 17:18:12 +0200 Subject: sw33bf05: #i111750# method - erase further control characters from field string to avoid layout loop --- sw/source/core/text/porfld.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sw/source') diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 933a01c019..dc11a8e456 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -416,6 +416,12 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf ) // case CHAR_RLM : // case CHAR_LRM : // <-- + // --> OD 2010-06-03 #i111750# + // - Erasing further control characters from field string in + // to avoid loop. + case CH_TXTATR_BREAKWORD: + case CH_TXTATR_INWORD: + // <-- { aNew.Erase( 0, 1 ); ++nNextOfst; -- cgit v1.2.3 From c2cb8513d2acd010117cfc0863c2cee3829b6ef9 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Fri, 4 Jun 2010 10:10:57 +0200 Subject: sw33bf05: #i111681# method - making code robust --- sw/source/core/doc/number.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index b0f95952d9..ed1d795f78 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -998,7 +998,15 @@ void SwNumRule::SetInvalidRule(BOOL bFlag) for ( aIter = maTxtNodeList.begin(); aIter != maTxtNodeList.end(); ++aIter ) { const SwTxtNode* pTxtNode = *aIter; - aLists.insert( pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() ) ); + // --> OD 2010-06-04 #i111681# - applying patch from cmc +// aLists.insert( pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() ) ); + SwList* pList = pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() ); + ASSERT( pList, " - list at which the text node is registered at does not exist. This is a serious issue --> please inform OD."); + if ( pList ) + { + aLists.insert( pList ); + } + // <-- } std::for_each( aLists.begin(), aLists.end(), std::mem_fun( &SwList::InvalidateListTree ) ); -- cgit v1.2.3 From ad29da789a5bb2fed95a95c841b26114b21db43b Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Fri, 4 Jun 2010 11:32:20 +0200 Subject: sw33bf05: #i111768# method - include control characters --- sw/source/core/access/accportions.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sw/source') diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 0586210675..ee96baf19d 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -173,6 +173,17 @@ void SwAccessiblePortionData::Special( sDisplay = aTmpBuffer.makeStringAndClear(); break; } + // --> OD 2010-06-04 #i111768# - apply patch from kstribley: + // Include the control characters. + case POR_CONTROLCHAR: + { + OUStringBuffer aTmpBuffer( rText.Len() + 1 ); + aTmpBuffer.append( rText ); + aTmpBuffer.append( pTxtNode->GetTxt().GetChar(nModelPosition) ); + sDisplay = aTmpBuffer.makeStringAndClear(); + break; + } + // <-- default: sDisplay = rText; break; -- cgit v1.2.3 From f7c1944a11b3128c62e1e4648136d7c8c9eef5ec Mon Sep 17 00:00:00 2001 From: os Date: Fri, 4 Jun 2010 18:01:33 +0200 Subject: #i103024# default tabs in non-relative mode in negative indents fixed --- sw/source/core/text/txttab.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sw/source') diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index ed565f233d..9a1c66aac6 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -172,6 +172,11 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) cDec = pTabStop->GetDecimal(); eAdj = pTabStop->GetAdjustment(); nNextPos = pTabStop->GetTabPos(); + if(!bTabsRelativeToIndent && eAdj == SVX_TAB_ADJUST_DEFAULT && nSearchPos < 0) + { + //calculate default tab position of default tabs in negative indent + nNextPos = ( nSearchPos / nNextPos ) * nNextPos; + } } else { -- cgit v1.2.3 From 96de36f872725e75cd451c1cbe7474a2e3e23f18 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 9 Jun 2010 16:36:05 +0200 Subject: fwk139: #i10000# adopt for linux --- sw/source/ui/utlui/makefile.mk | 2 -- 1 file changed, 2 deletions(-) (limited to 'sw/source') diff --git a/sw/source/ui/utlui/makefile.mk b/sw/source/ui/utlui/makefile.mk index da000994fe..cded61eee3 100644 --- a/sw/source/ui/utlui/makefile.mk +++ b/sw/source/ui/utlui/makefile.mk @@ -59,9 +59,7 @@ EXCEPTIONSFILES= \ SLOFILES = $(EXCEPTIONSFILES) \ $(SLO)$/condedit.obj \ - $(SLO)$/content.obj \ $(SLO)$/gloslst.obj \ - $(SLO)$/glbltree.obj \ $(SLO)$/initui.obj \ $(SLO)$/navicfg.obj \ $(SLO)$/numfmtlb.obj \ -- cgit v1.2.3 From da127380c572fe5500e80e146efc6ce67f26b7d0 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Wed, 9 Jun 2010 17:05:22 +0200 Subject: tl78: Do not protect every section if document is protected. --- sw/source/filter/ww8/ww8par.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 71250360d7..cef7060bc2 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1817,7 +1817,7 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, bool wwSectionManager::SectionIsProtected(const wwSection &rSection) const { - return (mrReader.pWDop->fProtEnabled && !rSection.IsNotProtected()); + return (!rSection.IsNotProtected()); } void wwSectionManager::SetHdFt(wwSection &rSection, int nSect, -- cgit v1.2.3 From 1b0fad94af38d6f693cec25c5dccd2e55a743356 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 12 Jun 2010 20:29:06 +0200 Subject: CWS mba33issues01: put code to load libraries on demand into class SvLibrary --- sw/source/filter/basflt/fltini.cxx | 2068 ++++++++++++++++++------------------ 1 file changed, 1037 insertions(+), 1031 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index e1b341aa05..6d33a658fc 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -1,1031 +1,1037 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -#define _SVSTDARR_STRINGS - -#include -#include // sscanf -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace utl; -using rtl::OUString; -using namespace com::sun::star::uno; - -SwRead ReadAscii = 0, /*ReadSwg = 0, ReadSw3 = 0,*/ - ReadHTML = 0, ReadXML = 0; - -Reader* GetRTFReader(); -Reader* GetWW8Reader(); - -// Note: if editing, please don't forget to modify also the enum -// ReaderWriterEnum and aFilterDetect in shellio.hxx -SwReaderWriterEntry aReaderWriter[] = -{ - SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, TRUE ), - SwReaderWriterEntry( 0, &::GetASCWriter, FALSE ), - SwReaderWriterEntry( &::GetWW8Reader, &::GetWW8Writer, TRUE ), - SwReaderWriterEntry( &::GetWW8Reader, &::GetWW8Writer, TRUE ), - SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, TRUE ), - SwReaderWriterEntry( 0, &::GetHTMLWriter, TRUE ), - SwReaderWriterEntry( 0, 0, TRUE ), - SwReaderWriterEntry( &::GetWW8Reader, 0, TRUE ), - SwReaderWriterEntry( 0, &::GetXMLWriter, TRUE ), - SwReaderWriterEntry( 0, &::GetASCWriter, TRUE ), - SwReaderWriterEntry( 0, &::GetASCWriter, TRUE ) -}; - -Reader* SwReaderWriterEntry::GetReader() -{ - if ( pReader ) - return pReader; - else if ( fnGetReader ) - { - pReader = (*fnGetReader)(); - return pReader; - } - return NULL; -} - -void SwReaderWriterEntry::GetWriter( const String& rNm, const String& rBaseURL, WriterRef& xWrt ) const -{ - if ( fnGetWriter ) - (*fnGetWriter)( rNm, rBaseURL, xWrt ); - else - xWrt = WriterRef(0); -} - -/*SwRead SwGetReaderSw3() // SW_DLLPUBLIC -{ - return ReadSw3; -} -*/ -SwRead SwGetReaderXML() // SW_DLLPUBLIC -{ - return ReadXML; -} - -bool IsDocShellRegistered() -{ - return 0 != SwDocShell::_GetInterface(); -} - -inline void _SetFltPtr( USHORT rPos, SwRead pReader ) -{ - aReaderWriter[ rPos ].pReader = pReader; -} - -void _InitFilter() -{ - _SetFltPtr( READER_WRITER_BAS, (ReadAscii = new AsciiReader) ); - _SetFltPtr( READER_WRITER_HTML, (ReadHTML = new HTMLReader) ); - _SetFltPtr( READER_WRITER_WW1, new WW1Reader ); - _SetFltPtr( READER_WRITER_XML, (ReadXML = new XMLReader) ); - -#ifdef NEW_WW97_EXPORT - aReaderWriter[ READER_WRITER_WW1 ].fnGetWriter = &::GetWW8Writer; - aReaderWriter[ READER_WRITER_WW5 ].fnGetWriter = &::GetWW8Writer; -#endif - - _SetFltPtr( READER_WRITER_TEXT_DLG, ReadAscii ); - _SetFltPtr( READER_WRITER_TEXT, ReadAscii ); -} - -void _FinitFilter() -{ - // die Reader vernichten - for( USHORT n = 0; n < MAXFILTER; ++n ) - { - SwReaderWriterEntry& rEntry = aReaderWriter[n]; - if( rEntry.bDelReader && rEntry.pReader ) - delete rEntry.pReader, rEntry.pReader = NULL; - } -} - - -/* */ - -namespace SwReaderWriter { - -Reader* GetReader( ReaderWriterEnum eReader ) -{ - return aReaderWriter[eReader].GetReader(); -} - -void GetWriter( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) -{ - for( USHORT n = 0; n < MAXFILTER; ++n ) - if( aFilterDetect[n].IsFilter( rFltName ) ) - { - aReaderWriter[n].GetWriter( rFltName, rBaseURL, xRet ); - break; - } -} - -SwRead GetReader( const String& rFltName ) -{ - SwRead pRead = 0; - for( USHORT n = 0; n < MAXFILTER; ++n ) - if( aFilterDetect[n].IsFilter( rFltName ) ) - { - pRead = aReaderWriter[n].GetReader(); - // fuer einige Reader noch eine Sonderbehandlung: - if ( pRead ) - pRead->SetFltName( rFltName ); - break; - } - return pRead; -} - -} // namespace SwReaderWriter - -/* */ - -/////////////// die Storage Reader/Writer //////////////////////////////// - -/*void GetSw3Writer( const String&, const String& rBaseURL, WriterRef& xRet ) -{ - DBG_ERROR( "Shouldn't happen!"); - xRet = new Sw3Writer; -} -*/ - -ULONG StgReader::OpenMainStream( SvStorageStreamRef& rRef, USHORT& rBuffSize ) -{ - ULONG nRet = ERR_SWG_READ_ERROR; - ASSERT( pStg, "wo ist mein Storage?" ); - const SfxFilter* pFltr = SwIoSystem::GetFilterOfFormat( aFltName ); - if( pFltr ) - { - rRef = pStg->OpenSotStream( SwIoSystem::GetSubStorageName( *pFltr ), - STREAM_READ | STREAM_SHARE_DENYALL ); - - if( rRef.Is() ) - { - if( SVSTREAM_OK == rRef->GetError() ) - { - USHORT nOld = rRef->GetBufferSize(); - rRef->SetBufferSize( rBuffSize ); - rBuffSize = nOld; - nRet = 0; - } - else - nRet = rRef->GetError(); - } - } - return nRet; -} - -/* */ -/* -ULONG Sw3Reader::Read( SwDoc &rDoc, SwPaM &rPam, const String & ) -{ - ULONG nRet; - if( pStg && pIO ) - { - // TRUE: Vorlagen ueberschreiben - pIO->SetReadOptions( aOpt,TRUE ); - if( !bInsertMode ) - { - // Im Laden-Modus darf der PaM-Content-Teil nicht - // in den Textbereich zeigen (Nodes koennen geloescht werden) - rPam.GetBound( TRUE ).nContent.Assign( 0, 0 ); - rPam.GetBound( FALSE ).nContent.Assign( 0, 0 ); - } - nRet = pIO->Load( pStg, bInsertMode ? &rPam : 0 ); - aOpt.ResetAllFmtsOnly(); - pIO->SetReadOptions( aOpt, TRUE ); - } - else - { - ASSERT( !this, "Sw3-Read ohne Storage und/oder IO-System" ); - nRet = ERR_SWG_READ_ERROR; - } - return nRet; -} - - // read the sections of the document, which is equal to the medium. - // returns the count of it -USHORT Sw3Reader::GetSectionList( SfxMedium& rMedium, - SvStrings& rStrings ) const -{ - SvStorageRef aStg( rMedium.GetStorage() ); - const SfxFilter* pFlt = rMedium.GetFilter(); - ASSERT( pFlt && pFlt->GetVersion(), - "Kein Filter oder Filter ohne FF-Version" ); - if( pFlt && pFlt->GetVersion() ) - aStg->SetVersion( (long)pFlt->GetVersion() ); - - if( pIO ) - pIO->GetSectionList( &aStg, rStrings ); - return rStrings.Count(); - return 0; -} -*/ - -/*ULONG Sw3Writer::WriteStorage() -{ - ULONG nRet; - if( pIO ) - { - // der gleiche Storage -> Save, sonst SaveAs aufrufen - if( !bSaveAs ) - nRet = pIO->Save( pOrigPam, bWriteAll ); - else - nRet = pIO->SaveAs( pStg, pOrigPam, bWriteAll ); - - pIO = 0; // nach dem Schreiben ist der Pointer ungueltig !! - } - else - { - ASSERT( !this, "Sw3-Writer ohne IO-System" ) - nRet = ERR_SWG_WRITE_ERROR; - } - return nRet; -} - -ULONG Sw3Writer::WriteMedium( SfxMedium& ) -{ - DBG_ERROR( "Shouldn't be used currently!"); - return WriteStorage(); -} - -BOOL Sw3Writer::IsSw3Writer() const { return TRUE; } -*/ - -void Writer::SetPasswd( const String& ) {} - - -void Writer::SetVersion( const String&, long ) {} - - -BOOL Writer::IsStgWriter() const { return FALSE; } -//BOOL Writer::IsSw3Writer() const { return FALSE; } - -BOOL StgWriter::IsStgWriter() const { return TRUE; } - -/* */ - - - -BOOL SwReader::NeedsPasswd( const Reader& /*rOptions*/ ) -{ - BOOL bRes = FALSE; - return bRes; -} - - -BOOL SwReader::CheckPasswd( const String& /*rPasswd*/, const Reader& /*rOptions*/ ) -{ - return TRUE; -} - - -/* */ - -//----------------------------------------------------------------------- -// Filter Flags lesen, wird von WW8 / W4W / EXCEL / LOTUS benutzt. -//----------------------------------------------------------------------- - -/* - - - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - - -*/ - -#define FILTER_OPTION_ROOT String::CreateFromAscii( \ - RTL_CONSTASCII_STRINGPARAM( "Office.Writer/FilterFlags" ) ) - -SwFilterOptions::SwFilterOptions( sal_uInt16 nCnt, const sal_Char** ppNames, - sal_uInt32* pValues ) - : ConfigItem( FILTER_OPTION_ROOT ) -{ - GetValues( nCnt, ppNames, pValues ); -} - -void SwFilterOptions::GetValues( sal_uInt16 nCnt, const sal_Char** ppNames, - sal_uInt32* pValues ) -{ - Sequence aNames( nCnt ); - OUString* pNames = aNames.getArray(); - USHORT n; - - for( n = 0; n < nCnt; ++n ) - pNames[ n ] = OUString::createFromAscii( ppNames[ n ] ); - Sequence aValues = GetProperties( aNames ); - - if( nCnt == aValues.getLength() ) - { - const Any* pAnyValues = aValues.getConstArray(); - for( n = 0; n < nCnt; ++n ) - pValues[ n ] = pAnyValues[ n ].hasValue() - ? *(sal_uInt32*)pAnyValues[ n ].getValue() - : 0; - } - else - for( n = 0; n < nCnt; ++n ) - pValues[ n ] = 0; -} - -void SwFilterOptions::Commit() {} -void SwFilterOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} - -/* */ - - -void StgReader::SetFltName( const String& rFltNm ) -{ - if( SW_STORAGE_READER & GetReaderType() ) - aFltName = rFltNm; -} - - -/* */ - -SwRelNumRuleSpaces::SwRelNumRuleSpaces( SwDoc& rDoc, BOOL bNDoc ) - : bNewDoc( bNDoc ) -{ - pNumRuleTbl = new SwNumRuleTbl( 8, 8 ); - if( !bNDoc ) - pNumRuleTbl->Insert( &rDoc.GetNumRuleTbl(), 0 ); -} - -SwRelNumRuleSpaces::~SwRelNumRuleSpaces() -{ - if( pNumRuleTbl ) - { - pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); - delete pNumRuleTbl; - } -} - -void SwRelNumRuleSpaces::SetNumRelSpaces( SwDoc& rDoc ) -{ - const SwNumRuleTbl* pRuleTbl = NULL; - - if( !bNewDoc ) - { - // jetzt alle schon vorhanden NumRules aus dem Array entfernen, - // damit nur die neuen angepasst werden - SwNumRuleTbl aNumRuleTbl; - aNumRuleTbl.Insert( pNumRuleTbl, 0 ); - pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); - const SwNumRuleTbl& rRuleTbl = rDoc.GetNumRuleTbl(); - SwNumRule* pRule; - - for( USHORT n = 0; n < rRuleTbl.Count(); ++n ) - if( USHRT_MAX == aNumRuleTbl.GetPos( ( pRule = rRuleTbl[ n ] ))) - // war noch nicht vorhanden, also neu - pNumRuleTbl->Insert( pRule, pNumRuleTbl->Count() ); - - aNumRuleTbl.Remove( 0, aNumRuleTbl.Count() ); - - pRuleTbl = pNumRuleTbl; - } - else - { - pRuleTbl = &rDoc.GetNumRuleTbl(); - } - - if( pRuleTbl ) - { - for( USHORT n = pRuleTbl->Count(); n; ) - { - SwNumRule* pRule = (*pRuleTbl)[ --n ]; - // Rule noch gueltig und am Doc vorhanden? - if( USHRT_MAX != rDoc.GetNumRuleTbl().GetPos( pRule )) - { - // --> OD 2008-02-19 #refactorlists# -// SwNumRuleInfo aUpd( pRule->GetName() ); -// aUpd.MakeList( rDoc ); - -// // bei allen nmumerierten Absaetzen vom linken Rand -// // den absoluten Wert des NumFormates abziehen -// for( ULONG nUpdPos = 0; nUpdPos < aUpd.GetList().Count(); -// ++nUpdPos ) -// { -// SwTxtNode* pNd = aUpd.GetList().GetObject( nUpdPos ); -// SetNumLSpace( *pNd, *pRule ); -// } - SwNumRule::tTxtNodeList aTxtNodeList; - pRule->GetTxtNodeList( aTxtNodeList ); - for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin(); - aIter != aTxtNodeList.end(); ++aIter ) - { - SwTxtNode* pNd = *aIter; - SetNumLSpace( *pNd, *pRule ); - } - // <-- - } - } - } - - if( pNumRuleTbl ) - { - pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); - delete pNumRuleTbl, pNumRuleTbl = 0; - } - - if( bNewDoc ) - { - SetOultineRelSpaces( SwNodeIndex( rDoc.GetNodes() ), - SwNodeIndex( rDoc.GetNodes().GetEndOfContent())); - } -} - -void SwRelNumRuleSpaces::SetOultineRelSpaces( const SwNodeIndex& rStt, - const SwNodeIndex& rEnd ) -{ - SwDoc* pDoc = rStt.GetNode().GetDoc(); - const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); - if( rOutlNds.Count() ) - { - USHORT nPos; - rOutlNds.Seek_Entry( &rStt.GetNode(), &nPos ); - for( ; nPos < rOutlNds.Count() && - rOutlNds[ nPos ]->GetIndex() < rEnd.GetIndex(); ++nPos ) - { - SwTxtNode* pNd = rOutlNds[ nPos ]->GetTxtNode(); - if( pNd->IsOutline() && !pNd->GetNumRule() ) - SetNumLSpace( *pNd, *pDoc->GetOutlineNumRule() ); - } - } -} - -void SwRelNumRuleSpaces::SetNumLSpace( SwTxtNode& rNd, const SwNumRule& rRule ) -{ - BOOL bOutlineRule = OUTLINE_RULE == rRule.GetRuleType(); - // --> OD 2005-11-18 #128056# - // correction of refactoring done by cws swnumtree: - // - assure a correct level for retrieving numbering format. -// BYTE nLvl = rNd.GetLevel(); - BYTE nLvl = 0; - if ( rNd.GetActualListLevel() >= 0 && rNd.GetActualListLevel() < MAXLEVEL ) - { - nLvl = static_cast< BYTE >(rNd.GetActualListLevel()); - } - // <-- - const SwNumFmt& rFmt = rRule.Get( nLvl ); - const SvxLRSpaceItem& rLR = rNd.GetSwAttrSet().GetLRSpace(); - - SvxLRSpaceItem aLR( rLR ); - aLR.SetTxtFirstLineOfst( 0 ); - - // sagt der Node, das die Numerierung den Wert vorgibt? - if( !bOutlineRule && rNd.IsSetNumLSpace() ) - aLR.SetTxtLeft( 0 ); - else - { - long nLeft = rFmt.GetAbsLSpace(), nParaLeft = rLR.GetTxtLeft(); - if( 0 < rLR.GetTxtFirstLineOfst() ) - nParaLeft += rLR.GetTxtFirstLineOfst(); - else if( nParaLeft >= nLeft ) - // #82963#/#82962#: set correct paragraph indent - nParaLeft -= nLeft; - else - //#83154#, Don't think any of the older #80856# bugfix code is - //relevent anymore. - nParaLeft = rLR.GetTxtLeft()+rLR.GetTxtFirstLineOfst(); - aLR.SetTxtLeft( nParaLeft ); - } - - if( aLR.GetTxtLeft() != rLR.GetTxtLeft() ) - { - //bevor rLR geloescht wird! - long nOffset = rLR.GetTxtLeft() - aLR.GetTxtLeft(); - rNd.SetAttr( aLR ); - - // Tabs anpassen !! - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == rNd.GetSwAttrSet().GetItemState( - RES_PARATR_TABSTOP, TRUE, &pItem )) - { - SvxTabStopItem aTStop( *(SvxTabStopItem*)pItem ); - for( USHORT n = 0; n < aTStop.Count(); ++n ) - { - SvxTabStop& rTab = (SvxTabStop&)aTStop[ n ]; - if( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() ) - { - if( !rTab.GetTabPos() ) - { - aTStop.Remove( n ); - --n; - } - else - rTab.GetTabPos() += nOffset; - } - } - rNd.SetAttr( aTStop ); - } - } -} - -/* */ - - -void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, - SwTwips nPageWidth) -{ - const SfxPoolItem* pItem = 0; - if( SFX_ITEM_SET != rFlySet.GetItemState( RES_FRM_SIZE, TRUE, &pItem ) || - MINFLY > ((SwFmtFrmSize*)pItem)->GetWidth() ) - { - SwFmtFrmSize aSz((SwFmtFrmSize&)rFlySet.Get(RES_FRM_SIZE, TRUE)); - if (pItem) - aSz = (SwFmtFrmSize&)(*pItem); - - SwTwips nWidth; - // dann die Breite des Flys selbst bestimmen. Ist eine Tabelle - // defininiert, dann benutze deren Breite, sonst die Breite der - // Seite - const SwTableNode* pTblNd = rAnchor.GetNode().FindTableNode(); - if( pTblNd ) - nWidth = pTblNd->GetTable().GetFrmFmt()->GetFrmSize().GetWidth(); - else - nWidth = nPageWidth; - - const SwNodeIndex* pSttNd = ((SwFmtCntnt&)rFlySet.Get( RES_CNTNT )). - GetCntntIdx(); - if( pSttNd ) - { - BOOL bOnlyOneNode = TRUE; - ULONG nMinFrm = 0; - ULONG nMaxFrm = 0; - SwTxtNode* pFirstTxtNd = 0; - SwNodeIndex aIdx( *pSttNd, 1 ); - SwNodeIndex aEnd( *pSttNd->GetNode().EndOfSectionNode() ); - while( aIdx < aEnd ) - { - SwTxtNode *pTxtNd = aIdx.GetNode().GetTxtNode(); - if( pTxtNd ) - { - if( !pFirstTxtNd ) - pFirstTxtNd = pTxtNd; - else if( pFirstTxtNd != pTxtNd ) - { - // forget it - bOnlyOneNode = FALSE; - break; - } - - ULONG nAbsMinCnts; - pTxtNd->GetMinMaxSize( aIdx.GetIndex(), nMinFrm, - nMaxFrm, nAbsMinCnts ); - } - aIdx++; - } - - if( bOnlyOneNode ) - { - if( nMinFrm < MINLAY && pFirstTxtNd ) - { - // if the first node dont contained any content, then - // insert one char in it calc again and delete once again - SwIndex aNdIdx( pFirstTxtNd ); - pFirstTxtNd->InsertText( String::CreateFromAscii( - RTL_CONSTASCII_STRINGPARAM( "MM" )), aNdIdx ); - ULONG nAbsMinCnts; - pFirstTxtNd->GetMinMaxSize( pFirstTxtNd->GetIndex(), - nMinFrm, nMaxFrm, nAbsMinCnts ); - aNdIdx -= 2; - pFirstTxtNd->EraseText( aNdIdx, 2 ); - } - - // Umrandung und Abstand zum Inhalt beachten - const SvxBoxItem& rBoxItem = (SvxBoxItem&)rFlySet.Get( RES_BOX ); - USHORT nLine = BOX_LINE_LEFT; - for( int i = 0; i < 2; ++i ) - { - const SvxBorderLine* pLn = rBoxItem.GetLine( nLine ); - if( pLn ) - { - USHORT nWidthTmp = pLn->GetOutWidth() + pLn->GetInWidth(); - nWidthTmp = nWidthTmp + rBoxItem.GetDistance( nLine ); - nMinFrm += nWidthTmp; - nMaxFrm += nWidthTmp; - } - nLine = BOX_LINE_RIGHT; - } - - // Mindestbreite fuer Inhalt einhalten - if( nMinFrm < MINLAY ) - nMinFrm = MINLAY; - if( nMaxFrm < MINLAY ) - nMaxFrm = MINLAY; - - if( nWidth > (USHORT)nMaxFrm ) - nWidth = nMaxFrm; - else if( nWidth > (USHORT)nMinFrm ) - nWidth = nMinFrm; - } - } - - if( MINFLY > nWidth ) - nWidth = MINFLY; - - aSz.SetWidth( nWidth ); - if( MINFLY > aSz.GetHeight() ) - aSz.SetHeight( MINFLY ); - rFlySet.Put( aSz ); - } - else if( MINFLY > ((SwFmtFrmSize*)pItem)->GetHeight() ) - { - SwFmtFrmSize aSz( *(SwFmtFrmSize*)pItem ); - aSz.SetHeight( MINFLY ); - rFlySet.Put( aSz ); - } -} - -/* */ -struct CharSetNameMap -{ - rtl_TextEncoding eCode; - const sal_Char* pName; -}; - -const CharSetNameMap *GetCharSetNameMap() -{ - static const CharSetNameMap aMapArr[] = - { -# define IMPLENTRY(X) { RTL_TEXTENCODING_##X, "" #X "" } - IMPLENTRY(DONTKNOW), - IMPLENTRY(MS_1252), - IMPLENTRY(APPLE_ROMAN), - IMPLENTRY(IBM_437), - IMPLENTRY(IBM_850), - IMPLENTRY(IBM_860), - IMPLENTRY(IBM_861), - IMPLENTRY(IBM_863), - IMPLENTRY(IBM_865), - IMPLENTRY(SYMBOL), - IMPLENTRY(ASCII_US), - IMPLENTRY(ISO_8859_1), - IMPLENTRY(ISO_8859_2), - IMPLENTRY(ISO_8859_3), - IMPLENTRY(ISO_8859_4), - IMPLENTRY(ISO_8859_5), - IMPLENTRY(ISO_8859_6), - IMPLENTRY(ISO_8859_7), - IMPLENTRY(ISO_8859_8), - IMPLENTRY(ISO_8859_9), - IMPLENTRY(ISO_8859_14), - IMPLENTRY(ISO_8859_15), - IMPLENTRY(IBM_737), - IMPLENTRY(IBM_775), - IMPLENTRY(IBM_852), - IMPLENTRY(IBM_855), - IMPLENTRY(IBM_857), - IMPLENTRY(IBM_862), - IMPLENTRY(IBM_864), - IMPLENTRY(IBM_866), - IMPLENTRY(IBM_869), - IMPLENTRY(MS_874), - IMPLENTRY(MS_1250), - IMPLENTRY(MS_1251), - IMPLENTRY(MS_1253), - IMPLENTRY(MS_1254), - IMPLENTRY(MS_1255), - IMPLENTRY(MS_1256), - IMPLENTRY(MS_1257), - IMPLENTRY(MS_1258), - IMPLENTRY(APPLE_ARABIC), - IMPLENTRY(APPLE_CENTEURO), - IMPLENTRY(APPLE_CROATIAN), - IMPLENTRY(APPLE_CYRILLIC), - IMPLENTRY(APPLE_DEVANAGARI), - IMPLENTRY(APPLE_FARSI), - IMPLENTRY(APPLE_GREEK), - IMPLENTRY(APPLE_GUJARATI), - IMPLENTRY(APPLE_GURMUKHI), - IMPLENTRY(APPLE_HEBREW), - IMPLENTRY(APPLE_ICELAND), - IMPLENTRY(APPLE_ROMANIAN), - IMPLENTRY(APPLE_THAI), - IMPLENTRY(APPLE_TURKISH), - IMPLENTRY(APPLE_UKRAINIAN), - IMPLENTRY(APPLE_CHINSIMP), - IMPLENTRY(APPLE_CHINTRAD), - IMPLENTRY(APPLE_JAPANESE), - IMPLENTRY(APPLE_KOREAN), - IMPLENTRY(MS_932), - IMPLENTRY(MS_936), - IMPLENTRY(MS_949), - IMPLENTRY(MS_950), - IMPLENTRY(SHIFT_JIS), - IMPLENTRY(GB_2312), - IMPLENTRY(GBT_12345), - IMPLENTRY(GBK), - IMPLENTRY(BIG5), - IMPLENTRY(EUC_JP), - IMPLENTRY(EUC_CN), - IMPLENTRY(EUC_TW), - IMPLENTRY(ISO_2022_JP), - IMPLENTRY(ISO_2022_CN), - IMPLENTRY(KOI8_R), - IMPLENTRY(KOI8_U), - IMPLENTRY(UTF7), - IMPLENTRY(UTF8), - IMPLENTRY(ISO_8859_10), - IMPLENTRY(ISO_8859_13), - IMPLENTRY(EUC_KR), - IMPLENTRY(ISO_2022_KR), - IMPLENTRY(JIS_X_0201), - IMPLENTRY(JIS_X_0208), - IMPLENTRY(JIS_X_0212), - IMPLENTRY(MS_1361), - IMPLENTRY(GB_18030), - IMPLENTRY(BIG5_HKSCS), - IMPLENTRY(TIS_620), - IMPLENTRY(PT154), - IMPLENTRY(UCS4), - IMPLENTRY(UCS2), - IMPLENTRY(UNICODE), - {0,0} //Last - }; - return &aMapArr[0]; -} -/* - Get a rtl_TextEncoding from its name - */ -rtl_TextEncoding CharSetFromName(const String& rChrSetStr) -{ - const CharSetNameMap *pStart = GetCharSetNameMap(); - rtl_TextEncoding nRet = pStart->eCode; - - for(const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap) - { - if(rChrSetStr.EqualsIgnoreCaseAscii(pMap->pName)) - { - nRet = pMap->eCode; - break; - } - } - - ASSERT(nRet != pStart->eCode, "TXT: That was an unknown language!"); - - return nRet; -} - - -/* - Get the String name of an rtl_TextEncoding - */ -String NameFromCharSet(rtl_TextEncoding nChrSet) -{ - const CharSetNameMap *pStart = GetCharSetNameMap(); - const char *pRet = pStart->pName; - - for(const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap) - { - if (nChrSet == pMap->eCode) - { - pRet = pMap->pName; - break; - } - } - - ASSERT(pRet != pStart->pName, "TXT: That was an unknown language!"); - - return String::CreateFromAscii(pRet); -} - -// for the automatic conversion (mail/news/...) -// The user data contains the options for the ascii import/export filter. -// The format is: -// 1. CharSet - as ascii chars -// 2. LineEnd - as CR/LR/CRLF -// 3. Fontname -// 4. Language -// the delimetercharacter is "," -// - -void SwAsciiOptions::ReadUserData( const String& rStr ) -{ - xub_StrLen nToken = 0; - USHORT nCnt = 0; - String sToken; - do { - if( 0 != (sToken = rStr.GetToken( 0, ',', nToken )).Len() ) - { - switch( nCnt ) - { - case 0: // CharSet - eCharSet = CharSetFromName(sToken); - break; - case 1: // LineEnd - if( sToken.EqualsIgnoreCaseAscii( "CRLF" )) - eCRLF_Flag = LINEEND_CRLF; - else if( sToken.EqualsIgnoreCaseAscii( "LF" )) - eCRLF_Flag = LINEEND_LF; - else - eCRLF_Flag = LINEEND_CR; - break; - case 2: // fontname - sFont = sToken; - break; - case 3: // Language - nLanguage = MsLangId::convertIsoStringToLanguage( sToken ); - break; - } - } - ++nCnt; - } while( STRING_NOTFOUND != nToken ); -} - -void SwAsciiOptions::WriteUserData( String& rStr ) -{ - // 1. charset - rStr = NameFromCharSet(eCharSet); - rStr += ','; - - // 2. LineEnd - switch(eCRLF_Flag) - { - case LINEEND_CRLF: - rStr.AppendAscii( "CRLF" ); - break; - case LINEEND_CR: - rStr.AppendAscii( "CR" ); - break; - case LINEEND_LF: - rStr.AppendAscii( "LF" ); - break; - } - rStr += ','; - - // 3. Fontname - rStr += sFont; - rStr += ','; - - // 4. Language - if (nLanguage) - { - rtl::OUString sTmp = MsLangId::convertLanguageToIsoString( nLanguage ); - rStr += (String)sTmp; - } - rStr += ','; -} - -extern "C" { static void SAL_CALL thisModule() {} } - -static oslGenericFunction GetMswordLibSymbol( const char *pSymbol ) -{ - static ::osl::Module aModule; - if ( aModule.is() || - aModule.loadRelative( &thisModule, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "msword" ) ) ) ) ) - { - return aModule.getFunctionSymbol( ::rtl::OUString::createFromAscii( pSymbol ) ); - } - - return NULL; -} - -Reader* GetRTFReader() -{ - FnGetReader pFunction = reinterpret_cast( GetMswordLibSymbol( "ImportRTF" ) ); - - if ( pFunction ) - return (*pFunction)(); - - return NULL; -} - -void GetRTFWriter( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) -{ - FnGetWriter pFunction = reinterpret_cast( GetMswordLibSymbol( "ExportRTF" ) ); - - if ( pFunction ) - (*pFunction)( rFltName, rBaseURL, xRet ); - else - xRet = WriterRef(0); -} - -Reader* GetWW8Reader() -{ - FnGetReader pFunction = reinterpret_cast( GetMswordLibSymbol( "ImportDOC" ) ); - - if ( pFunction ) - return (*pFunction)(); - - return NULL; -} - -void GetWW8Writer( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) -{ - FnGetWriter pFunction = reinterpret_cast( GetMswordLibSymbol( "ExportDOC" ) ); - - if ( pFunction ) - (*pFunction)( rFltName, rBaseURL, xRet ); - else - xRet = WriterRef(0); -} - -typedef ULONG ( __LOADONCALLAPI *SaveOrDel )( SfxObjectShell&, SotStorage&, BOOL, const String& ); -typedef ULONG ( __LOADONCALLAPI *GetSaveWarning )( SfxObjectShell& ); - -ULONG SaveOrDelMSVBAStorage( SfxObjectShell& rDoc, SotStorage& rStor, BOOL bSaveInto, const String& rStorageName ) -{ - SaveOrDel pFunction = reinterpret_cast( GetMswordLibSymbol( "SaveOrDelMSVBAStorage_ww8" ) ); - if( pFunction ) - return pFunction( rDoc, rStor, bSaveInto, rStorageName ); - return ERRCODE_NONE; -} - -ULONG GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ) -{ - GetSaveWarning pFunction = reinterpret_cast( GetMswordLibSymbol( "GetSaveWarningOfMSVBAStorage_ww8" ) ); - if( pFunction ) - return pFunction( rDocS ); - return ERRCODE_NONE; -} - - +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sw.hxx" +#define _SVSTDARR_STRINGS + +#include +#include // sscanf +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace utl; +using rtl::OUString; +using namespace com::sun::star::uno; +using namespace com::sun::star; + +SwRead ReadAscii = 0, /*ReadSwg = 0, ReadSw3 = 0,*/ + ReadHTML = 0, ReadXML = 0; + +Reader* GetRTFReader(); +Reader* GetWW8Reader(); + +// Note: if editing, please don't forget to modify also the enum +// ReaderWriterEnum and aFilterDetect in shellio.hxx +SwReaderWriterEntry aReaderWriter[] = +{ + SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, TRUE ), + SwReaderWriterEntry( 0, &::GetASCWriter, FALSE ), + SwReaderWriterEntry( &::GetWW8Reader, &::GetWW8Writer, TRUE ), + SwReaderWriterEntry( &::GetWW8Reader, &::GetWW8Writer, TRUE ), + SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, TRUE ), + SwReaderWriterEntry( 0, &::GetHTMLWriter, TRUE ), + SwReaderWriterEntry( 0, 0, TRUE ), + SwReaderWriterEntry( &::GetWW8Reader, 0, TRUE ), + SwReaderWriterEntry( 0, &::GetXMLWriter, TRUE ), + SwReaderWriterEntry( 0, &::GetASCWriter, TRUE ), + SwReaderWriterEntry( 0, &::GetASCWriter, TRUE ) +}; + +Reader* SwReaderWriterEntry::GetReader() +{ + if ( pReader ) + return pReader; + else if ( fnGetReader ) + { + pReader = (*fnGetReader)(); + return pReader; + } + return NULL; +} + +void SwReaderWriterEntry::GetWriter( const String& rNm, const String& rBaseURL, WriterRef& xWrt ) const +{ + if ( fnGetWriter ) + (*fnGetWriter)( rNm, rBaseURL, xWrt ); + else + xWrt = WriterRef(0); +} + +/*SwRead SwGetReaderSw3() // SW_DLLPUBLIC +{ + return ReadSw3; +} +*/ +SwRead SwGetReaderXML() // SW_DLLPUBLIC +{ + return ReadXML; +} + +bool IsDocShellRegistered() +{ + return 0 != SwDocShell::_GetInterface(); +} + +inline void _SetFltPtr( USHORT rPos, SwRead pReader ) +{ + aReaderWriter[ rPos ].pReader = pReader; +} + +void _InitFilter() +{ + _SetFltPtr( READER_WRITER_BAS, (ReadAscii = new AsciiReader) ); + _SetFltPtr( READER_WRITER_HTML, (ReadHTML = new HTMLReader) ); + _SetFltPtr( READER_WRITER_WW1, new WW1Reader ); + _SetFltPtr( READER_WRITER_XML, (ReadXML = new XMLReader) ); + +#ifdef NEW_WW97_EXPORT + aReaderWriter[ READER_WRITER_WW1 ].fnGetWriter = &::GetWW8Writer; + aReaderWriter[ READER_WRITER_WW5 ].fnGetWriter = &::GetWW8Writer; +#endif + + _SetFltPtr( READER_WRITER_TEXT_DLG, ReadAscii ); + _SetFltPtr( READER_WRITER_TEXT, ReadAscii ); +} + +void _FinitFilter() +{ + // die Reader vernichten + for( USHORT n = 0; n < MAXFILTER; ++n ) + { + SwReaderWriterEntry& rEntry = aReaderWriter[n]; + if( rEntry.bDelReader && rEntry.pReader ) + delete rEntry.pReader, rEntry.pReader = NULL; + } +} + + +/* */ + +namespace SwReaderWriter { + +Reader* GetReader( ReaderWriterEnum eReader ) +{ + return aReaderWriter[eReader].GetReader(); +} + +void GetWriter( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) +{ + for( USHORT n = 0; n < MAXFILTER; ++n ) + if( aFilterDetect[n].IsFilter( rFltName ) ) + { + aReaderWriter[n].GetWriter( rFltName, rBaseURL, xRet ); + break; + } +} + +SwRead GetReader( const String& rFltName ) +{ + SwRead pRead = 0; + for( USHORT n = 0; n < MAXFILTER; ++n ) + if( aFilterDetect[n].IsFilter( rFltName ) ) + { + pRead = aReaderWriter[n].GetReader(); + // fuer einige Reader noch eine Sonderbehandlung: + if ( pRead ) + pRead->SetFltName( rFltName ); + break; + } + return pRead; +} + +} // namespace SwReaderWriter + +/* */ + +/////////////// die Storage Reader/Writer //////////////////////////////// + +/*void GetSw3Writer( const String&, const String& rBaseURL, WriterRef& xRet ) +{ + DBG_ERROR( "Shouldn't happen!"); + xRet = new Sw3Writer; +} +*/ + +ULONG StgReader::OpenMainStream( SvStorageStreamRef& rRef, USHORT& rBuffSize ) +{ + ULONG nRet = ERR_SWG_READ_ERROR; + ASSERT( pStg, "wo ist mein Storage?" ); + const SfxFilter* pFltr = SwIoSystem::GetFilterOfFormat( aFltName ); + if( pFltr ) + { + rRef = pStg->OpenSotStream( SwIoSystem::GetSubStorageName( *pFltr ), + STREAM_READ | STREAM_SHARE_DENYALL ); + + if( rRef.Is() ) + { + if( SVSTREAM_OK == rRef->GetError() ) + { + USHORT nOld = rRef->GetBufferSize(); + rRef->SetBufferSize( rBuffSize ); + rBuffSize = nOld; + nRet = 0; + } + else + nRet = rRef->GetError(); + } + } + return nRet; +} + +/* */ +/* +ULONG Sw3Reader::Read( SwDoc &rDoc, SwPaM &rPam, const String & ) +{ + ULONG nRet; + if( pStg && pIO ) + { + // TRUE: Vorlagen ueberschreiben + pIO->SetReadOptions( aOpt,TRUE ); + if( !bInsertMode ) + { + // Im Laden-Modus darf der PaM-Content-Teil nicht + // in den Textbereich zeigen (Nodes koennen geloescht werden) + rPam.GetBound( TRUE ).nContent.Assign( 0, 0 ); + rPam.GetBound( FALSE ).nContent.Assign( 0, 0 ); + } + nRet = pIO->Load( pStg, bInsertMode ? &rPam : 0 ); + aOpt.ResetAllFmtsOnly(); + pIO->SetReadOptions( aOpt, TRUE ); + } + else + { + ASSERT( !this, "Sw3-Read ohne Storage und/oder IO-System" ); + nRet = ERR_SWG_READ_ERROR; + } + return nRet; +} + + // read the sections of the document, which is equal to the medium. + // returns the count of it +USHORT Sw3Reader::GetSectionList( SfxMedium& rMedium, + SvStrings& rStrings ) const +{ + SvStorageRef aStg( rMedium.GetStorage() ); + const SfxFilter* pFlt = rMedium.GetFilter(); + ASSERT( pFlt && pFlt->GetVersion(), + "Kein Filter oder Filter ohne FF-Version" ); + if( pFlt && pFlt->GetVersion() ) + aStg->SetVersion( (long)pFlt->GetVersion() ); + + if( pIO ) + pIO->GetSectionList( &aStg, rStrings ); + return rStrings.Count(); + return 0; +} +*/ + +/*ULONG Sw3Writer::WriteStorage() +{ + ULONG nRet; + if( pIO ) + { + // der gleiche Storage -> Save, sonst SaveAs aufrufen + if( !bSaveAs ) + nRet = pIO->Save( pOrigPam, bWriteAll ); + else + nRet = pIO->SaveAs( pStg, pOrigPam, bWriteAll ); + + pIO = 0; // nach dem Schreiben ist der Pointer ungueltig !! + } + else + { + ASSERT( !this, "Sw3-Writer ohne IO-System" ) + nRet = ERR_SWG_WRITE_ERROR; + } + return nRet; +} + +ULONG Sw3Writer::WriteMedium( SfxMedium& ) +{ + DBG_ERROR( "Shouldn't be used currently!"); + return WriteStorage(); +} + +BOOL Sw3Writer::IsSw3Writer() const { return TRUE; } +*/ + +void Writer::SetPasswd( const String& ) {} + + +void Writer::SetVersion( const String&, long ) {} + + +BOOL Writer::IsStgWriter() const { return FALSE; } +//BOOL Writer::IsSw3Writer() const { return FALSE; } + +BOOL StgWriter::IsStgWriter() const { return TRUE; } + +/* */ + + + +BOOL SwReader::NeedsPasswd( const Reader& /*rOptions*/ ) +{ + BOOL bRes = FALSE; + return bRes; +} + + +BOOL SwReader::CheckPasswd( const String& /*rPasswd*/, const Reader& /*rOptions*/ ) +{ + return TRUE; +} + + +/* */ + +//----------------------------------------------------------------------- +// Filter Flags lesen, wird von WW8 / W4W / EXCEL / LOTUS benutzt. +//----------------------------------------------------------------------- + +/* + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + + +*/ + +#define FILTER_OPTION_ROOT String::CreateFromAscii( \ + RTL_CONSTASCII_STRINGPARAM( "Office.Writer/FilterFlags" ) ) + +SwFilterOptions::SwFilterOptions( sal_uInt16 nCnt, const sal_Char** ppNames, + sal_uInt32* pValues ) + : ConfigItem( FILTER_OPTION_ROOT ) +{ + GetValues( nCnt, ppNames, pValues ); +} + +void SwFilterOptions::GetValues( sal_uInt16 nCnt, const sal_Char** ppNames, + sal_uInt32* pValues ) +{ + Sequence aNames( nCnt ); + OUString* pNames = aNames.getArray(); + USHORT n; + + for( n = 0; n < nCnt; ++n ) + pNames[ n ] = OUString::createFromAscii( ppNames[ n ] ); + Sequence aValues = GetProperties( aNames ); + + if( nCnt == aValues.getLength() ) + { + const Any* pAnyValues = aValues.getConstArray(); + for( n = 0; n < nCnt; ++n ) + pValues[ n ] = pAnyValues[ n ].hasValue() + ? *(sal_uInt32*)pAnyValues[ n ].getValue() + : 0; + } + else + for( n = 0; n < nCnt; ++n ) + pValues[ n ] = 0; +} + +void SwFilterOptions::Commit() {} +void SwFilterOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + +/* */ + + +void StgReader::SetFltName( const String& rFltNm ) +{ + if( SW_STORAGE_READER & GetReaderType() ) + aFltName = rFltNm; +} + + +/* */ + +SwRelNumRuleSpaces::SwRelNumRuleSpaces( SwDoc& rDoc, BOOL bNDoc ) + : bNewDoc( bNDoc ) +{ + pNumRuleTbl = new SwNumRuleTbl( 8, 8 ); + if( !bNDoc ) + pNumRuleTbl->Insert( &rDoc.GetNumRuleTbl(), 0 ); +} + +SwRelNumRuleSpaces::~SwRelNumRuleSpaces() +{ + if( pNumRuleTbl ) + { + pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); + delete pNumRuleTbl; + } +} + +void SwRelNumRuleSpaces::SetNumRelSpaces( SwDoc& rDoc ) +{ + const SwNumRuleTbl* pRuleTbl = NULL; + + if( !bNewDoc ) + { + // jetzt alle schon vorhanden NumRules aus dem Array entfernen, + // damit nur die neuen angepasst werden + SwNumRuleTbl aNumRuleTbl; + aNumRuleTbl.Insert( pNumRuleTbl, 0 ); + pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); + const SwNumRuleTbl& rRuleTbl = rDoc.GetNumRuleTbl(); + SwNumRule* pRule; + + for( USHORT n = 0; n < rRuleTbl.Count(); ++n ) + if( USHRT_MAX == aNumRuleTbl.GetPos( ( pRule = rRuleTbl[ n ] ))) + // war noch nicht vorhanden, also neu + pNumRuleTbl->Insert( pRule, pNumRuleTbl->Count() ); + + aNumRuleTbl.Remove( 0, aNumRuleTbl.Count() ); + + pRuleTbl = pNumRuleTbl; + } + else + { + pRuleTbl = &rDoc.GetNumRuleTbl(); + } + + if( pRuleTbl ) + { + for( USHORT n = pRuleTbl->Count(); n; ) + { + SwNumRule* pRule = (*pRuleTbl)[ --n ]; + // Rule noch gueltig und am Doc vorhanden? + if( USHRT_MAX != rDoc.GetNumRuleTbl().GetPos( pRule )) + { + // --> OD 2008-02-19 #refactorlists# +// SwNumRuleInfo aUpd( pRule->GetName() ); +// aUpd.MakeList( rDoc ); + +// // bei allen nmumerierten Absaetzen vom linken Rand +// // den absoluten Wert des NumFormates abziehen +// for( ULONG nUpdPos = 0; nUpdPos < aUpd.GetList().Count(); +// ++nUpdPos ) +// { +// SwTxtNode* pNd = aUpd.GetList().GetObject( nUpdPos ); +// SetNumLSpace( *pNd, *pRule ); +// } + SwNumRule::tTxtNodeList aTxtNodeList; + pRule->GetTxtNodeList( aTxtNodeList ); + for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin(); + aIter != aTxtNodeList.end(); ++aIter ) + { + SwTxtNode* pNd = *aIter; + SetNumLSpace( *pNd, *pRule ); + } + // <-- + } + } + } + + if( pNumRuleTbl ) + { + pNumRuleTbl->Remove( 0, pNumRuleTbl->Count() ); + delete pNumRuleTbl, pNumRuleTbl = 0; + } + + if( bNewDoc ) + { + SetOultineRelSpaces( SwNodeIndex( rDoc.GetNodes() ), + SwNodeIndex( rDoc.GetNodes().GetEndOfContent())); + } +} + +void SwRelNumRuleSpaces::SetOultineRelSpaces( const SwNodeIndex& rStt, + const SwNodeIndex& rEnd ) +{ + SwDoc* pDoc = rStt.GetNode().GetDoc(); + const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); + if( rOutlNds.Count() ) + { + USHORT nPos; + rOutlNds.Seek_Entry( &rStt.GetNode(), &nPos ); + for( ; nPos < rOutlNds.Count() && + rOutlNds[ nPos ]->GetIndex() < rEnd.GetIndex(); ++nPos ) + { + SwTxtNode* pNd = rOutlNds[ nPos ]->GetTxtNode(); + if( pNd->IsOutline() && !pNd->GetNumRule() ) + SetNumLSpace( *pNd, *pDoc->GetOutlineNumRule() ); + } + } +} + +void SwRelNumRuleSpaces::SetNumLSpace( SwTxtNode& rNd, const SwNumRule& rRule ) +{ + BOOL bOutlineRule = OUTLINE_RULE == rRule.GetRuleType(); + // --> OD 2005-11-18 #128056# + // correction of refactoring done by cws swnumtree: + // - assure a correct level for retrieving numbering format. +// BYTE nLvl = rNd.GetLevel(); + BYTE nLvl = 0; + if ( rNd.GetActualListLevel() >= 0 && rNd.GetActualListLevel() < MAXLEVEL ) + { + nLvl = static_cast< BYTE >(rNd.GetActualListLevel()); + } + // <-- + const SwNumFmt& rFmt = rRule.Get( nLvl ); + const SvxLRSpaceItem& rLR = rNd.GetSwAttrSet().GetLRSpace(); + + SvxLRSpaceItem aLR( rLR ); + aLR.SetTxtFirstLineOfst( 0 ); + + // sagt der Node, das die Numerierung den Wert vorgibt? + if( !bOutlineRule && rNd.IsSetNumLSpace() ) + aLR.SetTxtLeft( 0 ); + else + { + long nLeft = rFmt.GetAbsLSpace(), nParaLeft = rLR.GetTxtLeft(); + if( 0 < rLR.GetTxtFirstLineOfst() ) + nParaLeft += rLR.GetTxtFirstLineOfst(); + else if( nParaLeft >= nLeft ) + // #82963#/#82962#: set correct paragraph indent + nParaLeft -= nLeft; + else + //#83154#, Don't think any of the older #80856# bugfix code is + //relevent anymore. + nParaLeft = rLR.GetTxtLeft()+rLR.GetTxtFirstLineOfst(); + aLR.SetTxtLeft( nParaLeft ); + } + + if( aLR.GetTxtLeft() != rLR.GetTxtLeft() ) + { + //bevor rLR geloescht wird! + long nOffset = rLR.GetTxtLeft() - aLR.GetTxtLeft(); + rNd.SetAttr( aLR ); + + // Tabs anpassen !! + const SfxPoolItem* pItem; + if( SFX_ITEM_SET == rNd.GetSwAttrSet().GetItemState( + RES_PARATR_TABSTOP, TRUE, &pItem )) + { + SvxTabStopItem aTStop( *(SvxTabStopItem*)pItem ); + for( USHORT n = 0; n < aTStop.Count(); ++n ) + { + SvxTabStop& rTab = (SvxTabStop&)aTStop[ n ]; + if( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() ) + { + if( !rTab.GetTabPos() ) + { + aTStop.Remove( n ); + --n; + } + else + rTab.GetTabPos() += nOffset; + } + } + rNd.SetAttr( aTStop ); + } + } +} + +/* */ + + +void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, + SwTwips nPageWidth) +{ + const SfxPoolItem* pItem = 0; + if( SFX_ITEM_SET != rFlySet.GetItemState( RES_FRM_SIZE, TRUE, &pItem ) || + MINFLY > ((SwFmtFrmSize*)pItem)->GetWidth() ) + { + SwFmtFrmSize aSz((SwFmtFrmSize&)rFlySet.Get(RES_FRM_SIZE, TRUE)); + if (pItem) + aSz = (SwFmtFrmSize&)(*pItem); + + SwTwips nWidth; + // dann die Breite des Flys selbst bestimmen. Ist eine Tabelle + // defininiert, dann benutze deren Breite, sonst die Breite der + // Seite + const SwTableNode* pTblNd = rAnchor.GetNode().FindTableNode(); + if( pTblNd ) + nWidth = pTblNd->GetTable().GetFrmFmt()->GetFrmSize().GetWidth(); + else + nWidth = nPageWidth; + + const SwNodeIndex* pSttNd = ((SwFmtCntnt&)rFlySet.Get( RES_CNTNT )). + GetCntntIdx(); + if( pSttNd ) + { + BOOL bOnlyOneNode = TRUE; + ULONG nMinFrm = 0; + ULONG nMaxFrm = 0; + SwTxtNode* pFirstTxtNd = 0; + SwNodeIndex aIdx( *pSttNd, 1 ); + SwNodeIndex aEnd( *pSttNd->GetNode().EndOfSectionNode() ); + while( aIdx < aEnd ) + { + SwTxtNode *pTxtNd = aIdx.GetNode().GetTxtNode(); + if( pTxtNd ) + { + if( !pFirstTxtNd ) + pFirstTxtNd = pTxtNd; + else if( pFirstTxtNd != pTxtNd ) + { + // forget it + bOnlyOneNode = FALSE; + break; + } + + ULONG nAbsMinCnts; + pTxtNd->GetMinMaxSize( aIdx.GetIndex(), nMinFrm, + nMaxFrm, nAbsMinCnts ); + } + aIdx++; + } + + if( bOnlyOneNode ) + { + if( nMinFrm < MINLAY && pFirstTxtNd ) + { + // if the first node dont contained any content, then + // insert one char in it calc again and delete once again + SwIndex aNdIdx( pFirstTxtNd ); + pFirstTxtNd->InsertText( String::CreateFromAscii( + RTL_CONSTASCII_STRINGPARAM( "MM" )), aNdIdx ); + ULONG nAbsMinCnts; + pFirstTxtNd->GetMinMaxSize( pFirstTxtNd->GetIndex(), + nMinFrm, nMaxFrm, nAbsMinCnts ); + aNdIdx -= 2; + pFirstTxtNd->EraseText( aNdIdx, 2 ); + } + + // Umrandung und Abstand zum Inhalt beachten + const SvxBoxItem& rBoxItem = (SvxBoxItem&)rFlySet.Get( RES_BOX ); + USHORT nLine = BOX_LINE_LEFT; + for( int i = 0; i < 2; ++i ) + { + const SvxBorderLine* pLn = rBoxItem.GetLine( nLine ); + if( pLn ) + { + USHORT nWidthTmp = pLn->GetOutWidth() + pLn->GetInWidth(); + nWidthTmp = nWidthTmp + rBoxItem.GetDistance( nLine ); + nMinFrm += nWidthTmp; + nMaxFrm += nWidthTmp; + } + nLine = BOX_LINE_RIGHT; + } + + // Mindestbreite fuer Inhalt einhalten + if( nMinFrm < MINLAY ) + nMinFrm = MINLAY; + if( nMaxFrm < MINLAY ) + nMaxFrm = MINLAY; + + if( nWidth > (USHORT)nMaxFrm ) + nWidth = nMaxFrm; + else if( nWidth > (USHORT)nMinFrm ) + nWidth = nMinFrm; + } + } + + if( MINFLY > nWidth ) + nWidth = MINFLY; + + aSz.SetWidth( nWidth ); + if( MINFLY > aSz.GetHeight() ) + aSz.SetHeight( MINFLY ); + rFlySet.Put( aSz ); + } + else if( MINFLY > ((SwFmtFrmSize*)pItem)->GetHeight() ) + { + SwFmtFrmSize aSz( *(SwFmtFrmSize*)pItem ); + aSz.SetHeight( MINFLY ); + rFlySet.Put( aSz ); + } +} + +/* */ +struct CharSetNameMap +{ + rtl_TextEncoding eCode; + const sal_Char* pName; +}; + +const CharSetNameMap *GetCharSetNameMap() +{ + static const CharSetNameMap aMapArr[] = + { +# define IMPLENTRY(X) { RTL_TEXTENCODING_##X, "" #X "" } + IMPLENTRY(DONTKNOW), + IMPLENTRY(MS_1252), + IMPLENTRY(APPLE_ROMAN), + IMPLENTRY(IBM_437), + IMPLENTRY(IBM_850), + IMPLENTRY(IBM_860), + IMPLENTRY(IBM_861), + IMPLENTRY(IBM_863), + IMPLENTRY(IBM_865), + IMPLENTRY(SYMBOL), + IMPLENTRY(ASCII_US), + IMPLENTRY(ISO_8859_1), + IMPLENTRY(ISO_8859_2), + IMPLENTRY(ISO_8859_3), + IMPLENTRY(ISO_8859_4), + IMPLENTRY(ISO_8859_5), + IMPLENTRY(ISO_8859_6), + IMPLENTRY(ISO_8859_7), + IMPLENTRY(ISO_8859_8), + IMPLENTRY(ISO_8859_9), + IMPLENTRY(ISO_8859_14), + IMPLENTRY(ISO_8859_15), + IMPLENTRY(IBM_737), + IMPLENTRY(IBM_775), + IMPLENTRY(IBM_852), + IMPLENTRY(IBM_855), + IMPLENTRY(IBM_857), + IMPLENTRY(IBM_862), + IMPLENTRY(IBM_864), + IMPLENTRY(IBM_866), + IMPLENTRY(IBM_869), + IMPLENTRY(MS_874), + IMPLENTRY(MS_1250), + IMPLENTRY(MS_1251), + IMPLENTRY(MS_1253), + IMPLENTRY(MS_1254), + IMPLENTRY(MS_1255), + IMPLENTRY(MS_1256), + IMPLENTRY(MS_1257), + IMPLENTRY(MS_1258), + IMPLENTRY(APPLE_ARABIC), + IMPLENTRY(APPLE_CENTEURO), + IMPLENTRY(APPLE_CROATIAN), + IMPLENTRY(APPLE_CYRILLIC), + IMPLENTRY(APPLE_DEVANAGARI), + IMPLENTRY(APPLE_FARSI), + IMPLENTRY(APPLE_GREEK), + IMPLENTRY(APPLE_GUJARATI), + IMPLENTRY(APPLE_GURMUKHI), + IMPLENTRY(APPLE_HEBREW), + IMPLENTRY(APPLE_ICELAND), + IMPLENTRY(APPLE_ROMANIAN), + IMPLENTRY(APPLE_THAI), + IMPLENTRY(APPLE_TURKISH), + IMPLENTRY(APPLE_UKRAINIAN), + IMPLENTRY(APPLE_CHINSIMP), + IMPLENTRY(APPLE_CHINTRAD), + IMPLENTRY(APPLE_JAPANESE), + IMPLENTRY(APPLE_KOREAN), + IMPLENTRY(MS_932), + IMPLENTRY(MS_936), + IMPLENTRY(MS_949), + IMPLENTRY(MS_950), + IMPLENTRY(SHIFT_JIS), + IMPLENTRY(GB_2312), + IMPLENTRY(GBT_12345), + IMPLENTRY(GBK), + IMPLENTRY(BIG5), + IMPLENTRY(EUC_JP), + IMPLENTRY(EUC_CN), + IMPLENTRY(EUC_TW), + IMPLENTRY(ISO_2022_JP), + IMPLENTRY(ISO_2022_CN), + IMPLENTRY(KOI8_R), + IMPLENTRY(KOI8_U), + IMPLENTRY(UTF7), + IMPLENTRY(UTF8), + IMPLENTRY(ISO_8859_10), + IMPLENTRY(ISO_8859_13), + IMPLENTRY(EUC_KR), + IMPLENTRY(ISO_2022_KR), + IMPLENTRY(JIS_X_0201), + IMPLENTRY(JIS_X_0208), + IMPLENTRY(JIS_X_0212), + IMPLENTRY(MS_1361), + IMPLENTRY(GB_18030), + IMPLENTRY(BIG5_HKSCS), + IMPLENTRY(TIS_620), + IMPLENTRY(PT154), + IMPLENTRY(UCS4), + IMPLENTRY(UCS2), + IMPLENTRY(UNICODE), + {0,0} //Last + }; + return &aMapArr[0]; +} +/* + Get a rtl_TextEncoding from its name + */ +rtl_TextEncoding CharSetFromName(const String& rChrSetStr) +{ + const CharSetNameMap *pStart = GetCharSetNameMap(); + rtl_TextEncoding nRet = pStart->eCode; + + for(const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap) + { + if(rChrSetStr.EqualsIgnoreCaseAscii(pMap->pName)) + { + nRet = pMap->eCode; + break; + } + } + + ASSERT(nRet != pStart->eCode, "TXT: That was an unknown language!"); + + return nRet; +} + + +/* + Get the String name of an rtl_TextEncoding + */ +String NameFromCharSet(rtl_TextEncoding nChrSet) +{ + const CharSetNameMap *pStart = GetCharSetNameMap(); + const char *pRet = pStart->pName; + + for(const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap) + { + if (nChrSet == pMap->eCode) + { + pRet = pMap->pName; + break; + } + } + + ASSERT(pRet != pStart->pName, "TXT: That was an unknown language!"); + + return String::CreateFromAscii(pRet); +} + +// for the automatic conversion (mail/news/...) +// The user data contains the options for the ascii import/export filter. +// The format is: +// 1. CharSet - as ascii chars +// 2. LineEnd - as CR/LR/CRLF +// 3. Fontname +// 4. Language +// the delimetercharacter is "," +// + +void SwAsciiOptions::ReadUserData( const String& rStr ) +{ + xub_StrLen nToken = 0; + USHORT nCnt = 0; + String sToken; + do { + if( 0 != (sToken = rStr.GetToken( 0, ',', nToken )).Len() ) + { + switch( nCnt ) + { + case 0: // CharSet + eCharSet = CharSetFromName(sToken); + break; + case 1: // LineEnd + if( sToken.EqualsIgnoreCaseAscii( "CRLF" )) + eCRLF_Flag = LINEEND_CRLF; + else if( sToken.EqualsIgnoreCaseAscii( "LF" )) + eCRLF_Flag = LINEEND_LF; + else + eCRLF_Flag = LINEEND_CR; + break; + case 2: // fontname + sFont = sToken; + break; + case 3: // Language + nLanguage = MsLangId::convertIsoStringToLanguage( sToken ); + break; + } + } + ++nCnt; + } while( STRING_NOTFOUND != nToken ); +} + +void SwAsciiOptions::WriteUserData( String& rStr ) +{ + // 1. charset + rStr = NameFromCharSet(eCharSet); + rStr += ','; + + // 2. LineEnd + switch(eCRLF_Flag) + { + case LINEEND_CRLF: + rStr.AppendAscii( "CRLF" ); + break; + case LINEEND_CR: + rStr.AppendAscii( "CR" ); + break; + case LINEEND_LF: + rStr.AppendAscii( "LF" ); + break; + } + rStr += ','; + + // 3. Fontname + rStr += sFont; + rStr += ','; + + // 4. Language + if (nLanguage) + { + rtl::OUString sTmp = MsLangId::convertLanguageToIsoString( nLanguage ); + rStr += (String)sTmp; + } + rStr += ','; +} + +extern "C" { static void SAL_CALL thisModule() {} } + +static oslGenericFunction GetMswordLibSymbol( const char *pSymbol ) +{ + static ::osl::Module aModule; + static sal_Bool bLoaded = sal_False; + static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "msword" ) ) ); + if (!bLoaded) + bLoaded = SvLibrary::LoadModule( aModule, aLibName, &thisModule ); + if (bLoaded) + return aModule.getFunctionSymbol( ::rtl::OUString::createFromAscii( pSymbol ) ); + return NULL; +} + +Reader* GetRTFReader() +{ + FnGetReader pFunction = reinterpret_cast( GetMswordLibSymbol( "ImportRTF" ) ); + + if ( pFunction ) + return (*pFunction)(); + + return NULL; +} + +void GetRTFWriter( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) +{ + FnGetWriter pFunction = reinterpret_cast( GetMswordLibSymbol( "ExportRTF" ) ); + + if ( pFunction ) + (*pFunction)( rFltName, rBaseURL, xRet ); + else + xRet = WriterRef(0); +} + +Reader* GetWW8Reader() +{ + FnGetReader pFunction = reinterpret_cast( GetMswordLibSymbol( "ImportDOC" ) ); + + if ( pFunction ) + return (*pFunction)(); + + return NULL; +} + +void GetWW8Writer( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) +{ + FnGetWriter pFunction = reinterpret_cast( GetMswordLibSymbol( "ExportDOC" ) ); + + if ( pFunction ) + (*pFunction)( rFltName, rBaseURL, xRet ); + else + xRet = WriterRef(0); +} + +typedef ULONG ( __LOADONCALLAPI *SaveOrDel )( SfxObjectShell&, SotStorage&, BOOL, const String& ); +typedef ULONG ( __LOADONCALLAPI *GetSaveWarning )( SfxObjectShell& ); + +ULONG SaveOrDelMSVBAStorage( SfxObjectShell& rDoc, SotStorage& rStor, BOOL bSaveInto, const String& rStorageName ) +{ + SaveOrDel pFunction = reinterpret_cast( GetMswordLibSymbol( "SaveOrDelMSVBAStorage_ww8" ) ); + if( pFunction ) + return pFunction( rDoc, rStor, bSaveInto, rStorageName ); + return ERRCODE_NONE; +} + +ULONG GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ) +{ + GetSaveWarning pFunction = reinterpret_cast( GetMswordLibSymbol( "GetSaveWarningOfMSVBAStorage_ww8" ) ); + if( pFunction ) + return pFunction( rDocS ); + return ERRCODE_NONE; +} + + -- cgit v1.2.3 From 580c6ffaacd9d60fef0bd367f60185624a51ea7d Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 15 Jun 2010 21:01:57 +0200 Subject: tl78v2: #i112427# Support password to modify in calc and writer ODF documents --- sw/source/ui/uno/SwXDocumentSettings.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'sw/source') diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 59fbcef91f..3a1a17d98a 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -124,6 +124,7 @@ enum SwDocumentSettingsPropertyHandles // --> OD 2008-06-05 #i89181# HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- + HANDLE_MODIFYPASSWORDINFO }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -177,6 +178,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0}, // --> OD 2008-06-05 #i89181# { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -671,6 +673,21 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf } break; // <-- + case HANDLE_MODIFYPASSWORDINFO: + { + uno::Sequence< beans::PropertyValue > aInfo; + if ( !( rValue >>= aInfo ) ) + throw lang::IllegalArgumentException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value of type Sequence expected!" ) ), + uno::Reference< uno::XInterface >(), + 2 ); + + if ( !mpDocSh->SetModifyPasswordInfo( aInfo ) ) + throw beans::PropertyVetoException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The hash is not allowed to be changed now!" ) ), + uno::Reference< uno::XInterface >() ); + } + break; default: throw UnknownPropertyException(); } @@ -998,6 +1015,10 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf } break; // <-- + case HANDLE_MODIFYPASSWORDINFO: + { + rValue <<= mpDocSh->GetModifyPasswordInfo(); + } default: throw UnknownPropertyException(); -- cgit v1.2.3 From 914e5a436986e1f012a23e8bbff84bc72ceacdeb Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 16 Jun 2010 10:36:38 +0200 Subject: tl78v2: #i112427# Support password to modify in calc and writer ODF documents --- sw/source/ui/uno/SwXDocumentSettings.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sw/source') diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 3a1a17d98a..cbfe8617ad 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -1019,6 +1019,7 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf { rValue <<= mpDocSh->GetModifyPasswordInfo(); } + break; default: throw UnknownPropertyException(); -- cgit v1.2.3 From 01ede6790d338aa2b10327a0691f2bb168d53312 Mon Sep 17 00:00:00 2001 From: Ruediger Timm Date: Thu, 24 Jun 2010 10:49:45 +0200 Subject: masterfix: #i10000# Merge error corrected. --- sw/source/filter/ww8/wrtww8.cxx | 1 - 1 file changed, 1 deletion(-) mode change 100755 => 100644 sw/source/filter/ww8/wrtww8.cxx (limited to 'sw/source') diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx old mode 100755 new mode 100644 index 1e2f960cc3..f541d57b93 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2491,7 +2491,6 @@ void MSWordExportBase::WriteText() // This piece of code always breaks builds... #if 0 #ifdef DEBUG -#if 0 if (aNodeSet.find(pNd) == aNodeSet.end()) { aNodeSet.insert(pNd); -- cgit v1.2.3