summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-11-02 14:21:10 +0000
committerOliver Bolte <obo@openoffice.org>2009-11-02 14:21:10 +0000
commit723710e4fab68e780e581fd0fa45078d123daa25 (patch)
tree14150372bc36d7752067a8465521f18b35d1ee71
parent5bf7514b7a464c01e2bb874f5312f8ad66c88395 (diff)
CWS-TOOLING: integrate CWS impress180
2009-10-28 13:52:06 +0100 cl r277241 : #i106146# fixed also the other 5 occourences of the same buggy code 2009-10-22 13:02:37 +0200 sj r277114 : #i106130# fixed crash accessing already deleted shape 2009-10-22 11:42:03 +0200 cl r277113 : #i106146# do not crash if there is no numbering rule in itemset 2009-10-20 13:37:58 +0200 sj r277049 : #i102257# fixed gpf when loading some types of pict graphics 2009-10-20 13:13:10 +0200 af r277046 : #i105895# Prevent old view shell from being deleted too early.
-rw-r--r--svx/inc/svx/svdfppt.hxx2
-rw-r--r--svx/source/cui/numpages.cxx92
-rw-r--r--svx/source/msfilter/msdffimp.cxx23
-rw-r--r--svx/source/svdraw/svdfppt.cxx11
4 files changed, 55 insertions, 73 deletions
diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx
index dba9f72cf6..048fb5dba8 100644
--- a/svx/inc/svx/svdfppt.hxx
+++ b/svx/inc/svx/svdfppt.hxx
@@ -610,7 +610,7 @@ public:
UINT32& nMappedFontId, Font& rFont, char nDefault ) const;
const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; }
virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
- SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* ) const;
+ SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* );
};
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/cui/numpages.cxx b/svx/source/cui/numpages.cxx
index a9ba8c61cb..ce2ae1563f 100644
--- a/svx/source/cui/numpages.cxx
+++ b/svx/source/cui/numpages.cxx
@@ -378,18 +378,12 @@ int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -570,17 +564,12 @@ int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
@@ -800,17 +789,12 @@ int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxNumPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
if(!pActNum)
@@ -1105,17 +1089,12 @@ BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet )
void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -1537,17 +1516,12 @@ BOOL SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// Ebenen einfuegen
if(!aLevelLB.GetEntryCount())
@@ -1591,6 +1565,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
pPreviewWIN->SetNumRule(pActNum);
aSameLevelCB.Check(pActNum->IsContinuousNumbering());
+ const SfxPoolItem* pItem = 0;
//ColorListBox bei Bedarf fuellen
if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) )
{
@@ -3434,17 +3409,12 @@ BOOL SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// Ebenen einfuegen
if(!aLevelLB.GetEntryCount())
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index dbee37d04b..63ad774409 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -5016,16 +5016,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
ApplyAttributes( rSt, aSet, aObjData );
pRet->SetMergedItemSet(aSet);
}
- else if ( aObjData.eShapeType == mso_sptLine )
- {
- basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
- pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
- pRet->SetModel( pSdrModel );
- ApplyAttributes( rSt, aSet, aObjData );
- pRet->SetMergedItemSet(aSet);
- }
+ else if ( aObjData.eShapeType == mso_sptLine )
+ {
+ basegfx::B2DPolygon aPoly;
+ aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
+ aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
+ pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
+ pRet->SetModel( pSdrModel );
+ ApplyAttributes( rSt, aSet, aObjData );
+ pRet->SetMergedItemSet(aSet);
+ }
else
{
if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )
@@ -7099,6 +7099,8 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
aZCodec.Decompress( rBLIPStream, *pOut );
aZCodec.EndCompression();
pOut->Seek( STREAM_SEEK_TO_BEGIN );
+ pOut->SetResizeOffset( 0 ); // sj: #i102257# setting ResizeOffset of 0 prevents from seeking
+ // behind the stream end (allocating too much memory)
pGrStream = pOut;
}
@@ -8184,6 +8186,7 @@ void SvxMSDffManager::removeShapeId( SdrObject* pShape )
maShapeIdContainer.erase( aIter );
break;
}
+ aIter++;
}
}
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index dbf535ba0a..3229c6d463 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -7662,7 +7662,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
}
}
-SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer ) const
+SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer )
{
SdrObject* pRet = pGroup;
sal_uInt32 nRows = pTableArry[ 1 ];
@@ -7786,6 +7786,15 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
pTable->uno_unlock();
pTable->SetSnapRect( pGroup->GetSnapRect() );
pRet = pTable;
+
+ //Remove Objects from shape map
+ SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS );
+ while( aIter.IsMore() )
+ {
+ SdrObject* pPartObj = aIter.Next();
+ removeShapeId( pPartObj );
+ }
+
SdrObject::Free( pGroup );
}
catch( Exception& )