summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2009-11-24 12:30:17 +0100
committerVladimir Glazunov <vg@openoffice.org>2009-11-24 12:30:17 +0100
commitdfd3a9469916ecfeb20bee0bf2a7f37e156f5209 (patch)
tree99c9c2182e861449e8910683aebf6ce259ca4c19 /sw/source/core
parent70ebc074eaf9bdec8c657962290b45e8d89b3db3 (diff)
parentfeb02dfb398ed0bfff32da1e2d35ff4c7f907ae5 (diff)
CWS-TOOLING: integrate CWS sw33bf01
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/bastyp/swrect.cxx119
-rw-r--r--sw/source/core/bastyp/swregion.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx37
-rw-r--r--sw/source/core/doc/docfmt.cxx10
-rw-r--r--sw/source/core/doc/docredln.cxx3
-rw-r--r--sw/source/core/doc/docsort.cxx26
-rw-r--r--sw/source/core/doc/docstat.cxx6
-rw-r--r--sw/source/core/docnode/swthreadmanager.cxx18
-rw-r--r--sw/source/core/fields/docufld.cxx14
-rw-r--r--sw/source/core/inc/swthreadmanager.hxx15
-rw-r--r--sw/source/core/text/atrstck.cxx19
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx12
-rw-r--r--sw/source/core/txtnode/thints.cxx80
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx1
-rw-r--r--sw/source/core/undo/rolbck.cxx2
-rw-r--r--sw/source/core/undo/undobj.cxx26
-rw-r--r--sw/source/core/undo/unredln.cxx51
-rw-r--r--sw/source/core/unocore/unoport.cxx4
-rw-r--r--sw/source/core/unocore/unoportenum.cxx1
21 files changed, 268 insertions, 190 deletions
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 21fd4c7a2970..b92047dbb39a 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -53,13 +53,12 @@
SwRect::SwRect( const Rectangle &rRect ) :
- nX( rRect.Left() ),
- nY( rRect.Top() )
+ m_Point( rRect.Left(), rRect.Top() )
{
- nWidth = rRect.Right() == RECT_EMPTY ? 0 :
- rRect.Right() - rRect.Left() +1;
- nHeight = rRect.Bottom() == RECT_EMPTY ? 0 :
- rRect.Bottom() - rRect.Top() + 1;
+ m_Size.setWidth(rRect.Right() == RECT_EMPTY ? 0 :
+ rRect.Right() - rRect.Left() +1);
+ m_Size.setHeight(rRect.Bottom() == RECT_EMPTY ? 0 :
+ rRect.Bottom() - rRect.Top() + 1);
}
/*************************************************************************
@@ -139,7 +138,7 @@ SwRect& SwRect::Intersection( const SwRect& rRect )
}
else
//Def.: Bei einer leeren Intersection wird nur die SSize genullt.
- nHeight = nWidth = 0;
+ SSize(0, 0);
return *this;
}
@@ -239,76 +238,88 @@ BOOL SwRect::IsOver( const SwRect& rRect ) const
void SwRect::Justify()
{
- if ( nHeight < 0 )
+ if ( m_Size.getHeight() < 0 )
{
- nY = nY + nHeight + 1;
- nHeight = -nHeight;
+ m_Point.Y() += m_Size.getHeight() + 1;
+ m_Size.setHeight(-m_Size.getHeight());
}
- if ( nWidth < 0 )
+ if ( m_Size.getWidth() < 0 )
{
- nX = nX + nWidth + 1;
- nWidth = -nWidth;
+ m_Point.Y() += m_Size.getWidth() + 1;
+ m_Size.setWidth(-m_Size.getWidth());
}
}
// Similiar to the inline methods, but we need the function pointers
-void SwRect::_Width( const long nNew ) { nWidth = nNew; }
-void SwRect::_Height( const long nNew ) { nHeight = nNew; }
-void SwRect::_Left( const long nLeft ){ nWidth += nX - nLeft; nX = nLeft; }
-void SwRect::_Right( const long nRight ){ nWidth = nRight - nX; }
-void SwRect::_Top( const long nTop ){ nHeight += nY - nTop; nY = nTop; }
-void SwRect::_Bottom( const long nBottom ){ nHeight = nBottom - nY; }
-
-long SwRect::_Width() const{ return nWidth; }
-long SwRect::_Height() const{ return nHeight; }
-long SwRect::_Left() const{ return nX; }
-long SwRect::_Right() const{ return nX + nWidth; }
-long SwRect::_Top() const{ return nY; }
-long SwRect::_Bottom() const{ return nY + nHeight; }
-
-void SwRect::AddWidth( const long nAdd ) { nWidth += nAdd; }
-void SwRect::AddHeight( const long nAdd ) { nHeight += nAdd; }
-void SwRect::SubLeft( const long nSub ){ nWidth += nSub; nX -= nSub; }
-void SwRect::AddRight( const long nAdd ){ nWidth += nAdd; }
-void SwRect::SubTop( const long nSub ){ nHeight += nSub; nY -= nSub; }
-void SwRect::AddBottom( const long nAdd ){ nHeight += nAdd; }
-void SwRect::SetPosX( const long nNew ){ nX = nNew; }
-void SwRect::SetPosY( const long nNew ){ nY = nNew; }
+void SwRect::_Width( const long nNew ) { m_Size.setWidth(nNew); }
+void SwRect::_Height( const long nNew ) { m_Size.setHeight(nNew); }
+void SwRect::_Left( const long nLeft ){ m_Size.Width() += m_Point.getX() - nLeft; m_Point.setX(nLeft); }
+void SwRect::_Right( const long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); }
+void SwRect::_Top( const long nTop ){ m_Size.Height() += m_Point.getY() - nTop; m_Point.setY(nTop); }
+void SwRect::_Bottom( const long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); }
+
+long SwRect::_Width() const{ return m_Size.getWidth(); }
+long SwRect::_Height() const{ return m_Size.getHeight(); }
+long SwRect::_Left() const{ return m_Point.getX(); }
+long SwRect::_Right() const{ return m_Point.getX() + m_Size.getWidth(); }
+long SwRect::_Top() const{ return m_Point.getY(); }
+long SwRect::_Bottom() const{ return m_Point.getY() + m_Size.getHeight(); }
+
+void SwRect::AddWidth( const long nAdd ) { m_Size.Width() += nAdd; }
+void SwRect::AddHeight( const long nAdd ) { m_Size.Height() += nAdd; }
+void SwRect::SubLeft( const long nSub ){ m_Size.Width() += nSub; m_Point.X() -= nSub; }
+void SwRect::AddRight( const long nAdd ){ m_Size.Width() += nAdd; }
+void SwRect::SubTop( const long nSub ){ m_Size.Height() += nSub; m_Point.Y() -= nSub; }
+void SwRect::AddBottom( const long nAdd ){ m_Size.Height() += nAdd; }
+void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); }
+void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); }
const Size SwRect::_Size() const { return SSize(); }
-const Size SwRect::SwappedSize() const { return Size( nHeight, nWidth ); }
+const Size SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
const Point SwRect::TopLeft() const { return Pos(); }
-const Point SwRect::TopRight() const { return Point( nX + nWidth, nY ); }
-const Point SwRect::BottomLeft() const { return Point( nX, nY + nHeight ); }
+const Point SwRect::TopRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() ); }
+const Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() + m_Size.getHeight() ); }
const Point SwRect::BottomRight() const
- { return Point( nX + nWidth, nY + nHeight ); }
-long SwRect::GetLeftDistance( long nLimit ) const { return nX - nLimit; }
-long SwRect::GetBottomDistance( long nLim ) const { return nLim - nY - nHeight;}
-long SwRect::GetTopDistance( long nLimit ) const { return nY - nLimit; }
-long SwRect::GetRightDistance( long nLim ) const { return nLim - nX - nWidth; }
+ { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() + m_Size.getHeight() ); }
+long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLimit; }
+long SwRect::GetBottomDistance( long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();}
+long SwRect::GetTopDistance( long nLimit ) const { return m_Point.getY() - nLimit; }
+long SwRect::GetRightDistance( long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); }
BOOL SwRect::OverStepLeft( long nLimit ) const
- { return nLimit > nX && nX + nWidth > nLimit; }
+ { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
BOOL SwRect::OverStepBottom( long nLimit ) const
- { return nLimit > nY && nY + nHeight > nLimit; }
+ { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
BOOL SwRect::OverStepTop( long nLimit ) const
- { return nLimit > nY && nY + nHeight > nLimit; }
+ { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
BOOL SwRect::OverStepRight( long nLimit ) const
- { return nLimit > nX && nX + nWidth > nLimit; }
+ { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
void SwRect::SetLeftAndWidth( long nLeft, long nNew )
- { nX = nLeft; nWidth = nNew; }
+{
+ m_Point.setX(nLeft);
+ m_Size.setWidth(nNew);
+}
void SwRect::SetTopAndHeight( long nTop, long nNew )
- { nY = nTop; nHeight = nNew; }
+{
+ m_Point.setY(nTop);
+ m_Size.setHeight(nNew);
+}
void SwRect::SetRightAndWidth( long nRight, long nNew )
- { nX = nRight - nNew; nWidth = nNew; }
+{
+ m_Point.setX(nRight - nNew);
+ m_Size.setWidth(nNew);
+}
void SwRect::SetBottomAndHeight( long nBottom, long nNew )
- { nY = nBottom - nNew; nHeight = nNew; }
+{
+ m_Point.setY(nBottom - nNew);
+ m_Size.setHeight(nNew);
+}
void SwRect::SetUpperLeftCorner( const Point& rNew )
- { nX = rNew.nA; nY = rNew.nB; }
+ { m_Point = rNew; }
void SwRect::SetUpperRightCorner( const Point& rNew )
- { nX = rNew.nA - nWidth; nY = rNew.nB; }
+ { m_Point = Point(rNew.nA - m_Size.getWidth(), rNew.nB); }
void SwRect::SetLowerLeftCorner( const Point& rNew )
- { nX = rNew.nA; nY = rNew.nB - nHeight; }
+ { m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); }
#ifndef PRODUCT
/*************************************************************************
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index ba8ee121a362..2bab385f0b5a 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -117,7 +117,7 @@ void SwRegionRects::operator-=( const SwRect &rRect )
if ( 0 < (nTmp = aInter.Top() - aTmp.Top()) )
{
const long nOldVal = aTmp.Height();
- aTmp.SSize().Height() = nTmp;
+ aTmp.Height(nTmp);
InsertRect( aTmp, i, bDel );
aTmp.Height( nOldVal );
}
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 0441d14edf1d..5fec1ae726c6 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -106,6 +106,8 @@
#include <SwUndoFmt.hxx>
#include <unocrsr.hxx>
#include <docsh.hxx>
+#include <docufld.hxx>
+
#include <vector>
#include <osl/diagnose.h>
@@ -1066,6 +1068,24 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
}
}
+ // #i93174#: notes contain paragraphs that are not nodes
+ {
+ SwFieldType * const pPostits( GetSysFldType(RES_POSTITFLD) );
+ SwClientIter aIter(*pPostits);
+ SwFmtFld const * pFmtFld =
+ static_cast<SwFmtFld const*>(aIter.First( TYPE(SwFmtFld) ));
+ while (pFmtFld)
+ {
+ if (pFmtFld->IsFldInDoc())
+ {
+ SwPostItField const * const pField(
+ static_cast<SwPostItField const*>(pFmtFld->GetFld()));
+ rStat.nAllPara += pField->GetNumberOfParagraphs();
+ }
+ pFmtFld = static_cast<SwFmtFld const*>(aIter.Next());
+ }
+ }
+
rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
rStat.bModified = FALSE;
SetDocStat( rStat );
@@ -1091,12 +1111,21 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
aStat[n++].Value <<= (sal_Int32)rStat.nChar;
// For e.g. autotext documents there is no pSwgInfo (#i79945)
- if (GetDocShell()) {
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps(
+ SfxObjectShell * const pObjShell( GetDocShell() );
+ if (pObjShell)
+ {
+ const uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
+ pObjShell->GetModel(), uno::UNO_QUERY_THROW);
+ const uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
+ // #i96786#: do not set modified flag when updating statistics
+ const bool bDocWasModified( IsModified() );
+ const ModifyBlocker_Impl b(pObjShell);
xDocProps->setDocumentStatistics(aStat);
+ if (!bDocWasModified)
+ {
+ ResetModified();
+ }
}
// event. Stat. Felder Updaten
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index c054b7ee5579..2dc3be415438 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -625,7 +625,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
(RES_TXTATR_CHARFMT == nWhich) ||
(RES_TXTATR_INETFMT == nWhich) ||
(RES_TXTATR_AUTOFMT == nWhich) ||
- isUNKNOWNATR(nWhich) )
+ (RES_TXTATR_UNKNOWN_CONTAINER == nWhich) )
{
pCharSet = &rChgSet;
bCharAttr = true;
@@ -636,7 +636,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
|| isPARATR_LIST(nWhich)
// <--
|| isFRMATR(nWhich)
- || isGRFATR(nWhich) )
+ || isGRFATR(nWhich)
+ || isUNKNOWNATR(nWhich) )
{
pOtherSet = &rChgSet;
bOtherAttr = true;
@@ -653,7 +654,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
RES_TXTATR_AUTOFMT, RES_TXTATR_AUTOFMT,
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
- RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
+ RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER,
0 );
SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(),
@@ -663,6 +664,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
// <--
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
+ RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0 );
pTmpCharItemSet->Put( rChgSet );
@@ -755,7 +757,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SfxItemSet aTxtSet( pDoc->GetAttrPool(),
RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK,
RES_TXTATR_META, RES_TXTATR_METAFIELD,
- RES_TXTATR_CJK_RUBY, RES_TXTATR_WITHEND_END-1,
+ RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
0 );
aTxtSet.Put( rChgSet );
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index daeda48ccae3..54804570e488 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -309,7 +309,8 @@ Verhalten von Delete-Redline:
bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
-#ifndef PRODUCT
+#if 0
+// #i93179# disabled: ASSERT in ~SwIndexReg #ifndef PRODUCT
SwRedline aCopy( *pNewRedl );
#endif
_CHECK_REDLINE( this )
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 67fec1f7d33d..3f1a6babac56 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -386,7 +386,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
{
if( bUndo )
{
- pRedlUndo = new SwUndoRedlineSort( rPaM, rOpt );
+ pRedlUndo = new SwUndoRedlineSort( *pRedlPam,rOpt );
DoUndo( FALSE );
}
// erst den Bereich kopieren, dann
@@ -471,20 +471,36 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
AppendUndo( pRedlUndo );
}
- // nBeg ist der Start vom sortierten Bereich
+ // nBeg is start of sorted range
SwNodeIndex aSttIdx( GetNodes(), nBeg );
- // der Kopierte Bereich ist das Geloeschte
- AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam ), true);
+ // the copied range is deleted
+ SwRedline *const pDeleteRedline(
+ new SwRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam ));
- // das sortierte ist das Eingefuegte
+ // pRedlPam points to nodes that may be deleted (hidden) by
+ // AppendRedline, so adjust it beforehand to prevent ASSERT
pRedlPam->GetPoint()->nNode = aSttIdx;
SwCntntNode* pCNd = aSttIdx.GetNode().GetCntntNode();
pRedlPam->GetPoint()->nContent.Assign( pCNd, 0 );
+ AppendRedline(pDeleteRedline, true);
+
+ // the sorted range is inserted
AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_INSERT, *pRedlPam ), true);
if( pRedlUndo )
+ {
+ SwNodeIndex aInsEndIdx( pRedlPam->GetMark()->nNode, -1 );
+ pRedlPam->GetMark()->nNode = aInsEndIdx;
+ SwCntntNode *const pPrevNode =
+ pRedlPam->GetMark()->nNode.GetNode().GetCntntNode();
+ pRedlPam->GetMark()->nContent.Assign( pPrevNode, pPrevNode->Len() );
+
+ pRedlUndo->SetValues( *pRedlPam );
+ }
+
+ if( pRedlUndo )
pRedlUndo->SetOffset( aSttIdx );
delete pRedlPam, pRedlPam = 0;
diff --git a/sw/source/core/doc/docstat.cxx b/sw/source/core/doc/docstat.cxx
index 23e6fe5b055d..04c85a3a8d2a 100644
--- a/sw/source/core/doc/docstat.cxx
+++ b/sw/source/core/doc/docstat.cxx
@@ -45,10 +45,10 @@ SwDocStat::SwDocStat() :
nOLE(0),
nPage(1),
nPara(1),
+ nAllPara(1),
nWord(0),
nChar(0),
- bModified(TRUE),
- pInternStat(0)
+ bModified(TRUE)
{}
/************************************************************************
@@ -62,9 +62,9 @@ void SwDocStat::Reset()
nOLE = 0;
nPage = 1;
nPara = 1;
+ nAllPara= 1;
nWord = 0;
nChar = 0;
bModified = TRUE;
- pInternStat = 0;
}
diff --git a/sw/source/core/docnode/swthreadmanager.cxx b/sw/source/core/docnode/swthreadmanager.cxx
index 61ffa301f708..3f06c26de608 100644
--- a/sw/source/core/docnode/swthreadmanager.cxx
+++ b/sw/source/core/docnode/swthreadmanager.cxx
@@ -39,35 +39,29 @@
@author OD
*/
-SwThreadManager* SwThreadManager::mpThreadManager = 0;
-osl::Mutex* SwThreadManager::mpGetManagerMutex = new osl::Mutex();
+bool SwThreadManager::mbThreadManagerInstantiated = false;
SwThreadManager::SwThreadManager()
: mpThreadManagerImpl( new ThreadManager( SwThreadJoiner::GetThreadJoiner() ) )
{
mpThreadManagerImpl->Init();
+ mbThreadManagerInstantiated = true;
}
SwThreadManager::~SwThreadManager()
{
- delete mpThreadManagerImpl;
}
+struct InitInstance : public rtl::Static<SwThreadManager, InitInstance> {};
+
SwThreadManager& SwThreadManager::GetThreadManager()
{
- osl::MutexGuard aGuard(*mpGetManagerMutex);
-
- if ( mpThreadManager == 0 )
- {
- mpThreadManager = new SwThreadManager();
- }
-
- return *mpThreadManager;
+ return InitInstance::get();
}
bool SwThreadManager::ExistsThreadManager()
{
- return (mpThreadManager != 0);
+ return mbThreadManagerInstantiated;
}
oslInterlockedCount SwThreadManager::AddThread( const rtl::Reference< ObservableThread >& rThread )
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 6bb8ff4902ea..9f1b19db95fa 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1147,16 +1147,9 @@ String SwDocInfoField::Expand() const
->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY );
uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
aNew >>= sVal;
- ((SwDocInfoField*)this)->aContent = sVal;
+ const_cast<SwDocInfoField*>(this)->aContent = sVal;
}
}
- else
- {
- // property is "void" - means it has not been added until now - do it!
- aAny <<= ::rtl::OUString(aContent);
- uno::Reference < beans::XPropertyContainer > xCont( xSet, uno::UNO_QUERY );
- xCont->addProperty( aName, ::com::sun::star::beans::PropertyAttribute::REMOVEABLE, aAny );
- }
}
catch (uno::Exception&) {}
}
@@ -1877,6 +1870,11 @@ void SwPostItField::SetTextObject( OutlinerParaObject* pText )
mpText = pText;
}
+sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
+{
+ return (mpText) ? mpText->Count() : 1;
+}
+
/*-----------------05.03.98 13:42-------------------
--------------------------------------------------*/
diff --git a/sw/source/core/inc/swthreadmanager.hxx b/sw/source/core/inc/swthreadmanager.hxx
index a8a0de5d0d4e..e3d08955433b 100644
--- a/sw/source/core/inc/swthreadmanager.hxx
+++ b/sw/source/core/inc/swthreadmanager.hxx
@@ -34,6 +34,10 @@
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
+#include <boost/utility.hpp>
+#include <memory>
+
+
class ObservableThread;
class ThreadManager;
@@ -45,6 +49,7 @@ class ThreadManager;
@author OD
*/
class SwThreadManager
+ : private ::boost::noncopyable
{
public:
@@ -52,6 +57,9 @@ class SwThreadManager
static bool ExistsThreadManager();
+ // private: don't call!
+ SwThreadManager();
+ // private: don't call!
~SwThreadManager();
oslInterlockedCount AddThread( const rtl::Reference< ObservableThread >& rThread );
@@ -76,12 +84,9 @@ class SwThreadManager
bool StartingOfThreadsSuspended();
private:
- static SwThreadManager* mpThreadManager;
- static osl::Mutex* mpGetManagerMutex;
+ static bool mbThreadManagerInstantiated;
- ThreadManager* mpThreadManagerImpl;
-
- SwThreadManager();
+ ::std::auto_ptr<ThreadManager> mpThreadManagerImpl;
};
#endif
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index a6ed9f42255b..7db8ec2e2506 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -523,13 +523,11 @@ void SwAttrHandler::PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
{
- ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END ||
- RES_UNKNOWNATR_CONTAINER == rItem.Which() ,
+ ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END,
"I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
// robust
- if ( RES_TXTATR_WITHEND_END <= rItem.Which() ||
- RES_UNKNOWNATR_CONTAINER == rItem.Which() )
+ if ( RES_TXTATR_WITHEND_END <= rItem.Which() )
return sal_False;
USHORT nStack = StackPos[ rItem.Which() ];
@@ -557,6 +555,9 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
{
+ if ( RES_TXTATR_WITHEND_END <= rAttr.Which() )
+ return; // robust
+
// these special attributes in fact represent a collection of attributes
// they have to be removed from each stack they belong to
if ( RES_TXTATR_INETFMT == rAttr.Which() ||
@@ -583,7 +584,7 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
}
// this is the usual case, we have a basic attribute, remove it from the
// stack and reset the font
- else if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() )
+ else
{
aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr );
// reset font according to attribute on top of stack
@@ -600,13 +601,13 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
void SwAttrHandler::Pop( const SwTxtAttr& rAttr )
{
- ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END ||
- RES_UNKNOWNATR_CONTAINER == rAttr.Which() ,
+ ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END,
"I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
- if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() &&
- rAttr.Which() < RES_TXTATR_WITHEND_END )
+ if ( rAttr.Which() < RES_TXTATR_WITHEND_END )
+ {
aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr );
+ }
}
/*************************************************************************
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 826398ec2ce6..6f98bd371ead 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -386,7 +386,9 @@ USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
const FontMetric aOutMet( rRefDev.GetFontMetric() );
long nTmpPrtHeight = (USHORT)aOutMet.GetAscent() + aOutMet.GetDescent();
(void) nTmpPrtHeight;
- ASSERT( nTmpPrtHeight == nPrtHeight, "GetTextHeight != Ascent + Descent" )
+ // #i106098#: do not compare with == here due to rounding error
+ ASSERT( abs(nTmpPrtHeight - nPrtHeight) < 3,
+ "GetTextHeight != Ascent + Descent" );
#endif
((OutputDevice&)rRefDev).SetFont( aOldFnt );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index f5ebacaac8cd..55de390d6c74 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -943,9 +943,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
bool bNoExp = false;
bool bResort = false;
const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) +
- static_cast<USHORT>(RES_UNKNOWNATR_END) -
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN);
+ static_cast<USHORT>(RES_CHRATR_BEGIN);
BOOL aDontExp[ coArrSz ];
memset( &aDontExp, 0, coArrSz * sizeof(BOOL) );
@@ -980,14 +978,6 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
nWhPos = static_cast<USHORT>(nWhich -
RES_CHRATR_BEGIN);
}
- else if (isUNKNOWNATR(nWhich))
- {
- nWhPos = static_cast<USHORT>(
- nWhich -
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN) +
- static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) );
- }
else
continue;
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 12f8e210e7c5..81bdb95f0699 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1065,11 +1065,6 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
case RES_TXTATR_TOXMARK:
pNew = new SwTxtTOXMark( (SwTOXMark&)rNew, nStt, &nEnd );
break;
- case RES_UNKNOWNATR_CONTAINER:
- case RES_TXTATR_UNKNOWN_CONTAINER:
- pNew = new SwTxtXMLAttrContainer( (SvXMLAttrContainerItem&)rNew,
- nStt, nEnd );
- break;
case RES_TXTATR_CJK_RUBY:
pNew = new SwTxtRuby( (SwFmtRuby&)rNew, nStt, nEnd );
break;
@@ -1669,8 +1664,7 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
SfxItemSet aCharSet( *rSet.GetPool(), aCharAutoFmtSetRange );
- USHORT nWhich, nCount = 0;
- SwTxtAttr* pNew;
+ USHORT nCount = 0;
SfxItemIter aIter( *pSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
@@ -1678,8 +1672,10 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
{
if ( pItem && (reinterpret_cast<SfxPoolItem*>(-1) != pItem))
{
- nWhich = pItem->Which();
- if ( isCHRATR(nWhich) || isTXTATR(nWhich) || isUNKNOWNATR(nWhich) )
+ const USHORT nWhich = pItem->Which();
+ ASSERT( isCHRATR(nWhich) || isTXTATR(nWhich),
+ "SwTxtNode::SetAttr(): unknown attribute" );
+ if ( isCHRATR(nWhich) || isTXTATR(nWhich) )
{
if ((RES_TXTATR_CHARFMT == nWhich) &&
(GetDoc()->GetDfltCharFmt() ==
@@ -1698,7 +1694,8 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
}
else
{
- pNew = MakeTxtAttr( *GetDoc(),
+
+ SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(),
const_cast<SfxPoolItem&>(*pItem), nStt, nEnd );
if ( pNew )
{
@@ -1862,20 +1859,18 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
}
const USHORT nSize = m_pSwpHints->Count();
- USHORT n;
- xub_StrLen nAttrStart;
- const xub_StrLen* pAttrEnd;
if( nStt == nEnd ) // kein Bereich:
{
- for( n = 0; n < nSize; ++n ) //
+ for (USHORT n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
- nAttrStart = *pHt->GetStart();
+ const xub_StrLen nAttrStart = *pHt->GetStart();
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
- if( 0 == ( pAttrEnd = pHt->GetEnd() )) // nie Attribute ohne Ende
+ const xub_StrLen* pAttrEnd = pHt->GetEnd();
+ if ( ! pAttrEnd ) // no attributes without end
continue;
if( ( nAttrStart < nStt &&
@@ -1889,22 +1884,21 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
else // es ist ein Bereich definiert
{
// --> FME 2007-03-13 #i75299#
- std::vector< SwPoolItemEndPair >* pAttrArr = 0;
+ ::std::auto_ptr< std::vector< SwPoolItemEndPair > > pAttrArr;
// <--
const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) +
- static_cast<USHORT>(RES_UNKNOWNATR_END) -
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN);
+ static_cast<USHORT>(RES_CHRATR_BEGIN);
- for( n = 0; n < nSize; ++n )
+ for (USHORT n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
- nAttrStart = *pHt->GetStart();
+ const xub_StrLen nAttrStart = *pHt->GetStart();
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
- if( 0 == ( pAttrEnd = pHt->GetEnd() )) // nie Attribute ohne Ende
+ const xub_StrLen* pAttrEnd = pHt->GetEnd();
+ if ( ! pAttrEnd ) // no attributes without end
continue;
BOOL bChkInvalid = FALSE;
@@ -1927,7 +1921,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if( bChkInvalid )
{
// uneindeutig ?
- SfxItemIter* pItemIter = 0;
+ ::std::auto_ptr< SfxItemIter > pItemIter;
const SfxPoolItem* pItem = 0;
if ( RES_TXTATR_AUTOFMT == pHt->Which() )
@@ -1935,7 +1929,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
const SfxItemSet* pAutoSet = CharFmt::GetItemSet( pHt->GetAttr() );
if ( pAutoSet )
{
- pItemIter = new SfxItemIter( *pAutoSet );
+ pItemIter.reset( new SfxItemIter( *pAutoSet ) );
pItem = pItemIter->GetCurItem();
}
}
@@ -1947,9 +1941,14 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
while ( pItem )
{
const USHORT nHintWhich = pItem->Which();
+ ASSERT(!isUNKNOWNATR(nHintWhich),
+ "SwTxtNode::GetAttr(): unkonwn attribute?");
- if( !pAttrArr )
- pAttrArr = new std::vector< SwPoolItemEndPair >( coArrSz );
+ if ( !pAttrArr.get() )
+ {
+ pAttrArr.reset(
+ new std::vector< SwPoolItemEndPair >(coArrSz));
+ }
std::vector< SwPoolItemEndPair >::iterator pPrev = pAttrArr->begin();
if (isCHRATR(nHintWhich) ||
@@ -1957,12 +1956,6 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
{
pPrev += nHintWhich - RES_CHRATR_BEGIN;
}
- else if (isUNKNOWNATR(nHintWhich))
- {
- pPrev += nHintWhich - RES_UNKNOWNATR_BEGIN + (
- static_cast< USHORT >(RES_TXTATR_WITHEND_END) -
- static_cast< USHORT >(RES_CHRATR_BEGIN) );
- }
else
{
pPrev = pAttrArr->end();
@@ -2006,28 +1999,21 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
}
}
- pItem = ( pItemIter && !pItemIter->IsAtEnd() ) ? pItemIter->NextItem() : 0;
+ pItem = ( pItemIter.get() && !pItemIter->IsAtEnd() )
+ ? pItemIter->NextItem() : 0;
} // end while
-
- delete pItemIter;
}
}
- if( pAttrArr )
+ if ( pAttrArr.get() )
{
- for( n = 0; n < coArrSz; ++n )
+ for (USHORT n = 0; n < coArrSz; ++n)
{
const SwPoolItemEndPair& rItemPair = (*pAttrArr)[ n ];
if( (0 != rItemPair.mpItem) && ((SfxPoolItem*)-1 != rItemPair.mpItem) )
{
- USHORT nWh;
- if( n < static_cast<USHORT>( static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) ) )
- nWh = static_cast<USHORT>(n + RES_CHRATR_BEGIN);
- else
- nWh = n - static_cast<USHORT>( static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) +
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN) );
+ const USHORT nWh =
+ static_cast<USHORT>(n + RES_CHRATR_BEGIN);
if( nEnd <= rItemPair.mnEndPos ) // hinter oder genau Ende
{
@@ -2039,8 +2025,6 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
rSet.InvalidateItem( nWh );
}
}
-
- delete pAttrArr;
}
}
if( aFmtSet.Count() )
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 18db65d13dc8..afed4e1af732 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -31,7 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <hints.hxx>
#include <sfx2/objsh.hxx>
@@ -52,13 +51,6 @@
TYPEINIT1(SwTxtINetFmt,SwClient);
TYPEINIT1(SwTxtRuby,SwClient);
-// ATT_XMLCONTAINERITEM ******************************
-
-SwTxtXMLAttrContainer::SwTxtXMLAttrContainer(
- SvXMLAttrContainerItem& rAttr,
- xub_StrLen nStt, xub_StrLen nEnde )
- : SwTxtAttrEnd( rAttr, nStt, nEnde )
-{}
/*************************************************************************
* class SwTxtCharFmt
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index b34d013f3264..03efd19df3e8 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1676,6 +1676,7 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
void SwTxtNode::CountWords( SwDocStat& rStat,
xub_StrLen nStt, xub_StrLen nEnd ) const
{
+ ++rStat.nAllPara; // #i93174#: count _all_ paragraphs
if( nStt < nEnd )
{
if ( !IsHidden() )
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index ffc831fe16e5..908fc480fe66 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -833,7 +833,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
, m_Array( (BYTE)rSet.Count() )
{
SfxItemIter aIter( rSet );
- bool bAutoStyle = true;
+ bool bAutoStyle = false;
while( TRUE )
{
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 87522d4d59f8..3b090e875ea8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -666,14 +666,9 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
{
if( !pHistory )
pHistory = new SwHistory;
- if( pAPos->nNode < pEnd->nNode &&
- ( ( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) ||
- ( pStt->nNode < pAPos->nNode || !pStt->nContent.GetIndex() ) ) )
+ if (IsDestroyFrameAnchoredAtChar(
+ *pAPos, *pStt, *pEnd, nDelCntntType))
{
- // Here we identified the objects to destroy:
- // - anchored between start and end of the selection
- // - anchored in start of the selection with "CheckNoContent"
- // - anchored in start of sel. and the selection start at pos 0
pHistory->Add( *pFmt, nChainInsPos );
n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
}
@@ -1388,3 +1383,20 @@ String DenoteSpecialCharacters(const String & rStr)
return aResult;
}
+
+bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
+ SwPosition const & rStart, SwPosition const & rEnd,
+ DelCntntType const nDelCntntType)
+{
+
+ // Here we identified the objects to destroy:
+ // - anchored between start and end of the selection
+ // - anchored in start of the selection with "CheckNoContent"
+ // - anchored in start of sel. and the selection start at pos 0
+ return (rAnchorPos.nNode < rEnd.nNode)
+ && ( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType)
+ || (rStart.nNode < rAnchorPos.nNode)
+ || !rStart.nContent.GetIndex()
+ );
+}
+
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index e2cb9fb37428..21103ebb224d 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -247,6 +247,12 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
// im aSaveRange steht der kopierte, sprich der originale.
SwDoc& rDoc = rIter.GetDoc();
+ SwPosition* pStart = rIter.pAktPam->Start();
+ SwPosition* pEnd = rIter.pAktPam->End();
+
+ SwNodeIndex aPrevIdx( pStart->nNode, -1 );
+ ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+
if( 0 == ( nsRedlineMode_t::REDLINE_SHOW_DELETE & rDoc.GetRedlineMode()) )
{
// die beiden Redline Objecte suchen und diese dann anzeigen lassen,
@@ -254,17 +260,17 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
// das Geloeschte ist versteckt, also suche das INSERT
// Redline Object. Dahinter steht das Geloeschte
USHORT nFnd = rDoc.GetRedlinePos(
- *rDoc.GetNodes()[ nSttNode + nOffset + 1 ],
+ *rDoc.GetNodes()[ nSttNode + 1 ],
nsRedlineType_t::REDLINE_INSERT );
ASSERT( USHRT_MAX != nFnd && nFnd+1 < rDoc.GetRedlineTbl().Count(),
"kein Insert Object gefunden" );
++nFnd;
- rDoc.GetRedlineTbl()[nFnd]->Show();
- SetPaM( *rIter.pAktPam );
+ rDoc.GetRedlineTbl()[nFnd]->Show( 1 );
}
{
SwPaM aTmp( *rIter.pAktPam->GetMark() );
+ aTmp.GetMark()->nContent = 0;
aTmp.SetMark();
aTmp.GetPoint()->nNode = nSaveEndNode;
aTmp.GetPoint()->nContent.Assign( aTmp.GetCntntNode(), nSaveEndCntnt );
@@ -272,13 +278,52 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
}
rDoc.DelFullPara( *rIter.pAktPam );
+
+ SwPaM* pPam = rIter.pAktPam;
+ pPam->DeleteMark();
+ pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
+ SwCntntNode* pCNd = pPam->GetCntntNode();
+ pPam->GetPoint()->nContent.Assign(pCNd, 0 );
+ pPam->SetMark();
+
+ pPam->GetPoint()->nNode += nOffsetTemp;
+ pCNd = pPam->GetCntntNode();
+ pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
+
+ SetValues( *pPam );
+
SetPaM( *rIter.pAktPam );
}
void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
{
SwPaM& rPam = *rIter.pAktPam;
+
+ SwPaM* pPam = &rPam;
+ SwPosition* pStart = pPam->Start();
+ SwPosition* pEnd = pPam->End();
+
+ SwNodeIndex aPrevIdx( pStart->nNode, -1 );
+ ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+ xub_StrLen nCntStt = pStart->nContent.GetIndex();
+
rIter.GetDoc().SortText( rPam, *pOpt );
+
+ pPam->DeleteMark();
+ pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
+ SwCntntNode* pCNd = pPam->GetCntntNode();
+ xub_StrLen nLen = pCNd->Len();
+ if( nLen > nCntStt )
+ nLen = nCntStt;
+ pPam->GetPoint()->nContent.Assign(pCNd, nLen );
+ pPam->SetMark();
+
+ pPam->GetPoint()->nNode += nOffsetTemp;
+ pCNd = pPam->GetCntntNode();
+ pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
+
+ SetValues( rPam );
+
SetPaM( rPam );
rPam.GetPoint()->nNode = nSaveEndNode;
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt );
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 04d073a09df3..7071eb59731d 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -719,10 +719,6 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion:
aResult.Result = beans::TolerantPropertySetResultType::SUCCESS;
aResultVector.push_back( aResult );
}
- // this assertion should never occur!
- DBG_ASSERT( !aResultVector.size() || aResult.Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE,
- "unknown failure while retrieving property" );
-
}
}
catch (beans::UnknownPropertyException &)
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index b49816d9c9e3..a8426cf8b438 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -831,7 +831,6 @@ lcl_ExportHints(
case RES_TXTATR_AUTOFMT:
case RES_TXTATR_INETFMT:
case RES_TXTATR_CHARFMT:
- case RES_TXTATR_UNKNOWN_CONTAINER:
break; // these are handled as properties of a "Text" portion
default:
DBG_ERROR("unknown attribute");