summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-06-08 19:21:38 +0200
committerMichael Stahl <mst@openoffice.org>2010-06-08 19:21:38 +0200
commit1355ef7a63907ac69d663b6f07e41b844aa7307f (patch)
treefdbaf6af3858bba997aab67e8ac886fbb691c403
parent3bd3fc177eebc1cc2779c5b77cbbe90014f9afe3 (diff)
parent85df13fa783ecb5de7f9e688cdabcebd9d91e447 (diff)
merge DEV300_m81
-rw-r--r--sw/inc/doc.hxx1
-rw-r--r--sw/inc/fldbas.hxx15
-rw-r--r--sw/inc/htmltbl.hxx2
-rw-r--r--sw/inc/ndtxt.hxx6
-rw-r--r--sw/inc/txtfld.hxx3
-rw-r--r--sw/inc/txtftn.hxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx5
-rw-r--r--sw/source/core/crsr/findtxt.cxx4
-rw-r--r--sw/source/core/doc/doccomp.cxx22
-rw-r--r--sw/source/core/doc/docedt.cxx29
-rw-r--r--sw/source/core/doc/docfld.cxx20
-rw-r--r--sw/source/core/doc/docredln.cxx19
-rw-r--r--sw/source/core/doc/extinput.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx34
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx10
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/edfld.cxx5
-rw-r--r--sw/source/core/fields/cellfml.cxx3
-rw-r--r--sw/source/core/fields/fldbas.cxx17
-rw-r--r--sw/source/core/inc/frame.hxx4
-rw-r--r--sw/source/core/layout/layact.cxx18
-rw-r--r--sw/source/core/text/itrcrsr.cxx40
-rw-r--r--sw/source/core/tox/txmsrt.cxx5
-rw-r--r--sw/source/core/txtnode/atrfld.cxx13
-rw-r--r--sw/source/core/txtnode/atrftn.cxx38
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx85
-rw-r--r--sw/source/core/txtnode/thints.cxx3
-rw-r--r--sw/source/core/undo/SwUndoField.cxx12
-rw-r--r--sw/source/core/undo/undel.cxx10
-rw-r--r--sw/source/core/undo/undobj.cxx7
-rw-r--r--sw/source/core/unocore/unoftn.cxx4
-rw-r--r--sw/source/core/unocore/unosett.cxx11
-rw-r--r--sw/source/filter/ascii/ascatr.cxx3
-rw-r--r--sw/source/filter/html/htmlfldw.cxx2
-rw-r--r--sw/source/filter/html/htmlform.cxx8
-rw-r--r--sw/source/filter/html/swhtml.cxx2
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx9
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx18
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx10
-rw-r--r--sw/source/filter/ww8/ww8par.cxx60
-rw-r--r--sw/source/filter/ww8/ww8par.hxx22
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx46
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx29
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx52
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx18
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx2
-rw-r--r--sw/source/ui/fldui/fldpage.cxx14
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx2
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx15
50 files changed, 489 insertions, 283 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index d433ff603b2f..adead2ed45e4 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -716,6 +716,7 @@ private:
bool DeleteAndJoinImpl(SwPaM&, const bool);
bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
bool DeleteRangeImpl(SwPaM&, const bool unused = false);
+ bool DeleteRangeImplImpl(SwPaM &);
bool ReplaceRangeImpl(SwPaM&, String const&, const bool);
public:
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index a39dcefaabd3..a2e08366ba24 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -305,12 +305,17 @@ inline void SwFieldType::UpdateFlds() const
class SW_DLLPUBLIC SwField
{
+private:
+ mutable String m_Cache; /// #i85766# cached expansion (for clipboard)
USHORT nLang; // Immer ueber SetLanguage aendern!
BOOL bIsAutomaticLanguage;
sal_uInt32 nFormat;
SwFieldType* pType;
+ virtual String Expand() const = 0;
+ virtual SwField* Copy() const = 0;
+
protected:
void SetFormat(sal_uInt32 nSet) {nFormat = nSet;}
@@ -325,12 +330,16 @@ public:
// neuen Typ setzen (wird fuer das Kopieren zwischen Dokumenten benutzt)
virtual SwFieldType* ChgTyp( SwFieldType* );
- // Expandierung fuer die Anzeige
- virtual String Expand() const = 0;
+ /** expand the field.
+ @param bInClipboard field is in clipboard document?
+ @return the generated text (suitable for display)
+ */
+ String ExpandField(bool const bInClipboard) const;
// liefert den Namen oder den Inhalt
virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual SwField* Copy() const = 0;
+
+ SwField * CopyField() const;
// ResId
USHORT Which() const
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx
index 941e6bc43eb2..ef16a2a89b86 100644
--- a/sw/inc/htmltbl.hxx
+++ b/sw/inc/htmltbl.hxx
@@ -267,6 +267,7 @@ class SwHTMLTableLayout
DECL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void* );
+ static USHORT GetBrowseWidthByVisArea( const SwDoc& rDoc );
public:
SwHTMLTableLayout( const SwTable *pSwTbl,
@@ -348,7 +349,6 @@ public:
// oder eine ViewShell vorhanden ist. Sonst wird 0 zurueckgegeben.
// (Wird vom HTML-Filter benoetigt, da der nicht an das Layout kommt.)
static USHORT GetBrowseWidth( const SwDoc& rDoc );
- static USHORT GetBrowseWidthByVisArea( const SwDoc& rDoc );
// Ermitteln der verfuegbaren Breite uber den Tabellen-Frame
USHORT GetBrowseWidthByTabFrm( const SwTabFrm& rTabFrm ) const;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index cf3a4a779487..53168d5a9cb4 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _NDTXT_HXX
-#define _NDTXT_HXX
+#ifndef SW_NDTXT_HXX
+#define SW_NDTXT_HXX
#include <cppuhelper/weakref.hxx>
@@ -133,6 +133,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
// pointer to the list, to whose the text node is added to
SwList* mpList;
// <--
+ /// #i111677# cached expansion (for clipboard)
+ ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache;
::com::sun::star::uno::WeakReference<
::com::sun::star::text::XTextContent> m_wXParagraph;
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 1daff7d2e914..d0be4a008cab 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -41,7 +41,8 @@ class SwTxtFld : public SwTxtAttr
SwTxtNode * m_pTxtNode;
public:
- SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStart );
+ SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart,
+ bool const bInClipboard);
virtual ~SwTxtFld();
void CopyFld( SwTxtFld *pDest ) const;
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 0b55053d03dd..07043a9263bc 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -49,7 +49,7 @@ public:
inline SwNodeIndex *GetStartNode() const { return m_pStartNode; }
void SetStartNode( const SwNodeIndex *pNode, BOOL bDelNodes = TRUE );
void SetNumber( const USHORT nNumber, const String* = 0 );
- void CopyFtn( SwTxtFtn *pDest ) const;
+ void CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const;
// get and set TxtNode pointer
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 249500b95f98..c11092c5fd9d 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -34,9 +34,7 @@
#include <editeng/lrspitem.hxx>
#include <editeng/adjitem.hxx>
#include <editeng/brkitem.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <crsrsh.hxx>
#include <doc.hxx>
#include <pagefrm.hxx>
@@ -719,7 +717,8 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
(SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
- pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() );
+ pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
+ pDoc->IsClipBoard() );
pTxtFld->ChgTxtNode( pTNd );
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index aeaeeeb300bc..9fd6dd0516e9 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -144,7 +144,9 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
// Fuer das Ende merken wir uns die Ersetzungen und entferenen
// hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen
BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
- !((SwTxtFld*)pHt)->GetFld().GetFld()->Expand().Len();
+ !(static_cast<SwTxtFld const*>(pHt)
+ ->GetFld().GetFld()->ExpandField(
+ rNd.GetDoc()->IsClipBoard()).Len());
if ( bEmpty && nStart == nAkt )
{
rArr.Insert( nAkt, rArr.Count() );
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index a19ece4daf66..170193778421 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1480,6 +1480,17 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
pTmp->GetPoint()->nNode++;
pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 );
}
+ // --> mst 2010-05-17 #i101009#
+ // prevent redlines that end on structural end node
+ if (& rDoc.GetNodes().GetEndOfContent() ==
+ & pTmp->GetPoint()->nNode.GetNode())
+ {
+ pTmp->GetPoint()->nNode--;
+ SwCntntNode *const pContentNode( pTmp->GetCntntNode() );
+ pTmp->GetPoint()->nContent.Assign( pContentNode,
+ (pContentNode) ? pContentNode->Len() : 0 );
+ }
+ // <--
rDoc.DeleteRedline( *pTmp, false, USHRT_MAX );
@@ -1499,6 +1510,17 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
pTmp->GetPoint()->nNode++;
pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 );
}
+ // --> mst 2010-05-17 #i101009#
+ // prevent redlines that end on structural end node
+ if (& rDoc.GetNodes().GetEndOfContent() ==
+ & pTmp->GetPoint()->nNode.GetNode())
+ {
+ pTmp->GetPoint()->nNode--;
+ SwCntntNode *const pContentNode( pTmp->GetCntntNode() );
+ pTmp->GetPoint()->nContent.Assign( pContentNode,
+ (pContentNode) ? pContentNode->Len() : 0 );
+ }
+ // <--
} while( pInsRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
SwRedlineData aRedlnData( nsRedlineType_t::REDLINE_INSERT, nAuthor, aTimeStamp,
aEmptyStr, 0, 0 );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index c9ee5b00e181..31484ac303dd 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1604,17 +1604,9 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam,
}
// <--
{
- // dann eine Kopie vom Cursor erzeugen um alle Pams aus den
- // anderen Sichten aus dem Loeschbereich zu verschieben
- // ABER NICHT SICH SELBST !!
- SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
- ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
-
- const bool bSuccess( DeleteRangeImpl( aDelPam ) );
+ bool const bSuccess( DeleteRangeImpl( rPam ) );
if (!bSuccess)
return false;
-
- *rPam.GetPoint() = *aDelPam.GetPoint();
}
if( bJoinTxt )
@@ -1625,7 +1617,24 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam,
return true;
}
-bool SwDoc::DeleteRangeImpl( SwPaM & rPam, const bool )
+bool SwDoc::DeleteRangeImpl(SwPaM & rPam, const bool)
+{
+ // move all cursors out of the deleted range.
+ // but first copy the given PaM, because it could be a cursor that
+ // would be moved!
+ SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
+ ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
+
+ bool const bSuccess( DeleteRangeImplImpl( aDelPam ) );
+ if (bSuccess)
+ { // now copy position from temp copy to given PaM
+ *rPam.GetPoint() = *aDelPam.GetPoint();
+ }
+
+ return bSuccess;
+}
+
+bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
{
SwPosition *pStt = (SwPosition*)rPam.Start(), *pEnd = (SwPosition*)rPam.End();
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index ebac34bf3540..f4e80e9de52a 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1241,13 +1241,18 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize,
// Eintrag in den HashTable eintragen
// Eintrag vorhanden ?
pFnd = Find( rName, ppHashTbl, rTblSize, &nPos );
+ String const value(pFld->ExpandField(IsClipBoard()));
if( pFnd )
+ {
// Eintrag in der HashTabelle aendern
- ((_HashStr*)pFnd)->aSetStr = pFld->Expand();
+ static_cast<_HashStr*>(pFnd)->aSetStr = value;
+ }
else
+ {
// neuen Eintrag einfuegen
*(ppHashTbl + nPos ) = new _HashStr( rName,
- pFld->Expand(), (_HashStr*)*(ppHashTbl + nPos));
+ value, static_cast<_HashStr *>(*(ppHashTbl + nPos)));
+ }
}
break;
}
@@ -1413,13 +1418,18 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// Eintrag vorhanden ?
USHORT nPos;
SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos );
+ String const value(pFld->ExpandField(IsClipBoard()));
if( pFnd )
+ {
// Eintrag in der HashTabelle aendern
- ((_HashStr*)pFnd)->aSetStr = pFld->Expand();
+ static_cast<_HashStr*>(pFnd)->aSetStr = value;
+ }
else
+ {
// neuen Eintrag einfuegen
*(pHashStrTbl + nPos ) = new _HashStr( rName,
- pFld->Expand(), (_HashStr*)*(pHashStrTbl + nPos));
+ value, static_cast<_HashStr *>(*(pHashStrTbl + nPos)));
+ }
}
break;
case RES_GETEXPFLD:
@@ -2724,7 +2734,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
//pDstFld->ChangeFormat( rSrcFld.GetFormat() );
//pDstFld->SetLanguage( rSrcFld.GetLanguage() );
- SwField * pNewFld = rSrcFld.Copy();
+ SwField * pNewFld = rSrcFld.CopyField();
pDstFmtFld->SetFld(pNewFld);
switch( nFldWhich )
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 71dc70106245..9997eabd79c3 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -914,17 +914,24 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_INSIDE:
{
- pNewRedl->PushData( *pRedl, FALSE );
if( *pRStt == *pStt )
{
- pRedl->SetStart( *pEnd, pRStt );
- // neu einsortieren
- pRedlineTbl->Remove( n );
- pRedlineTbl->Insert( pRedl, n );
- bDec = true;
+ // --> mst 2010-05-17 #i97421#
+ // redline w/out extent loops
+ if (*pStt != *pEnd)
+ // <--
+ {
+ pNewRedl->PushData( *pRedl, FALSE );
+ pRedl->SetStart( *pEnd, pRStt );
+ // re-insert
+ pRedlineTbl->Remove( n );
+ pRedlineTbl->Insert( pRedl, n );
+ bDec = true;
+ }
}
else
{
+ pNewRedl->PushData( *pRedl, FALSE );
if( *pREnd != *pEnd )
{
pNew = new SwRedline( *pRedl );
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 2b2c809c3cb2..f627870932f9 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -54,6 +54,9 @@ SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing )
SwExtTextInput::~SwExtTextInput()
{
+ SwDoc *const pDoc = GetDoc();
+ if (pDoc->IsInDtor()) { return; /* #i58606# */ }
+
SwTxtNode* pTNd = GetPoint()->nNode.GetNode().GetTxtNode();
if( pTNd )
{
@@ -69,7 +72,6 @@ SwExtTextInput::~SwExtTextInput()
// damit Undo / Redlining usw. richtig funktioniert,
// muss ueber die Doc-Schnittstellen gegangen werden !!!
- SwDoc* pDoc = GetDoc();
if(eInputLanguage != LANGUAGE_DONTKNOW)
{
// --> FME 2005-02-11 #i41974# Only set language attribute
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index e762de8489e3..a3e28fc0e425 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -377,32 +377,12 @@ USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
return (USHORT)pPageFrm->Prt().Width();
}
- // Sonst versuchen wir es ueber die ViewShell
- USHORT nWidth = GetBrowseWidthByVisArea( rDoc );
- if( !nWidth )
- {
- // Und wenn das auch nicht geht, gibt es noch die ActualSize an der
- // DocShell.
- if( rDoc.GetDocShell() && GetpApp() && GetpApp()->GetDefaultDevice() )
- {
- // this case shouldn't happen because the filter always waits until
- // a view has been created
-/*
- nWidth = (USHORT)Application::GetDefaultDevice()
- ->PixelToLogic( rDoc.GetDocShell()->GetActualSize(),
- MapMode( MAP_TWIP ) ).Width();
-*/
- ASSERT( nWidth, "No browse width available" );
- }
-#ifdef DBG_UTIL
- else
- {
- // und wenn das auch nicht klappt, gibt es zur Zeit keine Breite
- ASSERT( nWidth, "No browse width available" );
- }
-#endif
- }
- return nWidth;
+ // --> OD 2010-05-12 #i91658#
+ // Assertion removed which state that no browse width is available.
+ // Investigation reveals that all calls can handle the case that no browse
+ // width is provided.
+ return GetBrowseWidthByVisArea( rDoc );
+ // <--
}
USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm(
@@ -1859,7 +1839,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
// weil sond die Umschaltung von relativ nach absolut nicht funktioniert.
if( pDoc->GetRootFrm() && pDoc->get(IDocumentSettingAccess::BROWSE_MODE) )
{
- USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
+ const USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() )
nAbsAvail = nVisAreaWidth;
}
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index df6c8dc8c9f2..cb804b102c0e 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -357,17 +357,19 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
- BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
+ const BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
SwHTMLTableLayout *pLayout =
pTblNd->GetTable().GetHTMLTableLayout();
if( pLayout )
{
- USHORT nBrowseWidth =
- pLayout->GetBrowseWidthByTable( *pDoc );
- if( nBrowseWidth )
+ const USHORT nBrowseWidth =
+ pLayout->GetBrowseWidthByTable( *pDoc );
+ if ( nBrowseWidth )
+ {
pLayout->Resize( nBrowseWidth, TRUE, TRUE,
bLastGrf ? HTMLTABLE_RESIZE_NOW
: 500 );
+ }
}
}
}
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 37ba5e5ced31..31c4a7dfea3e 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -457,7 +457,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
const SwField* const pFld = pAttr->GetFld().GetFld();
if (pFld)
{
- sExp += pFld->Expand();
+ sExp += pFld->ExpandField(rTNd.GetDoc()->IsClipBoard());
}
}
}
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index a919da9a6515..1e4f699fa203 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -42,9 +42,7 @@
#include <expfld.hxx>
#include <flddat.hxx>
#include <swundo.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <swddetbl.hxx>
#include <hints.hxx>
@@ -226,7 +224,8 @@ void SwEditShell::FieldToText( SwFieldType* pType )
*pFmtFld->GetTxtFld()->GetStart() );
// Feldinhalt durch Text ersetzen
- String aEntry( pFmtFld->GetFld()->Expand() );
+ String const aEntry(
+ pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) );
pPaM->SetMark();
pPaM->Move( fnMoveForward );
GetDoc()->DeleteRange( *pPaM );
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index aa46869bca1a..182ed12d6ddd 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -203,7 +203,8 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
break;
default:
- nRet = rCalcPara.rCalc.Calculate( pFld->Expand() ).GetDouble();
+ String const value(pFld->ExpandField(pDoc->IsClipBoard()));
+ nRet = rCalcPara.rCalc.Calculate(value).GetDouble();
}
}
else
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index ec65d0644bba..c47bd63e70ad 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -437,6 +437,23 @@ BOOL SwField::IsFixed() const
return bRet;
}
+String SwField::ExpandField(bool const bInClipboard) const
+{
+ if (!bInClipboard) // #i85766# do not expand fields in clipboard documents
+ {
+ m_Cache = Expand();
+ }
+ return m_Cache;
+}
+
+SwField * SwField::CopyField() const
+{
+ SwField *const pNew = Copy();
+ // #i85766# cache expansion of source (for clipboard)
+ pNew->m_Cache = Expand();
+ return pNew;
+}
+
/*--------------------------------------------------------------------
Beschreibung: Numerierung expandieren
--------------------------------------------------------------------*/
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 552555e925f9..e1560a230d7a 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -250,10 +250,6 @@ class SwFrm: public SwClient
friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL );
friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
- //Checkt ob sich beim MakePos die Pos des Frm aendert oder nicht
- //layact.cxx
- friend BOOL CheckPos( SwFrm *pFrm );
-
#if OSL_DEBUG_LEVEL > 1
//entfernt leere SwSectionFrms aus einer Kette
friend SwFrm* SwClearDummies( SwFrm* pFrm );
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1475a3909220..b51b2efc0a51 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1670,24 +1670,6 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
}
// OD 31.10.2002 #104100#
-// NOTE: no adjustments for vertical layout support necessary
-BOOL CheckPos( SwFrm *pFrm )
-{
- if ( !pFrm->GetValidPosFlag() )
- {
- Point aOld( pFrm->Frm().Pos() );
- pFrm->MakePos();
- if ( aOld != pFrm->Frm().Pos() )
- {
- pFrm->Frm().Pos( aOld );
- pFrm->_InvalidatePos();
- return FALSE;
- }
- }
- return TRUE;
-}
-
-// OD 31.10.2002 #104100#
// Implement vertical layout support
BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
{
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 438f7c246287..34c0a9843986 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -57,6 +57,9 @@
#include "pordrop.hxx"
#include "crstate.hxx" // SwCrsrMoveState
#include <pormulti.hxx> // SwMultiPortion
+// --> OD 2010-05-05 #i111284#
+#include <numrule.hxx>
+// <--
// Nicht reentrant !!!
// wird in GetCharRect gesetzt und im UnitUp/Down ausgewertet.
@@ -143,6 +146,27 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
}
}
+// --> OD 2010-05-05 #i111284#
+namespace {
+ bool AreListLevelIndentsApplicableAndLabelAlignmentActive( const SwTxtNode& rTxtNode )
+ {
+ bool bRet( false );
+
+ if ( rTxtNode.AreListLevelIndentsApplicable() )
+ {
+ const SwNumFmt& rNumFmt =
+ rTxtNode.GetNumRule()->Get( static_cast<USHORT>(rTxtNode.GetActualListLevel()) );
+ if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ bRet = true;
+ }
+ }
+
+ return bRet;
+ }
+} // end of anonymous namespace
+// <--
+
/*************************************************************************
* SwTxtMargin::CtorInitTxtMargin()
*************************************************************************/
@@ -156,7 +180,9 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
// --> OD 2009-09-08 #i95907#, #b6879723#
- const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable();
+ // --> OD 2010-05-05 #i111284#
+ const bool bListLevelIndentsApplicableAndLabelAlignmentActive(
+ AreListLevelIndentsApplicableAndLabelAlignmentActive( *(pFrm->GetTxtNode()) ) );
// <--
//
@@ -181,9 +207,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
- ( bListLevelIndentsApplicable
+ ( bListLevelIndentsApplicableAndLabelAlignmentActive
? 0
: ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
// <--
@@ -191,8 +218,9 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
else
{
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
- if ( bListLevelIndentsApplicable ||
+ if ( bListLevelIndentsApplicableAndLabelAlignmentActive ||
!pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
// <--
{
@@ -202,9 +230,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
- ( bListLevelIndentsApplicable
+ ( bListLevelIndentsApplicableAndLabelAlignmentActive
? 0
: ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
// <--
@@ -292,10 +321,11 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nFirstLineOfs = nFLOfst;
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// if ( pFrm->IsRightToLeft() ||
// !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
if ( pFrm->IsRightToLeft() ||
- bListLevelIndentsApplicable ||
+ bListLevelIndentsApplicableAndLabelAlignmentActive ||
!pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
// <--
{
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 5cfffeaf5229..61f873b010b7 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -870,8 +870,9 @@ USHORT SwTOXAuthority::GetLevel() const
-----------------------------------------------------------------------*/
void SwTOXAuthority::_GetText( String& rTxt, String& )
{
- //
- rTxt = m_rField.GetFld()->Expand();
+ bool const isClipBoard(
+ m_rField.GetTxtFld()->GetTxtNode().GetDoc()->IsClipBoard());
+ rTxt = m_rField.GetFld()->ExpandField(isClipBoard);
}
/* -----------------21.09.99 12:50-------------------
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 4ad6c773db1d..6b1adc76fbec 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -32,6 +32,7 @@
#include <fmtfld.hxx>
#include <txtfld.hxx>
#include <docufld.hxx>
+#include <doc.hxx>
#include "reffld.hxx"
#include "ddefld.hxx"
@@ -68,7 +69,7 @@ SwFmtFld::SwFmtFld( const SwField &rFld )
SwClient( rFld.GetTyp() ),
pTxtAttr( 0 )
{
- pField = rFld.Copy();
+ pField = rFld.CopyField();
}
// #i24434#
@@ -83,7 +84,7 @@ SwFmtFld::SwFmtFld( const SwFmtFld& rAttr )
if(rAttr.GetFld())
{
rAttr.GetFld()->GetTyp()->Add(this);
- pField = rAttr.GetFld()->Copy();
+ pField = rAttr.GetFld()->CopyField();
}
}
@@ -258,9 +259,10 @@ BOOL SwFmtFld::IsProtect() const
|*
*************************************************************************/
-SwTxtFld::SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStartPos )
+SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos,
+ bool const bInClipboard)
: SwTxtAttr( rAttr, nStartPos )
- , m_aExpand( rAttr.GetFld()->Expand() )
+ , m_aExpand( rAttr.GetFld()->ExpandField(bInClipboard) )
, m_pTxtNode( 0 )
{
rAttr.pTxtAttr = this;
@@ -292,7 +294,8 @@ void SwTxtFld::Expand() const
ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
const SwField* pFld = GetFld().GetFld();
- XubString aNewExpand( pFld->Expand() );
+ XubString aNewExpand(
+ pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
if( aNewExpand == m_aExpand )
{
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 7d6b8959787b..45f6c5da2baf 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -289,39 +289,45 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr )
}
// Die Fussnoten duplizieren
-void SwTxtFtn::CopyFtn( SwTxtFtn *pDest ) const
+void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const
{
- if ( m_pStartNode && pDest->GetStartNode() )
+ if (m_pStartNode && !rDest.GetStartNode())
{
- // die Fussnoten koennen in unterschiedlichen Dokumenten stehen !!
- SwDoc* pDstDoc = pDest->m_pTxtNode->GetDoc();
+ // dest missing node section? create it here!
+ // (happens in SwTxtNode::CopyText if pDest == this)
+ rDest.MakeNewTextSection( rDestNode.GetNodes() );
+ }
+ if (m_pStartNode && rDest.GetStartNode())
+ {
+ // footnotes not necessarily in same document!
+ SwDoc *const pDstDoc = rDestNode.GetDoc();
SwNodes &rDstNodes = pDstDoc->GetNodes();
- // Wir kopieren nur den Inhalt der Sektion
+ // copy only the content of the section
SwNodeRange aRg( *m_pStartNode, 1,
*m_pStartNode->GetNode().EndOfSectionNode() );
- // Wir fuegen auf dem Ende von pDest ein, d.h. die Nodes
- // werden angehaengt. nDestLen haelt die Anzahl der CntNodes
- // in pDest _vor_ dem Kopieren.
- SwNodeIndex aStart( *(pDest->GetStartNode()) );
+ // insert at the end of rDest, i.e., the nodes are appended.
+ // nDestLen contains number of CntntNodes in rDest _before_ copy.
+ SwNodeIndex aStart( *(rDest.GetStartNode()) );
SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
ULONG nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, TRUE );
- // Wenn die Dest-Sektion nicht leer war, so muessen die alten
- // Nodes geloescht werden:
- // Vorher: Src: SxxxE, Dst: SnE
- // Nachher: Src: SxxxE, Dst: SnxxxE
- // und Src: SxxxE, Dst: SxxxE
+ // in case the destination section was not empty, delete the old nodes
+ // before: Src: SxxxE, Dst: SnE
+ // now: Src: SxxxE, Dst: SnxxxE
+ // after: Src: SxxxE, Dst: SxxxE
aStart++;
rDstNodes.Delete( aStart, nDestLen );
}
- // Der benutzerdefinierte String muss auch uebertragen werden.
+ // also copy user defined number string
if( GetFtn().aNumber.Len() )
- ((SwFmtFtn&)pDest->GetFtn()).aNumber = GetFtn().aNumber;
+ {
+ const_cast<SwFmtFtn &>(rDest.GetFtn()).aNumber = GetFtn().aNumber;
+ }
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 798d7e41602f..76560bae91d7 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1327,11 +1327,11 @@ void lcl_CopyHint( const USHORT nWhich, const SwTxtAttr * const pHt,
ASSERT( nWhich == pHt->Which(), "Falsche Hint-Id" );
switch( nWhich )
{
- // Wenn wir es mit einem Fussnoten-Attribut zu tun haben,
- // muessen wir natuerlich auch den Fussnotenbereich kopieren.
+ // copy nodesarray section with footnote content
case RES_TXTATR_FTN :
+ ASSERT(pDest, "lcl_CopyHint: no destination text node?");
static_cast<const SwTxtFtn*>(pHt)->CopyFtn(
- static_cast<SwTxtFtn*>(pNewHt));
+ *static_cast<SwTxtFtn*>(pNewHt), *pDest);
break;
// Beim Kopieren von Feldern in andere Dokumente
@@ -1535,6 +1535,13 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
xub_StrLen nTxtStartIdx = rStart.GetIndex();
xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken
+ if (pDest->GetDoc()->IsClipBoard() && this->GetNum())
+ {
+ // #i111677# cache expansion of source (for clipboard)
+ pDest->m_pNumStringCache.reset(
+ new ::rtl::OUString(this->GetNumString()));
+ }
+
if( !nLen )
{
// wurde keine Laenge angegeben, dann Kopiere die Attribute
@@ -1637,6 +1644,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// Del-Array fuer alle RefMarks ohne Ausdehnung
SwpHts aRefMrkArr;
+ USHORT nDeletedDummyChars(0);
//Achtung: kann ungueltig sein!!
for (USHORT n = 0; ( n < nSize ); ++n)
{
@@ -1708,31 +1716,24 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
pNewHt = MakeTxtAttr( *GetDoc(), pHt->GetAttr(),
nAttrStt, nAttrEnd );
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-//JP 23.04.95: erstmal so gesondert hier behandeln. Am Besten ist es
-// aber im CopyFtn wenn die pDestFtn keinen StartNode hat,
-// sich diesen dann anlegt.
-// Aber so kurz vor der BETA besser nicht anfassen.
- if( RES_TXTATR_FTN == nWhich )
- {
- SwTxtFtn* pFtn = (SwTxtFtn*)pNewHt;
- pFtn->ChgTxtNode( this );
- pFtn->MakeNewTextSection( GetNodes() );
- lcl_CopyHint( nWhich, pHt, pFtn, 0, 0 );
- pFtn->ChgTxtNode( 0 );
- }
- else
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- {
- lcl_CopyHint( nWhich, pHt, pNewHt, 0, pDest );
- }
+ lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest);
aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
}
else
{
- pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt,
- nAttrEnd, nsSetAttrMode::SETATTR_NOTXTATRCHR );
- lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
+ pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars,
+ nAttrEnd - nDeletedDummyChars, nsSetAttrMode::SETATTR_NOTXTATRCHR );
+ if (pNewHt)
+ {
+ lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
+ }
+ else if (pHt->HasDummyChar())
+ {
+ // The attribute that has failed to be copied would insert
+ // dummy char, so positions of the following attributes have
+ // to be shifted by one to compensate for that missing char.
+ ++nDeletedDummyChars;
+ }
}
if( RES_TXTATR_REFMARK == nWhich && !pEndIdx && !bCopyRefMark )
@@ -2826,6 +2827,11 @@ BOOL SwTxtNode::HasBullet() const
//i53420 added max outline parameter
XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, const unsigned int _nRestrictToThisLevel ) const
{
+ if (GetDoc()->IsClipBoard() && m_pNumStringCache.get())
+ {
+ // #i111677# do not expand number strings in clipboard documents
+ return *m_pNumStringCache;
+ }
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule &&
IsCountedInList() &&
@@ -3049,8 +3055,10 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
rTxt.Erase( nPos, 1 );
if( bExpandFlds )
{
- const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld().
- GetFld()->Expand() );
+ const XubString aExpand(
+ static_cast<SwTxtFld const*>(pAttr)->GetFld()
+ .GetFld()->ExpandField(
+ GetDoc()->IsClipBoard()));
rTxt.Insert( aExpand, nPos );
nPos = nPos + aExpand.Len();
nEndPos = nEndPos + aExpand.Len();
@@ -3197,7 +3205,9 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
{
case RES_TXTATR_FIELD:
{
- const XubString aExpand( ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand() );
+ XubString const aExpand(
+ static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
+ ->ExpandField(GetDoc()->IsClipBoard()));
if( aExpand.Len() )
{
aDestIdx++; // dahinter einfuegen;
@@ -3293,7 +3303,9 @@ const ModelToViewHelper::ConversionMap*
const SwTxtAttr* pAttr = (*pSwpHints2)[i];
if ( RES_TXTATR_FIELD == pAttr->Which() )
{
- const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld().GetFld()->Expand() );
+ const XubString aExpand(
+ static_cast<SwTxtFld const*>(pAttr)->GetFld().GetFld()
+ ->ExpandField(GetDoc()->IsClipBoard()));
if ( aExpand.Len() > 0 )
{
const xub_StrLen nFieldPos = *pAttr->GetStart();
@@ -4435,6 +4447,10 @@ namespace {
if ( pNumRuleItem.GetValue().Len() > 0 )
{
mbAddTxtNodeToList = true;
+ // --> OD 2010-05-12 #i105562#
+ //
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ // <--
}
}
break;
@@ -4446,10 +4462,6 @@ namespace {
dynamic_cast<const SfxStringItem&>(pItem);
ASSERT( pListIdItem.GetValue().Len() > 0,
"<HandleSetAttrAtTxtNode(..)> - empty list id attribute not excepted. Serious defect -> please inform OD." );
-// const SfxStringItem& rListIdItemOfTxtNode =
-// dynamic_cast<const SfxStringItem&>(
-// rTxtNode.GetAttr( RES_PARATR_LIST_ID ));
-// if ( pListIdItem.GetValue() != rListIdItemOfTxtNode.GetValue() )
const String sListIdOfTxtNode = rTxtNode.GetListId();
if ( pListIdItem.GetValue() != sListIdOfTxtNode )
{
@@ -4563,11 +4575,6 @@ namespace {
{
const SfxStringItem* pListIdItem =
dynamic_cast<const SfxStringItem*>(pItem);
-// const SfxStringItem& rListIdItemOfTxtNode =
-// dynamic_cast<const SfxStringItem&>(
-// mrTxtNode.GetAttr( RES_PARATR_LIST_ID ));
-// if ( pListIdItem &&
-// pListIdItem->GetValue() != rListIdItemOfTxtNode.GetValue() )
const String sListIdOfTxtNode = mrTxtNode.GetListId();
if ( pListIdItem &&
pListIdItem->GetValue() != sListIdOfTxtNode )
@@ -4972,7 +4979,9 @@ namespace {
mrTxtNode.AddToList();
}
// --> OD 2008-11-19 #i70748#
- else if ( dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
+ // --> OD 2010-05-12 #i105562#
+ else if ( mrTxtNode.GetpSwAttrSet() &&
+ dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
{
mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index ff2a40cdd9eb..ac2f281b0d90 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1043,7 +1043,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd );
break;
case RES_TXTATR_FIELD:
- pNew = new SwTxtFld( (SwFmtFld&)rNew, nStt );
+ pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt,
+ rDoc.IsClipBoard() );
break;
case RES_TXTATR_FLYCNT:
{
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index fe189d5adf50..8a3c6c507c93 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -63,12 +63,14 @@ SwPosition SwUndoField::GetPosition()
}
SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos,
- const SwField & _aOldField,
- const SwField & _aNewField,
+ const SwField & rOldField,
+ const SwField & rNewField,
SwMsgPoolItem * _pHnt, BOOL _bUpdate, SwUndoId _nId)
- : SwUndoField(rPos,_nId), pOldField(_aOldField.Copy()),
- pNewField(_aNewField.Copy()), pHnt(_pHnt),
- bUpdate(_bUpdate)
+ : SwUndoField(rPos,_nId)
+ , pOldField(rOldField.CopyField())
+ , pNewField(rNewField.CopyField())
+ , pHnt(_pHnt)
+ , bUpdate(_bUpdate)
{
ASSERT(pOldField, "No old field!");
ASSERT(pNewField, "No new field!");
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 347a70190006..ef39a4e18950 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -868,7 +868,15 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
SetPaM( rPam );
if( pRedlSaveData )
- rDoc.DeleteRedline( rPam, false, USHRT_MAX );
+ {
+ bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE);
+ OSL_ENSURE(bSuccess,
+ "SwUndoDelete::Redo: used to have redline data, but now none?");
+ if (!bSuccess)
+ {
+ delete pRedlSaveData, pRedlSaveData = 0;
+ }
+ }
if( !bDelFullPara )
{
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 2c341cb53bf5..1a71a705b2fb 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1120,7 +1120,12 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
if (rDoc.GetDocShell() && (pRedl->GetComment() != String(::rtl::OUString::createFromAscii(""))) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
//
- rDoc.AppendRedline( pRedl, true );
+#if OSL_DEBUG_LEVEL > 0
+ bool const bSuccess =
+#endif
+ rDoc.AppendRedline( pRedl, true );
+ OSL_ENSURE(bSuccess,
+ "SwRedlineSaveData::RedlineToDoc: insert redline failed");
rDoc.SetRedlineMode_intern( eOld );
}
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 44991960ac25..d0d74fa023c7 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -78,7 +78,9 @@ public:
, m_rThis(rThis)
, m_bIsEndnote(bIsEndnote)
, m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis))
- , m_bIsDescriptor(0 == pFootnote)
+// #i111177#: unxsols4 (Sun C++ 5.9 SunOS_sparc) generates wrong code for this
+// , m_bIsDescriptor(0 == pFootnote)
+ , m_bIsDescriptor((0 == pFootnote) ? true : false)
, m_pFmtFtn(pFootnote)
{
}
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 980306be3aec..ab486b71ed04 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1659,9 +1659,14 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
aPropertyValues.Insert(pData, aPropertyValues.Count());
}
Size aSize = rFmt.GetGraphicSize();
- aSize.Width() = TWIP_TO_MM100( aSize.Width() );
- aSize.Height() = TWIP_TO_MM100( aSize.Height() );
- pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
+ // --> OD 2010-05-04 #i101131# - applying patch from CMC
+ // adjust conversion due to type mismatch between <Size> and <awt::Size>
+// aSize.Width() = TWIP_TO_MM100( aSize.Width() );
+// aSize.Height() = TWIP_TO_MM100( aSize.Height() );
+// pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
+ awt::Size aAwtSize(TWIP_TO_MM100(aSize.Width()), TWIP_TO_MM100(aSize.Height()));
+ pData = new PropValData((void*)&aAwtSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
+ // <--
aPropertyValues.Insert(pData, aPropertyValues.Count());
const SwFmtVertOrient* pOrient = rFmt.GetGraphicOrientation();
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 9249d4e5d11b..c1ba4908a339 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -124,7 +124,8 @@ BOOL SwASC_AttrIter::OutAttr( xub_StrLen nSwPos )
switch( pHt->Which() )
{
case RES_TXTATR_FIELD:
- sOut = ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand();
+ sOut = static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
+ ->ExpandField(rWrt.pDoc->IsClipBoard());
break;
case RES_TXTATR_FTN:
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 2e67ffcde1f8..50b7bdc7ddc8 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -305,7 +305,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
}
// Inhalt des Feldes ausgeben
- String sExpand( pFld->Expand() );
+ String const sExpand( pFld->ExpandField(rWrt.pDoc->IsClipBoard()) );
sal_Bool bNeedsCJKProcessing = sal_False;
if( sExpand.Len() )
{
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 4fd450cbffd5..bb1567d978f6 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -547,18 +547,20 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height )
0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
- sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
+ const sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
SwHTMLTableLayout *pLayout =
pTblNd->GetTable().GetHTMLTableLayout();
if( pLayout )
{
- sal_uInt16 nBrowseWidth =
+ const sal_uInt16 nBrowseWidth =
pLayout->GetBrowseWidthByTable( *pDoc );
- if( nBrowseWidth )
+ if ( nBrowseWidth )
+ {
pLayout->Resize( nBrowseWidth, sal_True, sal_True,
bLastGrf ? HTMLTABLE_RESIZE_NOW
: 500 );
+ }
}
}
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 1e4f975ba3ec..fba6a477757d 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4957,7 +4957,7 @@ USHORT SwHTMLParser::ToTwips( USHORT nPixel ) const
SwTwips SwHTMLParser::GetCurrentBrowseWidth()
{
- SwTwips nWidth = SwHTMLTableLayout::GetBrowseWidth( *pDoc );
+ const SwTwips nWidth = SwHTMLTableLayout::GetBrowseWidth( *pDoc );
if( nWidth )
return nWidth;
diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
index 7dcb732df601..507c83c2a204 100644
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ b/sw/source/filter/rtf/rtfatr.cxx
@@ -2902,7 +2902,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
case RES_HIDDENTXTFLD:
if( TYP_CONDTXTFLD == ((SwHiddenTxtField*)pFld)->GetSubType() )
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(),
+ RTFOutFuncs::Out_String( rWrt.Strm(),
+ pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
else
{
@@ -2958,7 +2959,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
rWrt.Strm() >> cCh;
if( ' ' != cCh ) // vorweg immer einen Trenner
rWrt.Strm() << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(),
+ RTFOutFuncs::Out_String( rWrt.Strm(),
+ pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
}
break;
@@ -2967,7 +2969,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
if( aFldStt.Len() )
{
rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(),
+ RTFOutFuncs::Out_String( rWrt.Strm(),
+ pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
rWrt.Strm() << "}}";
rRTFWrt.bOutFmtAttr = FALSE;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 6686ae5b13d7..004eef715822 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -170,10 +170,20 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
rtl::OUString sHelp;
{
- uno::Any aTmp = xPropSet->getPropertyValue(C2U("Help"));
- const rtl::OUString *pStr = (const rtl::OUString *)aTmp.getValue();
- if (pStr)
- sHelp = *pStr;
+ // --> OD 2010-05-14 #160026#
+ // property "Help" does not exist and due to the no-existence an exception is thrown.
+// uno::Any aTmp = xPropSet->getPropertyValue(C2U("Help"));
+ try
+ {
+ uno::Any aTmp = xPropSet->getPropertyValue(C2U("HelpText"));
+ // <--
+ const rtl::OUString *pStr = (const rtl::OUString *)aTmp.getValue();
+ if (pStr)
+ sHelp = *pStr;
+ }
+ catch( uno::Exception& )
+ {}
+ // <--
}
rtl::OUString sToolTip;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2db25106d330..464c7f2d64e2 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1743,9 +1743,9 @@ static void InsertSpecialChar( WW8Export& rWrt, BYTE c,
aItems.GetData());
}
-String lcl_GetExpandedField(const SwField &rFld)
+String lcl_GetExpandedField(const SwField &rFld, SwDoc const& rDoc)
{
- String sRet(rFld.Expand());
+ String sRet(rFld.ExpandField(rDoc.IsClipBoard()));
//replace LF 0x0A with VT 0x0B
sRet.SearchAndReplaceAll(0x0A, 0x0B);
@@ -1871,7 +1871,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
{
String sOut;
if( pFld )
- sOut = lcl_GetExpandedField(*pFld);
+ sOut = lcl_GetExpandedField(*pFld, *pDoc);
else
sOut = rFldCmd;
if( sOut.Len() )
@@ -2598,7 +2598,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef)
sStr.APPEND_CONST_ASC( "\" " );
m_rWW8Export.OutputField( &rFld, ww::eREF, sStr, WRITEFIELD_START |
WRITEFIELD_CMD_START | WRITEFIELD_CMD_END );
- String sVar = lcl_GetExpandedField( rFld );
+ String sVar = lcl_GetExpandedField( rFld, *GetExport().pDoc );
if ( sVar.Len() )
{
if ( m_rWW8Export.IsUnicode() )
@@ -2614,7 +2614,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef)
void WW8AttributeOutput::WriteExpand( const SwField* pFld )
{
- String sExpand( lcl_GetExpandedField( *pFld ) );
+ String sExpand( lcl_GetExpandedField( *pFld, *GetExport().pDoc ) );
if ( m_rWW8Export.IsUnicode() )
SwWW8Writer::WriteString16( m_rWW8Export.Strm(), sExpand, false );
else
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4a3a3c66e86a..f63a821b5e29 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -844,13 +844,35 @@ long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFmt &rFmt,
return nExtraListIndent > 0 ? nExtraListIndent : 0;
}
-void SyncIndentWithList(SvxLRSpaceItem &rLR, const SwNumFmt &rFmt)
+// --> OD 2010-05-06 #i103711#
+// --> OD 2010-05-11 #i105414#
+void SyncIndentWithList( SvxLRSpaceItem &rLR,
+ const SwNumFmt &rFmt,
+ const bool bFirstLineOfstSet,
+ const bool bLeftIndentSet )
{
- long nWantedFirstLinePos;
- long nExtraListIndent = lcl_GetTrueMargin(rLR, rFmt, nWantedFirstLinePos);
- rLR.SetTxtLeft(nWantedFirstLinePos - nExtraListIndent);
- rLR.SetTxtFirstLineOfst(0);
+ if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
+ {
+ long nWantedFirstLinePos;
+ long nExtraListIndent = lcl_GetTrueMargin(rLR, rFmt, nWantedFirstLinePos);
+ rLR.SetTxtLeft(nWantedFirstLinePos - nExtraListIndent);
+ rLR.SetTxtFirstLineOfst(0);
+ }
+ else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ if ( !bFirstLineOfstSet && bLeftIndentSet &&
+ rFmt.GetFirstLineIndent() != 0 )
+ {
+ rLR.SetTxtFirstLineOfst( rFmt.GetFirstLineIndent() );
+ }
+ else if ( bFirstLineOfstSet && !bLeftIndentSet &&
+ rFmt.GetIndentAt() != 0 )
+ {
+ rLR.SetTxtLeft( rFmt.GetIndentAt() );
+ }
+ }
}
+// <--
const SwNumFmt* SwWW8FltControlStack::GetNumFmtFromStack(const SwPosition &rPos,
const SwTxtNode &rTxtNode)
@@ -907,16 +929,24 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
pNum = GetNumFmtFromStack(*aRegion.GetPoint(),
*pTxtNode);
if (!pNum)
+ {
pNum = GetNumFmtFromTxtNode(*pTxtNode);
+ }
- // --> OD 2008-06-03 #i86652#
-// if (pNum)
- if ( pNum &&
- pNum->GetPositionAndSpaceMode() ==
- SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- // <--
+ if ( pNum )
{
- SyncIndentWithList(aNewLR, *pNum);
+ // --> OD 2010-05-06 #i103711#
+ const bool bFirstLineIndentSet =
+ ( rReader.maTxtNodesHavingFirstLineOfstSet.end() !=
+ rReader.maTxtNodesHavingFirstLineOfstSet.find( pNode ) );
+ // --> OD 2010-05-11 #i105414#
+ const bool bLeftIndentSet =
+ ( rReader.maTxtNodesHavingLeftIndentSet.end() !=
+ rReader.maTxtNodesHavingLeftIndentSet.find( pNode ) );
+ SyncIndentWithList( aNewLR, *pNum,
+ bFirstLineIndentSet,
+ bLeftIndentSet );
+ // <--
}
if (aNewLR == aOldLR)
@@ -3186,6 +3216,12 @@ SwWW8ImplReader::SwWW8ImplReader(BYTE nVersionPara, SvStorage* pStorage,
maGrfNameGenerator(bNewDoc,String('G')),
maParaStyleMapper(rD),
maCharStyleMapper(rD),
+ // --> OD 2010-05-06 #i103711#
+ maTxtNodesHavingFirstLineOfstSet(),
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ maTxtNodesHavingLeftIndentSet(),
+ // <--
pMSDffManager(0),
mpAtnNames(0),
pAuthorInfos(0),
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 8752c87dbc76..2c3d8c67e3fc 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -946,6 +946,13 @@ private:
WW8PLCFMan* pPlcxMan;
std::map<short, String> aLinkStringMap;
+ // --> OD 2010-05-06 #i103711#
+ std::set<const SwNode*> maTxtNodesHavingFirstLineOfstSet;
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ std::set<const SwNode*> maTxtNodesHavingLeftIndentSet;
+ // <--
+
WW8RStyle* pStyles; // Pointer auf die Style-Einleseklasse
SwFmt* pAktColl; // gerade zu erzeugende Collection
// ( ist ausserhalb einer Style-Def immer 0 )
@@ -1145,7 +1152,12 @@ private:
void ImportTox( int nFldId, String aStr );
void EndSprm( USHORT nId );
- void NewAttr( const SfxPoolItem& rAttr );
+ // --> OD 2010-05-06 #i103711#
+ // --> OD 2010-05-11 #i105414#
+ void NewAttr( const SfxPoolItem& rAttr,
+ const bool bFirstLineOfStSet = false,
+ const bool bLeftIndentSet = false );
+ // <--
bool GetFontParams(USHORT, FontFamily&, String&, FontPitch&,
rtl_TextEncoding&);
@@ -1602,7 +1614,13 @@ public: // eigentlich private, geht aber leider nur public
bool CanUseRemoteLink(const String &rGrfName);
void UseListIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt);
void SetStyleIndent(SwWW8StyInf &rStyleInfo, const SwNumFmt &rFmt);
-void SyncIndentWithList(SvxLRSpaceItem &rLR, const SwNumFmt &rFmt);
+// --> OD 2010-05-06 #i103711#
+// --> OD 2010-05-11 #i105414#
+void SyncIndentWithList( SvxLRSpaceItem &rLR,
+ const SwNumFmt &rFmt,
+ const bool bFirstLineOfStSet,
+ const bool bLeftIndentSet );
+// <--
long GetListFirstLineIndent(const SwNumFmt &rFmt);
String BookmarkToWriter(const String &rBookmark);
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 465d07c0d2b5..0b8616d54652 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1697,7 +1697,12 @@ void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt)
{
SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.pFmt, RES_LR_SPACE));
if (rStyle.bListReleventIndentSet)
- SyncIndentWithList(aLR, rFmt);
+ {
+ // --> OD 2010-05-06 #i103711#
+ // --> OD 2010-05-11 #i105414#
+ SyncIndentWithList( aLR, rFmt, false, false );
+ // <--
+ }
else
{
aLR.SetTxtLeft(0);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 6dacf0d126fe..5d57a83481b5 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2716,7 +2716,9 @@ bool SwWW8ImplReader::TestSameApo(const ApoTestResults &rApo,
# Attribut - Verwaltung
#**************************************************************************/
-void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr )
+void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr,
+ const bool bFirstLineOfStSet,
+ const bool bLeftIndentSet )
{
if( !bNoAttrImport ) // zum Ignorieren von Styles beim Doc-Einfuegen
{
@@ -2726,11 +2728,31 @@ void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr )
pAktColl->SetFmtAttr(rAttr);
}
else if (pAktItemSet)
+ {
pAktItemSet->Put(rAttr);
+ }
else if (rAttr.Which() == RES_FLTR_REDLINE)
+ {
mpRedlineStack->open(*pPaM->GetPoint(), rAttr);
+ }
else
+ {
pCtrlStck->NewAttr(*pPaM->GetPoint(), rAttr);
+ // --> OD 2010-05-06 #i103711#
+ if ( bFirstLineOfStSet )
+ {
+ const SwNode* pNd = &(pPaM->GetPoint()->nNode.GetNode());
+ maTxtNodesHavingFirstLineOfstSet.insert( pNd );
+ }
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ if ( bLeftIndentSet )
+ {
+ const SwNode* pNd = &(pPaM->GetPoint()->nNode.GetNode());
+ maTxtNodesHavingLeftIndentSet.insert( pNd );
+ }
+ // <--
+ }
if (mpPostProcessAttrsInfo && mpPostProcessAttrsInfo->mbCopy)
mpPostProcessAttrsInfo->mItemSet.Put(rAttr);
@@ -3959,6 +3981,13 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
}
}
+ // --> OD 2010-05-06 #i103711#
+ bool bFirstLinOfstSet( false );
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ bool bLeftIndentSet( false );
+ // <--
+
switch (nId)
{
//sprmPDxaLeft
@@ -3967,7 +3996,12 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
case 0x845E:
aLR.SetTxtLeft( nPara );
if (pAktColl)
+ {
pCollA[nAktColl].bListReleventIndentSet = true;
+ }
+ // --> OD 2010-05-11 #i105414#
+ bLeftIndentSet = true;
+ // <--
break;
//sprmPDxaLeft1
case 19:
@@ -3999,7 +4033,12 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
aLR.SetTxtFirstLineOfst(nPara);
if (pAktColl)
+ {
pCollA[nAktColl].bListReleventIndentSet = true;
+ }
+ // --> OD 2010-05-06 #i103711#
+ bFirstLinOfstSet = true;
+ // <--
break;
//sprmPDxaRight
case 16:
@@ -4011,7 +4050,10 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
return;
}
- NewAttr(aLR);
+ // --> OD 2010-05-06 #i103711#
+ // --> OD 2010-05-11 #i105414#
+ NewAttr( aLR, bFirstLinOfstSet, bLeftIndentSet );
+ // <--
}
// Sprm 20
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 97455d9e2514..b44ee246ac41 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -33,15 +33,10 @@
#include "dbinsdlg.hxx"
-#ifndef INCLUDED_MEMORY
#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#ifndef INCLUDED_FLOAT_H
#include <float.h>
-#define INCLUDED_FLOAT_H
-#endif
+
#include <hintids.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -65,9 +60,7 @@
#include <svl/stritem.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
-#ifndef __SV_MNEMONIC_HXX
#include <vcl/mnemonic.hxx>
-#endif
#include <svl/style.hxx>
#include <svl/zformat.hxx>
#include <svx/htmlmode.hxx>
@@ -78,24 +71,16 @@
#include <editeng/boxitem.hxx>
#include <svx/rulritem.hxx>
#include <swdbtoolsclient.hxx>
-#ifndef _SWTABLEREP_HXX //autogen
#include <tabledlg.hxx>
-#endif
#include <fmtclds.hxx>
#include <tabcol.hxx>
#include <uiitems.hxx>
#include <viewopt.hxx>
#include <uitool.hxx>
#include <wrtsh.hxx>
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <tblafmt.hxx>
#include <cellatr.hxx>
#include <swtable.hxx>
@@ -108,19 +93,11 @@
#include <poolfmt.hxx>
#include <crsskip.hxx>
-#ifndef _DBINSDLG_HRC
#include <dbinsdlg.hrc>
-#endif
-#ifndef _DBUI_HRC
#include <dbui.hrc>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <cfgid.h>
#include <SwStyleNameMapper.hxx>
#include <comphelper/uno3.hxx>
@@ -1380,8 +1357,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
case _DB_Column::DB_COL_FIELD:
{
- SwDBField* pFld = (SwDBField*)pDBCol->DB_ColumnData.
- pField->Copy();
+ SwDBField *const pFld = static_cast<SwDBField *>(
+ pDBCol->DB_ColumnData.pField->CopyField());
double nValue = DBL_MAX;
Reference< XPropertySet > xColumnProps;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 66cb07f33e9c..704172b21074 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -322,6 +322,19 @@ SwTransferable::~SwTransferable()
// -----------------------------------------------------------------------
+static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
+{
+ SwDoc *const pDoc = rDocFac.GetDoc();
+ ASSERT( pDoc, "Document not found" );
+ if (pDoc)
+ {
+ pDoc->SetClipBoard( true );
+ }
+ return pDoc;
+}
+
+// -----------------------------------------------------------------------
+
void SwTransferable::ObjectReleased()
{
SwModule *pMod = SW_MOD();
@@ -443,7 +456,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
}
pClpDocFac = new SwDocFac;
- SwDoc* pTmpDoc = pClpDocFac->GetDoc();
+ SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
pTmpDoc->SetRefForDocShell( boost::addressof(aDocShellRef) );
pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
@@ -530,8 +543,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
case SOT_FORMATSTR_ID_DRAWING:
{
- SwDoc *pDoc = pClpDocFac->GetDoc();
- ASSERT( pDoc, "Document not found" );
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
bOK = SetObject( pDoc->GetDrawModel(),
SWTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
}
@@ -539,21 +551,22 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
case SOT_FORMAT_STRING:
{
- SwDoc* pDoc = pClpDocFac->GetDoc();
- ASSERT( pDoc, "Document not found" );
- pDoc->SetClipBoard( true );
- bOK = SetObject( pDoc,
- SWTRANSFER_OBJECTTYPE_STRING, rFlavor );
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_STRING, rFlavor );
}
break;
case SOT_FORMAT_RTF:
- bOK = SetObject( pClpDocFac->GetDoc(),
- SWTRANSFER_OBJECTTYPE_RTF, rFlavor );
+ {
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_RTF, rFlavor );
+ }
break;
case SOT_FORMATSTR_ID_HTML:
- bOK = SetObject( pClpDocFac->GetDoc(),
- SWTRANSFER_OBJECTTYPE_HTML, rFlavor );
+ {
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_HTML, rFlavor );
+ }
break;
case SOT_FORMATSTR_ID_SVXB:
@@ -597,7 +610,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
// default:
if( !aDocShellRef.Is() )
{
- SwDoc *pDoc = pClpDocFac->GetDoc();
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
SwDocShell* pNewDocSh = new SwDocShell( pDoc,
SFX_CREATE_MODE_EMBEDDED );
aDocShellRef = pNewDocSh;
@@ -805,7 +818,8 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
pOrigGrf = pClpBitmap;
pClpDocFac = new SwDocFac;
- pWrtShell->Copy( pClpDocFac->GetDoc() );
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ pWrtShell->Copy( pDoc );
if (pOrigGrf && !pOrigGrf->GetBitmap().IsEmpty())
AddFormat( SOT_FORMATSTR_ID_SVXB );
@@ -827,7 +841,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
else if ( nSelection == nsSelectionType::SEL_OLE )
{
pClpDocFac = new SwDocFac;
- SwDoc *pDoc = pClpDocFac->GetDoc();
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
aDocShellRef = new SwDocShell( pDoc, SFX_CREATE_MODE_EMBEDDED);
aDocShellRef->DoInitNew( NULL );
pWrtShell->Copy( pDoc );
@@ -857,8 +871,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
if( pWrtShell->IsAddMode() && pWrtShell->SwCrsrShell::HasSelection() )
pWrtShell->CreateCrsr();
- SwDoc* pTmpDoc = pClpDocFac->GetDoc();
- pTmpDoc->SetClipBoard( true );
+ SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
pTmpDoc->SetRefForDocShell( boost::addressof(aDocShellRef) );
pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
@@ -1017,7 +1030,8 @@ int SwTransferable::CalculateAndCopy()
String aStr( pWrtShell->Calculate() );
pClpDocFac = new SwDocFac;
- pWrtShell->Copy( pClpDocFac->GetDoc(), &aStr);
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ pWrtShell->Copy(pDoc, & aStr);
eBufferType = TRNSFR_DOCUMENT;
AddFormat( FORMAT_STRING );
@@ -1037,7 +1051,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
SwWait aWait( *pWrtShell->GetView().GetDocShell(), TRUE );
pClpDocFac = new SwDocFac;
- SwDoc* pCDoc = pClpDocFac->GetDoc();
+ SwDoc *const pCDoc = lcl_GetDoc(*pClpDocFac);
SwNodes& rNds = pCDoc->GetNodes();
SwNodeIndex aNodeIdx( *rNds.GetEndOfContent().StartOfSectionNode() );
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 763504c75db6..be201c32c24e 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -35,9 +35,7 @@
#include <stdio.h>
#endif
-#ifndef _HELP_HXX //autogen
#include <vcl/help.hxx>
-#endif
#include <svl/stritem.hxx>
#include <unotools/securityoptions.hxx>
#include <tools/urlobj.hxx>
@@ -46,24 +44,15 @@
#include <editeng/flditem.hxx>
#include <svl/urihelper.hxx>
#include <svx/svdotext.hxx>
-#ifndef _OUTLINER_HXX //autogen
-#define _EEITEMID_HXX
#include <editeng/outliner.hxx>
-#endif
#include <svl/itemiter.hxx>
#include <svx/svdview.hxx>
#include <svx/svdpagv.hxx>
#include <swmodule.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <edtwin.hxx>
#include <dpage.hxx>
#include <shellres.hxx>
@@ -80,12 +69,8 @@
#include <txttxmrk.hxx>
#include <uitool.hxx>
#include <viewopt.hxx>
-#ifndef _DOCVW_HRC
#include <docvw.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include <PostItMgr.hxx>
#include <fmtfld.hxx>
@@ -319,7 +304,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
{
USHORT nOldSubType = pFld->GetSubType();
((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD);
- sTxt = pFld->Expand();
+ sTxt =
+ pFld->ExpandField(rSh.GetDoc()->IsClipBoard());
((SwField*)pFld)->SetSubType(nOldSubType);
}
break;
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 3499c8875093..95001f897702 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1435,7 +1435,7 @@ void SwFldMgr::UpdateCurFld(ULONG nFormat,
}
else
{
- pTmpFld = pCurFld->Copy();
+ pTmpFld = pCurFld->CopyField();
bDelete = true;
}
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 39a6a98d764b..265a53dc6646 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -42,28 +42,16 @@
#include <fmtfld.hxx>
#include <viewopt.hxx>
#include <fldedt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <expfld.hxx>
-#ifndef _FLDTDLG_HXX
#include <fldtdlg.hxx>
-#endif
-#ifndef _FLDPAGE_HXX
#include <fldpage.hxx>
-#endif
#include <docufld.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <sfx2/bindings.hxx>
using namespace ::com::sun::star;
@@ -218,7 +206,7 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1,
}
else // Feld aendern
{
- SwField * pTmpFld = m_pCurFld->Copy();
+ SwField *const pTmpFld = m_pCurFld->CopyField();
String sPar1(rPar1);
String sPar2(rPar2);
diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index 84b3309f70bc..a239f13f1ec2 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -26,12 +26,10 @@
************************************************************************/
#ifndef _SWDTFLVR_HXX
#define _SWDTFLVR_HXX
-#ifndef _TRANSFER_HXX
#include <sfx2/objsh.hxx>
#include <svtools/transfer.hxx>
-#endif
#include <vcl/graph.hxx>
#include <sfx2/lnkbase.hxx>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index c7cb89bf5e61..04f87e877aa5 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1387,7 +1387,20 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
// <--
if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 )
{
- const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs;
+ // --> OD 2010-05-05 #i111172#
+ // If text node is already inside a list, assure that the indents
+ // are the same. Thus, adjust the indent change value by subtracting
+ // indents of to be applied list style.
+ SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs;
+ if ( pTxtNode->GetNumRule() )
+ {
+ const SwNumFmt aFmt( aNumRule.Get( 0 ) );
+ if ( aFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ nIndentChange -= aFmt.GetIndentAt() + aFmt.GetFirstLineIndent();
+ }
+ }
+ // <--
aNumRule.ChangeIndent( nIndentChange );
}
}