From 073fdc20778aa6a6f78405f37270903890643a62 Mon Sep 17 00:00:00 2001 From: os Date: Mon, 20 Dec 2010 12:00:37 +0100 Subject: #i102247# re-introduce export of outline --- sw/source/filter/ww8/rtfexport.cxx | 8 ++++++-- sw/source/filter/ww8/wrtw8nds.cxx | 8 ++++++-- sw/source/filter/ww8/wrtww8.cxx | 1 + sw/source/filter/ww8/wrtww8.hxx | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index f899d2160e86..754c48a4f2f1 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1243,16 +1243,19 @@ void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_ class SwRTFWriter : public Writer { - public: + bool m_bOutOutlineOnly; + public: SwRTFWriter( const String& rFilterName, const String& rBaseURL ); virtual ~SwRTFWriter(); virtual ULONG WriteStream(); }; -SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL ) +SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL ) { OSL_TRACE("%s", OSL_THIS_FUNC); SetBaseURL( rBaseURL ); + // export outline nodes, only (send outline to clipboard/presentation) + m_bOutOutlineOnly = 'O' == rFltName.GetChar( 0 ); } SwRTFWriter::~SwRTFWriter() @@ -1262,6 +1265,7 @@ ULONG SwRTFWriter::WriteStream() { OSL_TRACE("%s", OSL_THIS_FUNC); RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this ); + aExport.mbOutOutlineOnly = m_bOutOutlineOnly; aExport.ExportDocument( true ); return 0; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 7b97b2fbdbc0..e4cafdc01461 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2837,8 +2837,12 @@ void MSWordExportBase::OutputContentNode( const SwCntntNode& rNode ) switch ( rNode.GetNodeType() ) { case ND_TEXTNODE: - OutputTextNode( *rNode.GetTxtNode() ); - break; + { + const SwTxtNode& rTextNode = *rNode.GetTxtNode(); + if( !mbOutOutlineOnly || rTextNode.IsOutline() ) + OutputTextNode( rTextNode ); + } + break; case ND_GRFNODE: OutputGrfNode( *rNode.GetGrfNode() ); break; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 5c82f67a32f1..1827e1eba4a4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3389,6 +3389,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM pStyles( NULL ), bHasHdr(false), bHasFtr(false), bSubstituteBullets(true), mbExportModeRTF( false ), + mbOutOutlineOnly( false ), pDoc( pDocument ), pCurPam( pCurrentPam ), pOrigPam( pOriginalPam ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index a4ab2c69aaa8..0a6dfb6abbb6 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -554,6 +554,7 @@ public: BYTE bSubstituteBullets : 1; // true: SubstituteBullet() gets called bool mbExportModeRTF; + bool mbOutOutlineOnly; // export outline nodes, only (send outline to clipboard/presentation) SwDoc *pDoc; SwPaM *pCurPam, *pOrigPam; -- cgit v1.2.3 From 62317e72f4883015ccf46fcb01f9e1585a5929f4 Mon Sep 17 00:00:00 2001 From: os Date: Tue, 28 Dec 2010 12:04:40 +0100 Subject: #i115916# replacements of one character to multiple characters fixed --- sw/source/core/edit/acorrect.cxx | 20 ++++++++++++++++++-- sw/source/core/inc/acorrect.hxx | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index b7e92570df42..f38b707c26d5 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -153,6 +153,10 @@ BOOL SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt ) BOOL SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt ) +{ + return ReplaceRange( nPos, rTxt.Len(), rTxt ); +} +BOOL SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt ) { SwPaM* pPam = &rCrsr; if( pPam->GetPoint()->nContent.GetIndex() != nPos ) @@ -201,14 +205,26 @@ BOOL SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt ) pPam->SetMark(); pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(), - xub_StrLen( nPos + rTxt.Len() )); + xub_StrLen( nPos + nSourceLength )); pDoc->ReplaceRange( *pPam, rTxt, false ); pPam->Exchange(); pPam->DeleteMark(); } } else - pDoc->Overwrite( *pPam, rTxt ); + { + if( nSourceLength != rTxt.Len() ) + { + pPam->SetMark(); + pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(), + xub_StrLen( nPos + nSourceLength )); + pDoc->ReplaceRange( *pPam, rTxt, false ); + pPam->Exchange(); + pPam->DeleteMark(); + } + else + pDoc->Overwrite( *pPam, rTxt ); + } // pDoc->SetRedlineMode_intern( eOld ); if( bUndoIdInitialized ) diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx index bc2d2d4cb1f3..7d50d90e88a6 100644 --- a/sw/source/core/inc/acorrect.hxx +++ b/sw/source/core/inc/acorrect.hxx @@ -68,6 +68,7 @@ public: virtual BOOL Delete( xub_StrLen nStt, xub_StrLen nEnd ); virtual BOOL Insert( xub_StrLen nPos, const String& rTxt ); virtual BOOL Replace( xub_StrLen nPos, const String& rTxt ); + virtual BOOL ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ); virtual BOOL SetAttr( xub_StrLen nStt, xub_StrLen nEnd, USHORT nSlotId, SfxPoolItem& ); -- cgit v1.2.3 From 464ff123b7bea92e8434a534cc16bd78141a9da6 Mon Sep 17 00:00:00 2001 From: os Date: Tue, 28 Dec 2010 12:53:19 +0100 Subject: #i116193# loop in iteration over bookmarks and attriubtes fixed --- sw/source/filter/ww8/wrtw8nds.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index e4cafdc01461..c1c63215e317 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1650,12 +1650,13 @@ xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& { // Get the bookmarks for the normal run xub_StrLen nNextPos = aAttrIter->WhereNext(); - - GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos ); - xub_StrLen nNextBookmark = nNextPos; - NearestBookmark( nNextPos, nAktPos, false ); + if( nNextBookmark > nAktPos )//no need to search for bookmarks otherwise + { + GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos ); + NearestBookmark( nNextBookmark, nAktPos, false ); + } return std::min( nNextPos, nNextBookmark ); } @@ -1663,9 +1664,9 @@ void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos { xub_StrLen nNextPos; - // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position + // go to next attribute if no bookmark is found and if the next attribute position if at the current position bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true ); - if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() ) + if( !bNextBookmark && nAktPos >= aAttrIter->WhereNext() ) aAttrIter->NextPos(); } -- cgit v1.2.3 From 49e2d2c381f2e4ced9e74614bcef60981e8c453b Mon Sep 17 00:00:00 2001 From: os Date: Wed, 29 Dec 2010 15:01:44 +0100 Subject: #i113790# timer activation of page field bound to up and down, only --- sw/source/ui/utlui/navipi.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 25633a7b691f..9b77ddcc4daf 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -807,7 +807,8 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, &aContentToolBox, SW_RES(NF_PAGE )); pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction)); pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus)); - pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); + pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); + pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); bPageCtrlsVisible = TRUE; -- cgit v1.2.3 From 72734ea38f49533da6ae1f5d63b393b9608d13bc Mon Sep 17 00:00:00 2001 From: os Date: Thu, 30 Dec 2010 09:18:24 +0100 Subject: #i114411# enable 'from top' distance also in frame styles --- sw/source/ui/frmdlg/frmpage.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index c1747efaa962..bcb15ec630a7 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1271,7 +1271,7 @@ void SwFrmPage::InitPos(RndStdIds eId, aAtHorzPosFT.Enable( bEnable ); aAtHorzPosED.Enable( bEnable ); - bEnable = nV == text::VertOrientation::NONE && !bFormat; + bEnable = nV == text::VertOrientation::NONE; if ( !bEnable ) { aAtVertPosED.SetValue( 0, FUNIT_TWIP ); -- cgit v1.2.3 From ddb95ff3861e3d46e840bb8c83f746754f179072 Mon Sep 17 00:00:00 2001 From: os Date: Thu, 30 Dec 2010 11:22:06 +0100 Subject: #i116258# auto delete temporary SwCursor* --- sw/source/core/crsr/swcrsr.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 7637df0a67b4..c9c52193cdd9 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -973,7 +973,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas, { // Cursor als Kopie vom akt. und in den Ring aufnehmen // Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts - SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr + std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor // wenn schon ausserhalb vom Bodytext, suche von der Position, // ansonsten beginne mit der 1. GrundSection @@ -1005,7 +1005,6 @@ ULONG SwCursor::FindAll( SwFindParas& rParas, return 0; } - delete pSav; if( !( FND_IN_SELALL & eFndRngs )) { // es sollte nur einer gesucht werden, also fuege in dazu @@ -1031,7 +1030,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas, } else if( FND_IN_SELALL & eFndRngs ) { - SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr + ::std::auto_ptr< SwCursor> pSav( Create( this ) ); // save the current cursor const SwNode* pSttNd = ( FND_IN_BODYONLY & eFndRngs ) ? rNds.GetEndOfContent().StartOfSectionNode() @@ -1058,9 +1057,6 @@ ULONG SwCursor::FindAll( SwFindParas& rParas, DeleteMark(); return 0; } - // es wurde ein- bis mehrmals gefunden. Das steht alles - // im neuen Crsr-Ring. Darum hebe erstmal den alten Ring auf - delete pSav; while( GetNext() != this ) delete GetNext(); -- cgit v1.2.3