diff options
Diffstat (limited to 'sw/source')
70 files changed, 567 insertions, 865 deletions
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index 4d5f06ff0b8f..05c30aa97f5b 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -127,19 +127,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 705e0026b767..c2a6d011be85 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -259,12 +259,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 64bd308fbbd6..807070a6573d 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -90,7 +90,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 9af115269cd8..9cf698a3a709 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3303,19 +3303,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/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx index 85ff12b699e6..53790c2ac28f 100644 --- a/sw/source/core/crsr/crstrvl1.cxx +++ b/sw/source/core/crsr/crstrvl1.cxx @@ -98,4 +98,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 5b381cbaaad2..7637df0a67b4 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/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 16bf730b33a7..214700c5e680 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -666,16 +666,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/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index fe4044dd58ac..1b3d5fe6eb55 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1084,14 +1084,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, @@ -1120,143 +1116,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 sfx2::LinkManager( 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 ; @@ -1286,92 +1147,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 <IsOldNumbering()> - 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/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index d2c979535dbb..1d387df76063 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -2061,11 +2061,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. diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 02dc1de62901..d99293071048 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/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 0c9f8f2980bf..1d76dce43117 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -173,22 +173,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 SwAnnotationItem::GetAnchorPosition() const { SwTxtFld* pFld = pFmtFld->GetTxtFld(); diff --git a/sw/source/core/inc/SwGrammarMarkUp.hxx b/sw/source/core/inc/SwGrammarMarkUp.hxx index ed3884a767f4..393c917bfc45 100644 --- a/sw/source/core/inc/SwGrammarMarkUp.hxx +++ b/sw/source/core/inc/SwGrammarMarkUp.hxx @@ -69,8 +69,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/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx index 69c77ad77226..a12693b8f72a 100644 --- a/sw/source/core/swg/SwXMLSectionList.cxx +++ b/sw/source/core/swg/SwXMLSectionList.cxx @@ -68,18 +68,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; diff --git a/sw/source/core/text/SwGrammarMarkUp.cxx b/sw/source/core/text/SwGrammarMarkUp.cxx index 535e619e2708..cddf4519fd50 100644 --- a/sw/source/core/text/SwGrammarMarkUp.cxx +++ b/sw/source/core/text/SwGrammarMarkUp.cxx @@ -136,21 +136,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 ffcf4b53afbd..1fe2c363d70e 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1139,7 +1139,6 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, sal_Bool bScript ) const } } - void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const { SwRect aIntersect; @@ -1169,7 +1168,6 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) pOut->Pop(); } } - /************************************************************************* * SwTxtPaintInfo::DrawBackGround() *************************************************************************/ diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index c0643653a1d6..382c58a6f5c6 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -474,7 +474,7 @@ public: inline void DrawBackBrush( const SwLinePortion &rPor ) const { /* if( pFnt->GetBackColor() ) */ _DrawBackBrush( rPor ); } - void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const; + void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const; 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 0d34140d4058..dd2c1c3a1d38 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/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 5c1598c4db0b..0fd88876532b 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 { @@ -189,13 +194,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; // <-- diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx index 04f7ce596346..b86bdad692ac 100644 --- a/sw/source/core/undo/unbkmk.cxx +++ b/sw/source/core/undo/unbkmk.cxx @@ -88,23 +88,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 646ffbd4c8f2..dd95d06a34b1 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -164,21 +164,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 06bee956f95a..4c5fbca4085c 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -354,13 +354,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 bf1df93d5d16..b7098710802b 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -494,6 +494,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------------------- @@ -3318,7 +3352,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 @@ -3326,9 +3360,9 @@ 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 = rBoxes[rBoxes.Count() -1]; + + + const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); pUnoCrsr->SetMark(); pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd(); pUnoCrsr->Move( fnMoveForward, fnGoNode ); @@ -3514,7 +3548,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 @@ -3522,11 +3556,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<SwUnoTableCrsr*>(pUnoCrsr); pCrsr->MakeBoxSels(); @@ -4448,41 +4482,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<SwUnoTableCrsr*>(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 156447fda9da..0bbfc70d5a22 100755..100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -860,21 +860,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 5a5e7a65e0a7..e83ab108bbc9 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -1599,79 +1599,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/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx index 34fe44eae053..8e17bee3874b 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 ) @@ -1302,6 +1299,7 @@ void SwRTFWriter::OutBookmarks( xub_StrLen nCntntPos) OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKEND ) << ' '; { + ::rtl::OUString aEmpty; ::rtl::OUString & rBookmarkName = aEmpty; if (pAsBookmark) diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 4bee56fa12ef..8ca7c8d71571 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -53,6 +53,7 @@ WW8TableNodeInfoInner::WW8TableNodeInfoInner(WW8TableNodeInfo * pParent) , mnShadowsAfter(0) , mbEndOfLine(false) , mbEndOfCell(false) +, mbFirstInTable(false) , mbVertMerge(false) , mpTableBox(NULL) , mpTable(NULL) @@ -98,7 +99,13 @@ void WW8TableNodeInfoInner::setEndOfCell(bool bEndOfCell) mbEndOfCell = bEndOfCell; } +void WW8TableNodeInfoInner::setFirstInTable(bool bFirstInTable) +{ + mbFirstInTable = bFirstInTable; +} + void WW8TableNodeInfoInner::setVertMerge(bool bVertMerge) + { mbVertMerge = bVertMerge; } @@ -153,6 +160,11 @@ bool WW8TableNodeInfoInner::isEndOfLine() const return mbEndOfLine; } +bool WW8TableNodeInfoInner::isFirstInTable() const +{ + return mbFirstInTable; +} + const SwNode * WW8TableNodeInfoInner::getNode() const { const SwNode * pResult = NULL; @@ -320,7 +332,6 @@ string WW8TableNodeInfoInner::toString() const return string(buffer); } - // WW8TableTextNodeInfo WW8TableNodeInfo::WW8TableNodeInfo(WW8TableInfo * pParent, @@ -356,16 +367,13 @@ WW8TableNodeInfo::~WW8TableNodeInfo() aIt++; } - #ifdef DEBUG sResult += dbg_out(*mpNode); #endif - sResult += "</tableNodeInfo>"; return sResult; } - void WW8TableNodeInfo::setDepth(sal_uInt32 nDepth) { mnDepth = nDepth; @@ -400,11 +408,25 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell) #endif } +void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable) +{ + WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth); + + pInner->setFirstInTable(bFirstInTable); + +#ifdef DEBUG + ::std::clog << "<firstInTable depth=\"" << mnDepth << "\">" + << toString() << "</firstInTable>" << ::std::endl; +#endif +} + void WW8TableNodeInfo::setVertMerge(bool bVertMerge) { WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth); + pInner->setVertMerge(bVertMerge); + #ifdef DEBUG ::std::clog << "<vertMerge depth=\"" << mnDepth << "\">" << toString() << "</vertMerge>" << ::std::endl; @@ -868,6 +890,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); + } + } + if (pRect) { WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable); diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index 47397310bd2d..b844615fecad 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -67,6 +67,7 @@ class WW8TableNodeInfoInner sal_uInt32 mnShadowsAfter; bool mbEndOfLine; bool mbEndOfCell; + bool mbFirstInTable; bool mbVertMerge; const SwTableBox * mpTableBox; const SwTable * mpTable; @@ -85,6 +86,7 @@ public: void setShadowsAfter(sal_uInt32 nShadowsAfter); void setEndOfLine(bool bEndOfLine); void setEndOfCell(bool bEndOfCell); + void setFirstInTable(bool bFirstInTable); void setVertMerge(bool bVertMErge); void setTableBox(const SwTableBox * pTableBox); void setTable(const SwTable * pTable); @@ -97,6 +99,7 @@ public: sal_uInt32 getShadowsAfter() const; bool isEndOfCell() const; bool isEndOfLine() const; + bool isFirstInTable() const; bool isVertMerge() const; const SwTableBox * getTableBox() const; const SwTable * getTable() const; @@ -140,6 +143,7 @@ public: void setDepth(sal_uInt32 nDepth); void setEndOfLine(bool bEndOfLine); void setEndOfCell(bool bEndOfCell); + void setFirstInTable(bool bFirstInTable); void setVertMerge(bool bVertMerge); void setTableBox(const SwTableBox *pTableBox); void setTable(const SwTable * pTable); @@ -155,6 +159,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; @@ -247,11 +252,14 @@ class WW8TableInfo { friend class WW8TableNodeInfoInner; typedef hash_map<const SwNode *, WW8TableNodeInfo::Pointer_t, hashNode > Map_t; - typedef hash_map<const SwTable *, WW8TableCellGrid::Pointer_t, hashTable > CellGridMap_t; - Map_t mMap; + + typedef hash_map<const SwTable *, WW8TableCellGrid::Pointer_t, hashTable > CellGridMap_t; CellGridMap_t mCellGridMap; + typedef hash_map<const SwTable *, const SwNode *, hashTable > FirstInTableMap_t; + FirstInTableMap_t mFirstInTableMap; + WW8TableNodeInfo * processTableLine(const SwTable * pTable, const SwTableLine * pTableLine, @@ -295,6 +303,7 @@ public: WW8TableNodeInfo * processSwTableByLayout(const SwTable * pTable); WW8TableNodeInfo::Pointer_t getTableNodeInfo(const SwNode * pNode); const SwNode * getNextNode(const SwNode * pNode); + const WW8TableNodeInfo * getFirstTableNodeInfo() const; WW8TableNodeInfo * reorderByLayout(const SwTable * pTable); }; diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 5e1ca48b5ab3..6f69f8e591a5 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 2e22e3518c90..0a6151b98388 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1440,6 +1440,13 @@ void DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_ OSL_TRACE( "TODO: DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )\n" ); } +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*/ ) { OSL_TRACE( "TODO: DocxAttributeOutput::TableRowEnd( sal_uInt32 nDepth = 1 )\n" ); diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 62a3726e5543..850e9b118fae 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -567,6 +567,7 @@ namespace sw return aRet; } +#if 0 Frames GetFramesBetweenNodes(const Frames &rFrames, const SwNode &rStart, const SwNode &rEnd) { @@ -580,7 +581,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 a10330d5f3ec..ec149ee08326 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -663,6 +663,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 @@ -685,7 +686,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/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 76ad1dc354ea..6e6dcf813767 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -77,6 +77,7 @@ #include <doc.hxx> #include <docary.hxx> #include <swtable.hxx> +#include <swtblfmt.hxx> #include <section.hxx> #include <pagedesc.hxx> #include <swrect.hxx> @@ -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<const SwTableFmt *>(pTable->GetRegisteredIn()); + if (pTabFmt != NULL) + { + if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE) + AttrOutput().PageBreakBefore(true); + } + } } if ( !bFlyInTable ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index d5cdbf731375..2e992335598e 100644..100755 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -58,10 +58,12 @@ #include <filter/msfilter/msoleexp.hxx> #include <filter/msfilter/msocximex.hxx> #include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> #include <editeng/boxitem.hxx> #include <editeng/brshitem.hxx> #include <swtypes.hxx> #include <swrect.hxx> +#include <swtblfmt.hxx> #include <txatbase.hxx> #include <fmtcntnt.hxx> #include <fmtpdsc.hxx> @@ -1911,6 +1913,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa TableBidi( pTableTextNodeInfoInner ); TableVerticalCell( pTableTextNodeInfoInner ); TableOrientation( pTableTextNodeInfoInner ); + TableSpacing( pTableTextNodeInfoInner ); } } } @@ -2093,6 +2096,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<const SwTableFmt *>(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 SwTable * pTable = pTableTextNodeInfoInner->getTable(); @@ -2417,13 +2455,15 @@ typedef ::std::deque<SwNode *> SwNodeDeque; void MSWordExportBase::WriteText() { -#ifdef DEBUG - ::std::clog << "<WriteText>" << ::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 << "<WriteText>" << ::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 && @@ -2431,6 +2471,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()) { @@ -2442,6 +2485,7 @@ void MSWordExportBase::WriteText() ::std::clog << "<already-done>" << dbg_out(*pNd) << "</already-done>" << ::std::endl; } #endif +#endif if ( pNd->IsTxtNode() ) SectionBreaksAndFrames( *pNd->GetTxtNode() ); @@ -3776,7 +3820,8 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) { #ifdef DEBUG -// someone who knows what he wants should make this linkable when building with 'debug=t' ... +// whoever has need of the missing function should go and implement it! +// This piece of code always breaks builds... // ::std::clog << "<OutWW8_SwEndNode>" << dbg_out(&rNode) << ::std::endl; #endif diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index b9d9038b484b..b9d9ba38c246 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. diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 5808e3981223..983bc9c73c77 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 (pObj != NULL) + { + pObj->SetMergedItemSet(aSet); + pObj->SetModel(pSdrModel); - if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) ) - dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True); + if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) ) + dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True); - if ( bIsSimpleDrawingTextBox ) - { - if ( nTextRotationAngle ) + 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 ); + 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. + 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 ) { diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index b32fbf7f0037..71aa7022ed31 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -285,7 +285,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/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 5d57a83481b5..1588944e179b 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2265,12 +2265,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/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 0a844453bb3b..653208aaf250 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -765,24 +765,28 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) DELETEZ(pWebToolbarConfig) ; DELETEZ(pAuthorNames) ; DELETEZ(pDBConfig); - - if (pColorConfig != 0) { + if( pColorConfig ) + { pColorConfig->RemoveListener(this); DELETEZ(pColorConfig); } - if (pAccessibilityOptions != 0) { + if( pAccessibilityOptions ) + { pAccessibilityOptions->RemoveListener(this); DELETEZ(pAccessibilityOptions); } - if (pCTLOptions != 0) { + if( pCTLOptions ) + { pCTLOptions->RemoveListener(this); DELETEZ(pCTLOptions); } - if (pUserOptions != 0) { + if( pUserOptions ) + { pUserOptions->RemoveListener(this); DELETEZ(pUserOptions); } - if (pUndoOptions != 0) { + if( pUndoOptions ) + { pUndoOptions->RemoveListener(this); DELETEZ(pUndoOptions); } diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 34ccac06a256..c3f6585e325e 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -101,7 +101,6 @@ #include <cmdid.h> #include <globals.hrc> #include <app.hrc> -#include "warnpassword.hxx" #include <cfgid.h> #include <unotools/moduleoptions.hxx> diff --git a/sw/source/ui/cctrl/makefile.mk b/sw/source/ui/cctrl/makefile.mk index c724f287fc3a..33ba83f34d7c 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/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 97930582ce5a..921d2a652002 100644..100755 --- 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 ) diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index b44ee246ac41..9e62f7a4de36 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1911,7 +1911,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 ) @@ -1923,8 +1923,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; diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 8ad861713e0a..cf894f8728c4 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -2907,9 +2907,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::LoadHiddenDocument( *xWorkDocSh, 0 )->GetViewShell() ); @@ -3032,8 +3030,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/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 54cf6edac512..365c56b4c0ea 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<svt::OWizardPage*>(pCurPage)->commitPage( eValidate ); + static_cast<svt::OWizardPage*>(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 b2d8c790c25d..a35b0727c1ed 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 b47b71f1a561..eddaca225e9b 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 698e12f44882..e125b4f8ed2e 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 2785846b39e8..6483025f88ed 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 c7613055d6ab..7281880c593d 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 1756f78a29d8..3e237d797e2f 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 366eb23e9352..d9ae7b9c518f 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 0a4569c71437..b7dd9dfab2e6 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 a8650c4b37c9..8539f037ecdc 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 90298711dd88..8fb7ad938996 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); diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index 8bf658d504b0..c9e99979e66b 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -32,13 +32,13 @@ #include <vcl/msgbox.hxx> #include <editeng/svxacorr.hxx> #include <editeng/acorrcfg.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #include <sfx2/app.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <editeng/unolingu.hxx> +#include <editeng/editeng.hxx> +#include <editeng/editview.hxx> #include <wrtsh.hxx> #include <sfx2/printer.hxx> #include <svx/svdoutl.hxx> @@ -56,9 +56,7 @@ #include <pam.hxx> #include <drawbase.hxx> #include <unotextrange.hxx> -#ifndef _DIALOG_HXX #include <dialog.hrc> -#endif #include <cmdid.h> @@ -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/dochdl/dochdl.src b/sw/source/ui/dochdl/dochdl.src index 8ecccb5395cb..f92ea43681d8 100644..100755 --- 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 index 5cb1df8a9ebb..cc789d6e4498 100644..100755 --- 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; diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index c6b0ad4a136f..53770059cbcd 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -1304,7 +1304,7 @@ void SwPostItMgr::Delete() CalcRects(); LayoutPostIts(); } - +#if 0 void SwPostItMgr::Hide(SwPostItField* pPostItField ) { for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) @@ -1323,7 +1323,7 @@ void SwPostItMgr::Hide(SwPostItField* pPostItField ) LayoutPostIts(); } - +#endif void SwPostItMgr::Hide( const String& rAuthor ) { for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) @@ -1398,30 +1398,6 @@ sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItFie return NULL; } -bool SwPostItMgr::ShowPreview(const SwField* pFld, SwFmtFld*& pFmtFld) const -{ - for (unsigned long n=0;n<mPages.size();n++) - { - if (mPages[n]->mList->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; -} - SwSidebarWin* SwPostItMgr::GetNextPostIt( USHORT aDirection, SwSidebarWin* aPostIt ) { diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index cce6db3a891b..cce6db3a891b 100644..100755 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx diff --git a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx index 3ab86b3469d7..dd3e7e2dce9b 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 c59bb1535bad..d63149eb7c4f 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -580,7 +580,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/ribbar/makefile.mk b/sw/source/ui/ribbar/makefile.mk index 72acc793070a..2405d4b16d9f 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/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 0cee102729a7..0500b4a88310 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -703,8 +703,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)); } } diff --git a/sw/source/ui/shells/makefile.mk b/sw/source/ui/shells/makefile.mk index e9a03a5a41cc..dce62a2c9336 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 d06bb58a7dab..337ee85da580 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/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index 7e35ca0049df..abae753c1b56 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); } diff --git a/sw/source/ui/uno/makefile.mk b/sw/source/ui/uno/makefile.mk index 32210b2162d6..0023fd52f55c 100644 --- a/sw/source/ui/uno/makefile.mk +++ b/sw/source/ui/uno/makefile.mk @@ -59,8 +59,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/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index a4167da88748..0579d180a04c 100755..100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -114,6 +114,8 @@ #include <drawdoc.hxx> #include <SwStyleNameMapper.hxx> #include <osl/file.hxx> +#include <comphelper/storagehelper.hxx> + // --> FME 2004-06-08 #i12836# enhanced pdf export #include <EnhancedPDFExportHelper.hxx> @@ -3152,16 +3154,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-------------------------------- diff --git a/sw/source/ui/uno/warnpassword.cxx b/sw/source/ui/uno/warnpassword.cxx deleted file mode 100644 index cd121226a5f1..000000000000 --- a/sw/source/ui/uno/warnpassword.cxx +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************* - * - * 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 - * <http://www.openoffice.org/license.html> - * 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 <com/sun/star/task/XInteractionHandler.hpp> -#include <svl/itemset.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/sfxsids.hrc> -#include <ucbhelper/simpleinteractionrequest.hxx> -#include <com/sun/star/ucb/InteractiveAppException.hpp> -#include <svx/svxerr.hxx> - -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 <XInterface> (), - 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; -} - diff --git a/sw/source/ui/utlui/makefile.mk b/sw/source/ui/utlui/makefile.mk index 7f2aa91c0e11..cded61eee357 100644 --- a/sw/source/ui/utlui/makefile.mk +++ b/sw/source/ui/utlui/makefile.mk @@ -51,15 +51,15 @@ SRC1FILES = \ EXCEPTIONSFILES= \ $(SLO)$/bookctrl.obj \ + $(SLO)$/glbltree.obj \ $(SLO)$/navipi.obj \ $(SLO)$/unotools.obj \ + $(SLO)$/content.obj \ $(SLO)$/swrenamexnameddlg.obj SLOFILES = $(EXCEPTIONSFILES) \ $(SLO)$/condedit.obj \ - $(SLO)$/content.obj \ $(SLO)$/gloslst.obj \ - $(SLO)$/glbltree.obj \ $(SLO)$/initui.obj \ $(SLO)$/navicfg.obj \ $(SLO)$/numfmtlb.obj \ |