summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-01 06:50:54 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-01 06:50:54 +0000
commitf6306b5683149bfcba7cd3655c4405a28b1a9e44 (patch)
tree464a0e5cf2c049e54df4835cd92853c512294122 /svx
parent53560c06d957d0b62a8ac65dcfa53152aafaac81 (diff)
CWS-TOOLING: integrate CWS impress149
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/outliner.hxx24
-rw-r--r--svx/inc/svx/outlobj.hxx7
-rw-r--r--svx/inc/svx/svdedtv.hxx5
-rw-r--r--svx/inc/svx/svdfppt.hxx10
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx105
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.hxx5
-rw-r--r--svx/source/outliner/outliner.cxx12
-rw-r--r--svx/source/outliner/outlobj.cxx28
-rw-r--r--svx/source/outliner/paralist.cxx48
-rw-r--r--svx/source/svdraw/svddrgmt.cxx13
-rw-r--r--svx/source/svdraw/svdedtv.cxx7
-rw-r--r--svx/source/svdraw/svdedtv1.cxx54
-rw-r--r--svx/source/svdraw/svdedtv2.cxx7
-rw-r--r--svx/source/svdraw/svdfppt.cxx43
-rw-r--r--svx/source/table/tablerow.cxx37
15 files changed, 314 insertions, 91 deletions
diff --git a/svx/inc/svx/outliner.hxx b/svx/inc/svx/outliner.hxx
index 4680207606..31e4ac2e19 100644
--- a/svx/inc/svx/outliner.hxx
+++ b/svx/inc/svx/outliner.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outliner.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.6.16.2 $
*
* This file is part of OpenOffice.org.
*
@@ -125,7 +125,23 @@ namespace basegfx { class B2DPolyPolygon; }
// MT 07/00: Only for internal use, oder some kind like hPara for the few
// functions where you need it outside ( eg. moving paragraphs... )
-class Paragraph
+class ParagraphData
+{
+ friend class Paragraph;
+ friend class OutlinerParaObject;
+protected:
+ sal_Int16 nDepth;
+ sal_Int16 mnNumberingStartValue;
+ sal_Bool mbParaIsNumberingRestart;
+
+public:
+ ParagraphData( const ParagraphData& );
+ ParagraphData();
+
+ ParagraphData& operator=( const ParagraphData& );
+};
+
+class Paragraph : protected ParagraphData
{
private:
friend class Outliner;
@@ -140,12 +156,9 @@ private:
Paragraph& operator=(const Paragraph& rPara );
USHORT nFlags;
- sal_Int16 nDepth;
XubString aBulText;
Size aBulSize;
BOOL bVisible;
- sal_Int16 mnNumberingStartValue;
- sal_Bool mbParaIsNumberingRestart;
BOOL IsVisible() const { return bVisible; }
void SetText( const XubString& rText ) { aBulText = rText; aBulSize.Width() = -1; }
@@ -155,6 +168,7 @@ private:
Paragraph( sal_Int16 nDepth );
Paragraph( const Paragraph& );
+ Paragraph( const ParagraphData& );
~Paragraph();
sal_Int16 GetDepth() const { return nDepth; }
diff --git a/svx/inc/svx/outlobj.hxx b/svx/inc/svx/outlobj.hxx
index dce33cb4a4..5fdbcb61dc 100644
--- a/svx/inc/svx/outlobj.hxx
+++ b/svx/inc/svx/outlobj.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outlobj.hxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.78.1 $
*
* This file is part of OpenOffice.org.
*
@@ -44,13 +44,14 @@ class EditTextObject;
class SvStream;
class SfxItemPool;
class SfxStyleSheetPool;
+class ParagraphData;
class SVX_DLLPUBLIC OutlinerParaObject
{
friend class Outliner;
EditTextObject* pText;
- sal_Int16* pDepthArr;
+ ParagraphData* pParagraphDataArr;
sal_uInt32 nCount;
BOOL bIsEditDoc;
OutlinerParaObject( USHORT nParaCount );
@@ -69,7 +70,7 @@ public:
void SetVertical( BOOL bVertical );
sal_uInt32 Count() const { return nCount; }
- sal_Int16 GetDepth( USHORT nPara ) const { return pDepthArr[nPara]; }
+ sal_Int16 GetDepth( USHORT nPara ) const;
const EditTextObject& GetTextObject() const { return *pText; }
void ClearPortionInfo();
BOOL IsEditDoc() const { return bIsEditDoc; }
diff --git a/svx/inc/svx/svdedtv.hxx b/svx/inc/svx/svdedtv.hxx
index afe7262740..c70050a5ca 100644
--- a/svx/inc/svx/svdedtv.hxx
+++ b/svx/inc/svx/svdedtv.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdedtv.hxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.148.1 $
*
* This file is part of OpenOffice.org.
*
@@ -231,6 +231,9 @@ public:
void SetUndoComment(const String& rComment, const String& rObjDescr);
#endif
+ std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO );
+ void AddUndoActions( std::vector< SdrUndoAction* >& );
+
// Layerverwaltung. Mit Undo.
SdrLayer* InsertNewLayer(const String& rName, USHORT nPos=0xFFFF);
// Loeschen eines Layer inkl. aller darauf befindlichen Objekte
diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx
index fb0024a0e8..b69b7b9740 100644
--- a/svx/inc/svx/svdfppt.hxx
+++ b/svx/inc/svx/svdfppt.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdfppt.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.6.1 $
*
* This file is part of OpenOffice.org.
*
@@ -53,6 +53,7 @@
#include "svx/svxdllapi.h"
#include <vcl/font.hxx>
#include <vector>
+#include <boost/optional.hpp>
////////////////////////////////////////////////////////////////////////////////////////////////////
class SdrModel;
@@ -789,7 +790,8 @@ class PPTNumberFormatCreator
void ImplGetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, UINT32 nLevel );
BOOL ImplGetExtNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, UINT32 nLevel,
- UINT32 nInstance, UINT32 nInstanceInSheet, UINT32 nFontHeight, PPTParagraphObj* pPara );
+ UINT32 nInstance, UINT32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering,
+ UINT32 nFontHeight, PPTParagraphObj* pPara );
protected :
@@ -804,7 +806,7 @@ class PPTNumberFormatCreator
const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, UINT32 nInstance );
BOOL GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat,
- PPTParagraphObj* pPara, UINT32 nInstanceInSheet );
+ PPTParagraphObj* pPara, UINT32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering );
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1052,7 +1054,7 @@ class SVX_DLLPUBLIC PPTParagraphObj : public PPTParaPropSet, public PPTNumberFor
PPTPortionObj* Next();
void AppendPortion( PPTPortionObj& rPortion );
- void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nInstanceInSheet, const PPTParagraphObj* pPrev );
+ void ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, UINT32 nInstanceInSheet, const PPTParagraphObj* pPrev );
};
#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT 1
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index e0919cbbfc..bcd2a4de09 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: EnhancedCustomShape2d.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.31.146.2 $
*
* This file is part of OpenOffice.org.
*
@@ -1792,6 +1792,97 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
}
}
+void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::vector< SdrPathObj* >& vObjectList )
+{
+ sal_Bool bAccent = sal_False;
+ switch( eSpType )
+ {
+ case mso_sptCallout1 :
+ case mso_sptBorderCallout1 :
+ case mso_sptCallout90 :
+ case mso_sptBorderCallout90 :
+ default:
+ break;
+
+ case mso_sptAccentCallout1 :
+ case mso_sptAccentBorderCallout1 :
+ case mso_sptAccentCallout90 :
+ case mso_sptAccentBorderCallout90 :
+ {
+ sal_uInt32 i, nLine = 0;
+ for ( i = 0; i < vObjectList.size(); i++ )
+ {
+ SdrPathObj* pObj( vObjectList[ i ] );
+ if(pObj->IsLine())
+ {
+ nLine++;
+ if ( nLine == nLineObjectCount )
+ {
+ pObj->ClearMergedItem( XATTR_LINESTART );
+ pObj->ClearMergedItem( XATTR_LINEEND );
+ }
+ }
+ }
+ }
+ break;
+
+ // switch start & end
+ case mso_sptAccentCallout2 :
+ case mso_sptAccentBorderCallout2 :
+ bAccent = sal_True;
+ case mso_sptCallout2 :
+ case mso_sptBorderCallout2 :
+ {
+ sal_uInt32 i, nLine = 0;
+ for ( i = 0; i < vObjectList.size(); i++ )
+ {
+ SdrPathObj* pObj( vObjectList[ i ] );
+ if(pObj->IsLine())
+ {
+ nLine++;
+ if ( nLine == 1 )
+ pObj->ClearMergedItem( XATTR_LINEEND );
+ else if ( ( bAccent && ( nLine == nLineObjectCount - 1 ) ) || ( !bAccent && ( nLine == nLineObjectCount ) ) )
+ pObj->ClearMergedItem( XATTR_LINESTART );
+ else
+ {
+ pObj->ClearMergedItem( XATTR_LINESTART );
+ pObj->ClearMergedItem( XATTR_LINEEND );
+ }
+ }
+ }
+ }
+ break;
+
+ case mso_sptAccentCallout3 :
+ case mso_sptAccentBorderCallout3 :
+ bAccent = sal_False;
+ case mso_sptCallout3 :
+ case mso_sptBorderCallout3 :
+ {
+ sal_uInt32 i, nLine = 0;
+ for ( i = 0; i < vObjectList.size(); i++ )
+ {
+ SdrPathObj* pObj( vObjectList[ i ] );
+ if(pObj->IsLine())
+ {
+ if ( nLine )
+ {
+ pObj->ClearMergedItem( XATTR_LINESTART );
+ pObj->ClearMergedItem( XATTR_LINEEND );
+ }
+ else
+ EnhancedCustomShape2d::SwapStartAndEndArrow( pObj );
+
+ nLine++;
+ }
+ }
+ }
+ break;
+ }
+}
+
+
SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnly )
{
sal_Int32 nCoordSize = seqCoordinates.getLength();
@@ -1874,8 +1965,8 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
}
else
{
- sal_Bool bContainsLines(sal_False);
- sal_Bool bContainsAreas(sal_False);
+ sal_Int32 nLineObjectCount = 0;
+ sal_Int32 nAreaObjectCount = 0;
// correct some values and collect content data
for ( i = 0; i < vObjectList.size(); i++ )
@@ -1884,11 +1975,11 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
if(pObj->IsLine())
{
- bContainsLines = sal_True;
+ nLineObjectCount++;
}
else
{
- bContainsAreas = sal_True;
+ nAreaObjectCount++;
if ( nColorIndex < nColorCount )
{
@@ -1902,6 +1993,10 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
}
}
+ // #i88870# correct line arrows for callouts
+ if ( nLineObjectCount )
+ CorrectCalloutArrows( eSpType, nLineObjectCount, vObjectList );
+
// sort objects so that filled ones are in front. Necessary
// for some strange objects
if ( bSortFilledObjectsToBack )
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx
index 25ee6db14e..b1b4ba47d9 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: EnhancedCustomShape2d.hxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.148.1 $
*
* This file is part of OpenOffice.org.
*
@@ -134,8 +134,6 @@ class EnhancedCustomShape2d : public SfxItemSet
Point GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,
const sal_Bool bScale = sal_True, const sal_Bool bReplaceGeoSize = sal_False ) const;
- static void SwapStartAndEndArrow( SdrObject* pObj );
-
void CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegmentInd, std::vector< SdrPathObj* >& rObjectList,
sal_Bool bLineGeometryNeededOnly, sal_Bool bSortFilledObjectsToBack );
SdrObject* CreatePathObj( sal_Bool bLineGeometryNeededOnly );
@@ -212,6 +210,7 @@ class EnhancedCustomShape2d : public SfxItemSet
rParameter, const sal_Int32 nPara, const sal_Bool bIsSpecialValue, sal_Bool bHorz );
static sal_Bool ConvertSequenceToEnhancedCustomShape2dHandle( const com::sun::star::beans::PropertyValues& rHandleProperties,
EnhancedCustomShape2d::Handle& rDestinationHandle );
+ static void SwapStartAndEndArrow( SdrObject* pObj );
};
#endif
diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx
index 098f85729b..d055a2c9c5 100644
--- a/svx/source/outliner/outliner.cxx
+++ b/svx/source/outliner/outliner.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outliner.cxx,v $
- * $Revision: 1.76 $
+ * $Revision: 1.74.6.2 $
*
* This file is part of OpenOffice.org.
*
@@ -385,7 +385,7 @@ OutlinerParaObject* Outliner::CreateParaObject( USHORT nStartPara, USHORT nCount
USHORT nLastPara = nStartPara + nCount - 1;
for ( USHORT nPara = nStartPara; nPara <= nLastPara; nPara++ )
- pPObj->pDepthArr[ nPara-nStartPara] = GetDepth( nPara );
+ pPObj->pParagraphDataArr[ nPara-nStartPara] = *GetParagraph( nPara );
return pPObj;
}
@@ -584,9 +584,9 @@ void Outliner::SetText( const OutlinerParaObject& rPObj )
pParaList->Clear( TRUE );
for( USHORT nCurPara = 0; nCurPara < rPObj.nCount; nCurPara++ )
{
- sal_Int16 nDepth = rPObj.pDepthArr[ nCurPara ];
- ImplCheckDepth( nDepth );
- Paragraph* pPara = new Paragraph( nDepth );
+ Paragraph* pPara = new Paragraph( rPObj.pParagraphDataArr[ nCurPara ] );
+ ImplCheckDepth( pPara->nDepth );
+
pParaList->Insert( pPara, LIST_APPEND );
ImplCheckNumBulletItem( nCurPara );
}
@@ -626,7 +626,7 @@ void Outliner::AddText( const OutlinerParaObject& rPObj )
for( USHORT n = 0; n < rPObj.nCount; n++ )
{
- pPara = new Paragraph( rPObj.pDepthArr[ n ] );
+ pPara = new Paragraph( rPObj.pParagraphDataArr[ n ] );
pParaList->Insert( pPara, LIST_APPEND );
USHORT nP = sal::static_int_cast< USHORT >(nPara+n);
DBG_ASSERT(pParaList->GetAbsPos(pPara)==nP,"AddText:Out of sync")
diff --git a/svx/source/outliner/outlobj.cxx b/svx/source/outliner/outlobj.cxx
index 8943048b06..8eebbd05cf 100644
--- a/svx/source/outliner/outlobj.cxx
+++ b/svx/source/outliner/outlobj.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outlobj.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.78.1 $
*
* This file is part of OpenOffice.org.
*
@@ -52,7 +52,7 @@ OutlinerParaObject::OutlinerParaObject( USHORT nParaCount )
DBG_CTOR(OutlinerParaObject,0);
bIsEditDoc = TRUE;
- pDepthArr = new sal_Int16[ nParaCount ];
+ pParagraphDataArr = new ParagraphData[ nParaCount ];
nCount = nParaCount;
}
@@ -62,8 +62,9 @@ OutlinerParaObject::OutlinerParaObject( const OutlinerParaObject& rObj )
bIsEditDoc = rObj.bIsEditDoc;
nCount = rObj.nCount;
- pDepthArr = new sal_Int16[ nCount ];
- memcpy( pDepthArr, rObj.pDepthArr, (size_t)(sizeof(sal_Int16)*nCount) );
+ pParagraphDataArr = new ParagraphData[ nCount ];
+ for( sal_uInt32 i = 0; i < nCount; i++ )
+ pParagraphDataArr[i] = rObj.pParagraphDataArr[i];
pText = rObj.pText->Clone();
}
@@ -74,8 +75,7 @@ OutlinerParaObject::OutlinerParaObject( const EditTextObject& rEditObj )
bIsEditDoc = TRUE;
pText = rEditObj.Clone();
nCount = pText->GetParagraphCount();
- pDepthArr = new sal_Int16[ nCount ];
- memset( pDepthArr, 0, nCount*sizeof(sal_Int16) );
+ pParagraphDataArr = new ParagraphData[ nCount ];
}
OutlinerParaObject::~OutlinerParaObject()
@@ -83,7 +83,15 @@ OutlinerParaObject::~OutlinerParaObject()
DBG_DTOR(OutlinerParaObject,0);
delete pText;
- delete[] pDepthArr;
+ delete[] pParagraphDataArr;
+}
+
+sal_Int16 OutlinerParaObject::GetDepth( USHORT nPara ) const
+{
+ if( pParagraphDataArr && (nPara < nCount ) )
+ return pParagraphDataArr[nPara].nDepth;
+ else
+ return -1;
}
void OutlinerParaObject::ClearPortionInfo()
@@ -127,7 +135,7 @@ void OutlinerParaObject::Store(SvStream& rStream ) const
pText->Store( rStream );
for( USHORT nPos=0; nPos < nCount; nPos++ )
- rStream << pDepthArr[ nPos ];
+ rStream << pParagraphDataArr[ nPos ].nDepth;
rStream << bIsEditDoc;
}
@@ -200,7 +208,7 @@ OutlinerParaObject* OutlinerParaObject::Create( SvStream& rStream, SfxItemPool*
pAllText->Insert( *pText, 0xffff );
delete pText;
}
- pPObj->pDepthArr[ nCurPara ] = pPara->GetDepth();
+ pPObj->pParagraphDataArr[ nCurPara ] = *pPara;
delete pPara;
nCount--;
nCurPara++;
@@ -219,7 +227,7 @@ OutlinerParaObject* OutlinerParaObject::Create( SvStream& rStream, SfxItemPool*
{
pPObj->pText = EditTextObject::Create( rStream, pTextObjectPool );
for( USHORT nCur=0; nCur < nCount; nCur++ )
- rStream >> pPObj->pDepthArr[ nCur ];
+ rStream >> pPObj->pParagraphDataArr[ nCur ].nDepth;
rStream >> pPObj->bIsEditDoc;
}
}
diff --git a/svx/source/outliner/paralist.cxx b/svx/source/outliner/paralist.cxx
index 3e241e38ab..5f87148176 100644
--- a/svx/source/outliner/paralist.cxx
+++ b/svx/source/outliner/paralist.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: paralist.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.6.3 $
*
* This file is part of OpenOffice.org.
*
@@ -37,11 +37,31 @@
DBG_NAME(Paragraph)
-Paragraph::Paragraph( sal_Int16 nDDepth )
-: aBulSize( -1, -1)
+ParagraphData::ParagraphData()
+: nDepth( -1 )
, mnNumberingStartValue( -1 )
, mbParaIsNumberingRestart( sal_False )
{
+}
+
+ParagraphData::ParagraphData( const ParagraphData& r )
+: nDepth( r.nDepth )
+, mnNumberingStartValue( r.mnNumberingStartValue )
+, mbParaIsNumberingRestart( r.mbParaIsNumberingRestart )
+{
+}
+
+ParagraphData& ParagraphData::operator=( const ParagraphData& r)
+{
+ nDepth = r.nDepth;
+ mnNumberingStartValue = r.mnNumberingStartValue;
+ mbParaIsNumberingRestart = r.mbParaIsNumberingRestart;
+ return *this;
+}
+
+Paragraph::Paragraph( sal_Int16 nDDepth )
+: aBulSize( -1, -1)
+{
DBG_CTOR( Paragraph, 0 );
DBG_ASSERT( ( nDDepth >= -1 ) && ( nDDepth < SVX_MAX_NUM ), "Paragraph-CTOR: nDepth invalid!" );
@@ -52,10 +72,9 @@ Paragraph::Paragraph( sal_Int16 nDDepth )
}
Paragraph::Paragraph( const Paragraph& rPara )
-: aBulText( rPara.aBulText )
+: ParagraphData( rPara )
+, aBulText( rPara.aBulText )
, aBulSize( rPara.aBulSize )
-, mnNumberingStartValue( -1 )
-, mbParaIsNumberingRestart( sal_False )
{
DBG_CTOR( Paragraph, 0 );
@@ -64,6 +83,18 @@ Paragraph::Paragraph( const Paragraph& rPara )
bVisible = rPara.bVisible;
}
+Paragraph::Paragraph( const ParagraphData& rData )
+: nFlags( 0 )
+, aBulSize( -1, -1)
+, bVisible( TRUE )
+{
+ DBG_CTOR( Paragraph, 0 );
+
+ nDepth = rData.nDepth;
+ mnNumberingStartValue = rData.mnNumberingStartValue;
+ mbParaIsNumberingRestart = rData.mbParaIsNumberingRestart;
+}
+
Paragraph::~Paragraph()
{
DBG_DTOR( Paragraph, 0 );
@@ -72,12 +103,17 @@ Paragraph::~Paragraph()
void Paragraph::SetNumberingStartValue( sal_Int16 nNumberingStartValue )
{
mnNumberingStartValue = nNumberingStartValue;
+ if( mnNumberingStartValue != -1 )
+ mbParaIsNumberingRestart = true;
}
void Paragraph::SetParaIsNumberingRestart( sal_Bool bParaIsNumberingRestart )
{
mbParaIsNumberingRestart = bParaIsNumberingRestart;
+ if( !mbParaIsNumberingRestart )
+ mnNumberingStartValue = -1;
}
+
void ParagraphList::Clear( BOOL bDestroyParagraphs )
{
if ( bDestroyParagraphs )
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index f5781c0f0e..39f92222c2 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svddrgmt.cxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.21.6.2 $
*
* This file is part of OpenOffice.org.
*
@@ -598,6 +598,7 @@ FASTBOOL SdrDragObjOwn::End(FASTBOOL /*bCopy*/)
Hide();
SdrUndoAction* pUndo=NULL;
SdrUndoAction* pUndo2=NULL;
+ std::vector< SdrUndoAction* > vConnectorUndoActions;
bool bRet=FALSE;
SdrObject* pObj=GetDragObj();
if (pObj!=NULL)
@@ -609,11 +610,13 @@ FASTBOOL SdrDragObjOwn::End(FASTBOOL /*bCopy*/)
pUndo=rView.GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj);
if (DragStat().IsEndDragChangesGeoAndAttributes())
{
+ vConnectorUndoActions = rView.CreateConnectorUndo( *pObj );
pUndo2 = rView.GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
}
}
else
{
+ vConnectorUndoActions = rView.CreateConnectorUndo( *pObj );
pUndo= rView.GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
}
}
@@ -627,14 +630,18 @@ FASTBOOL SdrDragObjOwn::End(FASTBOOL /*bCopy*/)
if(bRet)
{
- if(pUndo)
+ rView.AddUndoActions( vConnectorUndoActions );
+ if ( pUndo )
rView.AddUndo(pUndo);
- if(pUndo2)
+ if ( pUndo2 )
rView.AddUndo(pUndo2);
}
else
{
+ std::vector< SdrUndoAction* >::iterator vConnectorUndoIter( vConnectorUndoActions.begin() );
+ while( vConnectorUndoIter != vConnectorUndoActions.end() )
+ delete *vConnectorUndoIter++;
delete pUndo;
delete pUndo2;
}
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 3a6114ab2d..ecdaf55e15 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdedtv.cxx,v $
- * $Revision: 1.25 $
+ * $Revision: 1.24.148.2 $
*
* This file is part of OpenOffice.org.
*
@@ -693,7 +693,10 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
for (nm=nMarkAnz; nm>0;) {
nm--;
SdrMark* pM=rMark.GetMark(nm);
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj()));
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
}
// Sicherstellen, dass die OrderNums stimmen:
rMark.GetMark(0)->GetMarkedSdrObj()->GetOrdNum();
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 226681aa33..e601eddebf 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdedtv1.cxx,v $
- * $Revision: 1.31 $
+ * $Revision: 1.30.146.2 $
*
* This file is part of OpenOffice.org.
*
@@ -141,6 +141,40 @@ void SdrEditView::SetMarkedObjRect(const Rectangle& rRect, BOOL bCopy)
EndUndo();
}
+std::vector< SdrUndoAction* > SdrEditView::CreateConnectorUndo( SdrObject& rO )
+{
+ std::vector< SdrUndoAction* > vUndoActions;
+
+ if ( rO.GetBroadcaster() )
+ {
+ const SdrPage* pPage = rO.GetPage();
+ if ( pPage )
+ {
+ SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
+ while( aIter.IsMore() )
+ {
+ SdrObject* pPartObj = aIter.Next();
+ if ( pPartObj->ISA( SdrEdgeObj ) )
+ {
+ if ( ( pPartObj->GetConnectedNode( sal_False ) == &rO ) ||
+ ( pPartObj->GetConnectedNode( sal_True ) == &rO ) )
+ {
+ vUndoActions.push_back( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject( *pPartObj ) );
+ }
+ }
+ }
+ }
+ }
+ return vUndoActions;
+}
+
+void SdrEditView::AddUndoActions( std::vector< SdrUndoAction* >& rUndoActions )
+{
+ std::vector< SdrUndoAction* >::iterator aUndoActionIter( rUndoActions.begin() );
+ while( aUndoActionIter != rUndoActions.end() )
+ AddUndo( *aUndoActionIter++ );
+}
+
void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
{
XubString aStr(ImpGetResStr(STR_EditMove));
@@ -152,6 +186,8 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
for (ULONG nm=0; nm<nMarkAnz; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pO=pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pO,rSiz));
pO->Move(rSiz);
}
@@ -169,6 +205,8 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, cons
for (ULONG nm=0; nm<nMarkAnz; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pO=pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
pO->Resize(rRef,xFact,yFact);
}
@@ -206,6 +244,8 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy)
for (ULONG nm=0; nm<nMarkAnz; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pO=pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
pO->Rotate(rRef,nWink,nSin,nCos);
}
@@ -227,6 +267,8 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b
for (ULONG nm=0; nm<nMarkAnz; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pO=pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
pO->Mirror(rRef1,rRef2);
}
@@ -281,6 +323,8 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, long nWink, bool bVShear, bo
for (ULONG nm=0; nm<nMarkAnz; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pO=pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
pO->Shear(rRef,nWink,nTan,bVShear);
}
@@ -787,6 +831,14 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, BOOL bReplaceAll)
{
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pObj = pM->GetMarkedSdrObj();
+
+ std::vector< SdrUndoAction* > vConnectorUndoActions;
+ SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >( pObj );
+ if ( pEdgeObj )
+ bPossibleGeomChange = TRUE;
+ else
+ vConnectorUndoActions = CreateConnectorUndo( *pObj );
+ AddUndoActions( vConnectorUndoActions );
// new geometry undo
if(bPossibleGeomChange)
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index bc8ad20a69..fd86d0d861 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdedtv2.cxx,v $
- * $Revision: 1.34 $
+ * $Revision: 1.33.146.2 $
*
* This file is part of OpenOffice.org.
*
@@ -1572,7 +1572,10 @@ void SdrEditView::GroupMarked(const SdrObject* pUserGrp)
for (ULONG nm=nAnz; nm>0;) { // UndoActions fuer alle betroffenen Objekte anlegen
nm--;
SdrMark* pM=GetSdrMarkByIndex(nm);
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoRemoveObject(*pM->GetMarkedSdrObj()));
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoRemoveObject( *pObj ));
}
SdrMarkList aNewMark;
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index 82a8a111c3..0788486bda 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdfppt.cxx,v $
- * $Revision: 1.164 $
+ * $Revision: 1.163.6.5 $
*
* This file is part of OpenOffice.org.
*
@@ -2405,6 +2405,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
rOutliner.SetStyleSheet( 0, pSheet );
}
rOutliner.SetVertical( pTextObj->GetVertical() );
+ sal_Int16 nLastStartNumbering = -1;
const PPTParagraphObj* pPreviousParagraph = NULL;
for ( PPTParagraphObj* pPara = pTextObj->First(); pPara; pPara = pTextObj->Next() )
{
@@ -2492,17 +2493,35 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
rOutliner.QuickSetAttribs( aPortionAttribs, aSelection );
aSelection.nStartPos = aSelection.nEndPos;
}
+ boost::optional< sal_Int16 > oStartNumbering;
SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
- pPara->ApplyTo( aParagraphAttribs, (SdrPowerPointImport&)*this, nDestinationInstance, pPreviousParagraph );
+ pPara->ApplyTo( aParagraphAttribs, oStartNumbering, (SdrPowerPointImport&)*this, nDestinationInstance, pPreviousParagraph );
UINT32 nIsBullet2 = 0; //, nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : pTextObj->GetInstance();
pPara->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
if ( !nIsBullet2 )
rOutliner.SetDepth( rOutliner.GetParagraph( nParaIndex ), -1 );
+ if ( oStartNumbering )
+ {
+ if ( *oStartNumbering != nLastStartNumbering )
+ rOutliner.SetNumberingStartValue( nParaIndex, *oStartNumbering );
+ else
+ rOutliner.SetNumberingStartValue( nParaIndex, -1 );
+ nLastStartNumbering = *oStartNumbering;
+ }
+ else
+ {
+ nLastStartNumbering = -1;
+ rOutliner.SetNumberingStartValue( nParaIndex, nLastStartNumbering );
+ }
+
pPreviousParagraph = pPara;
if ( !aSelection.nStartPos ) // in PPT empty paragraphs never gets a bullet
- rOutliner.SetDepth( rOutliner.GetParagraph( nParaIndex ), -1 );
+ {
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
+// rOutliner.SetDepth( rOutliner.GetParagraph( nParaIndex ), -1 );
+ }
aSelection.nStartPos = 0;
rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
delete[] pParaText;
@@ -2966,6 +2985,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
Rectangle aEmpty;
aShapeHd.SeekToBegOfRecord( rStCtrl );
sal_Int32 nShapeId;
+ aProcessData.pTableRowProperties = NULL;
SdrObject* pObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty, 0, &nShapeId );
if ( pObj )
{
@@ -3560,7 +3580,7 @@ PPTNumberFormatCreator::~PPTNumberFormatCreator()
BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManager,
SvxNumberFormat& rNumberFormat, UINT32 nLevel, UINT32 nInstance, UINT32 nDestinationInstance,
- UINT32 nFontHeight, PPTParagraphObj* pPara )
+ boost::optional< sal_Int16 >& rStartNumbering, UINT32 nFontHeight, PPTParagraphObj* pPara )
{
BOOL bHardAttribute = ( nDestinationInstance == 0xffffffff );
@@ -3733,8 +3753,7 @@ BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag
}
break;
}
-// if ( nBuFlags & 0x02000000 )
-// rNumberFormat.SetStart( nBuStart );
+ rStartNumbering = boost::optional< sal_Int16 >( nAnmScheme >> 16 );
}
return bHardAttribute;
}
@@ -3755,7 +3774,8 @@ void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
nTextOfs = rParaLevel.mnTextOfs;
nBulletOfs = rParaLevel.mnBulletOfs;
- ImplGetExtNumberFormat( rManager, rNumberFormat, nLevel, nInstance, 0xffffffff, rCharLevel.mnFontHeight, NULL );
+ boost::optional< sal_Int16 > oStartNumbering;
+ ImplGetExtNumberFormat( rManager, rNumberFormat, nLevel, nInstance, 0xffffffff, oStartNumbering, rCharLevel.mnFontHeight, NULL );
if ( ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP ) && ( nBulletHeight > 0x7fff ) )
nBulletHeight = rCharLevel.mnFontHeight ? ((-((sal_Int16)nBulletHeight)) * 100 ) / rCharLevel.mnFontHeight : 100;
ImplGetNumberFormat( rManager, rNumberFormat, nLevel );
@@ -3785,7 +3805,8 @@ void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
}
}
-BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, PPTParagraphObj* pParaObj, UINT32 nDestinationInstance )
+BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, PPTParagraphObj* pParaObj,
+ UINT32 nDestinationInstance, boost::optional< sal_Int16 >& rStartNumbering )
{
UINT32 nHardCount = 0;
nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet, nDestinationInstance );
@@ -3801,7 +3822,7 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
if ( pPtr )
pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
nHardCount += ImplGetExtNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth,
- pParaObj->mnInstance, nDestinationInstance, nFontHeight, pParaObj );
+ pParaObj->mnInstance, nDestinationInstance, rStartNumbering, nFontHeight, pParaObj );
if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP )
pParaObj->UpdateBulletRelSize( nBulletHeight );
@@ -6101,7 +6122,7 @@ BOOL PPTParagraphObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestin
return (BOOL)bIsHardAttribute;
}
-void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nDestinationInstance, const PPTParagraphObj* /*pPrev*/)
+void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, sal_uInt32 nDestinationInstance, const PPTParagraphObj* /*pPrev*/)
{
INT16 nVal2;
UINT32 nVal, nUpperDist, nLowerDist;
@@ -6114,7 +6135,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager,
{
SvxNumberFormat aNumberFormat( SVX_NUM_CHAR_SPECIAL );
aNumberFormat.SetBulletChar( ' ' );
- if ( GetNumberFormat( rManager, aNumberFormat, this, nDestinationInstance ) )
+ if ( GetNumberFormat( rManager, aNumberFormat, this, nDestinationInstance, rStartNumbering ) )
{
SvxNumBulletItem aNewNumBulletItem( *pNumBulletItem );
SvxNumRule* pRule = aNewNumBulletItem.GetNumRule();
diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx
index c649ab43ad..27f5b60438 100644
--- a/svx/source/table/tablerow.cxx
+++ b/svx/source/table/tablerow.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: tablerow.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.148.1 $
*
* This file is part of OpenOffice.org.
*
@@ -129,36 +129,15 @@ void TableRow::insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::it
throwIfDisposed();
if( nCount )
{
- if( nIndex < static_cast< sal_Int32 >( maCells.size() ) )
- {
- CellVector::iterator aIter( maCells.begin() );
- while( nIndex-- )
- aIter++;
- while( nCount-- )
- {
- CellRef xCell;
- if( pIter )
- xCell = (*(*pIter)++);
- else
- xCell = mxTableModel->createCell();
-
- maCells.insert( aIter, xCell );
- }
- }
+ if( nIndex >= static_cast< sal_Int32 >( maCells.size() ) )
+ nIndex = static_cast< sal_Int32 >( maCells.size() );
+ if ( pIter )
+ maCells.insert( maCells.begin() + nIndex, *pIter, (*pIter) + nCount );
else
{
- nIndex = static_cast< sal_Int32 >( maCells.size() );
- maCells.resize( nIndex + nCount );
- while(nCount--)
- {
- CellRef xCell;
- if( pIter )
- xCell = (*(*pIter)++);
- else
- xCell = mxTableModel->createCell();
-
- maCells[nIndex++] = xCell;
- }
+ maCells.reserve( maCells.size() + nCount );
+ for ( sal_Int32 i = 0; i < nCount; i++ )
+ maCells.insert( maCells.begin() + nIndex + i, mxTableModel->createCell() );
}
}
}