summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-10-04 18:20:04 +0000
committerKurt Zenker <kz@openoffice.org>2004-10-04 18:20:04 +0000
commita395750c906b28b971f320da463ea254b8ed8e84 (patch)
tree60e9c66d2a86c7d11719976f0ffd7b9670263b07 /sw/source/filter/ww8
parent7f4896417370cffc9970152f5963893261875e9b (diff)
INTEGRATION: CWS mav09 (1.45.34); FILE MERGED
2004/09/21 17:13:49 mav 1.45.34.4: RESYNC: (1.46-1.47); FILE MERGED 2004/07/15 13:04:52 mba 1.45.34.3: #i27773#: cleaning up todos: scaling in inplace mode, update chart after resizing and some more 2004/07/08 11:40:17 mav 1.45.34.2: RESYNC: (1.45-1.46); FILE MERGED 2004/05/18 16:51:36 mba 1.45.34.1: #i27773#: remove so3
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx60
1 files changed, 32 insertions, 28 deletions
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 8b6e51bd0957..4d118d2ea4f0 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ww8par4.cxx,v $
*
- * $Revision: 1.47 $
+ * $Revision: 1.48 $
*
- * last change: $Author: rt $ $Date: 2004-09-20 15:20:59 $
+ * last change: $Author: kz $ $Date: 2004-10-04 19:20:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,6 +69,10 @@
#include "writerhelper.hxx"
#endif
+#ifndef _COM_SUN_STAR_EMBED_XCLASSIFIEDOBJECT_HPP_
+#include <com/sun/star/embed/XClassifiedObject.hpp>
+#endif
+
#ifndef __SGI_STL_ALGORITHM
#include <algorithm>
#endif
@@ -84,9 +88,7 @@
#include <tools/solar.h>
#endif
-#ifndef _SVSTOR_HXX
-#include <so3/svstor.hxx>
-#endif
+#include <sot/storage.hxx>
#ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_
#include <com/sun/star/drawing/XShape.hpp>
@@ -156,9 +158,6 @@
#ifndef _SHELLIO_HXX
#include <shellio.hxx>
#endif
-#ifndef _SW3IO_HXX
-#include <sw3io.hxx>
-#endif
#ifndef _NDOLE_HXX
#include <ndole.hxx>
#endif
@@ -202,7 +201,7 @@ static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1)
// 0x2c, 0x30 Skalierung x,y in Promille
// 0x34, 0x38, 0x3c, 0x40 Crop Left, Top, Right, Bot in tw
- SvStorageStreamRef xSrc3 = rSrc1->OpenStream( CREATE_CONST_ASC( "\3PIC" ),
+ SvStorageStreamRef xSrc3 = rSrc1->OpenSotStream( CREATE_CONST_ASC( "\3PIC" ),
STREAM_STD_READ | STREAM_NOCREATE);
SvStorageStream* pS = xSrc3;
pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -247,7 +246,7 @@ static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1)
static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
SvStorageRef& rSrc1)
{
- SvStorageStreamRef xSrc2 = rSrc1->OpenStream( CREATE_CONST_ASC("\3META"),
+ SvStorageStreamRef xSrc2 = rSrc1->OpenSotStream( CREATE_CONST_ASC("\3META"),
STREAM_STD_READ | STREAM_NOCREATE);
SvStorageStream* pSt = xSrc2;
pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -303,7 +302,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
static bool SwWw6ReadMacPICTStream(Graphic& rGraph, SvStorageRef& rSrc1)
{
// 03-META-Stream nicht da. Vielleicht ein 03-PICT ?
- SvStorageStreamRef xSrc4 = rSrc1->OpenStream( CREATE_CONST_ASC( "\3PICT" ));
+ SvStorageStreamRef xSrc4 = rSrc1->OpenSotStream( CREATE_CONST_ASC( "\3PICT" ));
SvStorageStream* pStp = xSrc4;
pStp->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
BYTE aTestA[10]; // Ist der 01Ole-Stream ueberhaupt vorhanden
@@ -328,7 +327,7 @@ static bool SwWw6ReadMacPICTStream(Graphic& rGraph, SvStorageRef& rSrc1)
SwFlyFrmFmt* SwWW8ImplReader::InsertOle(SdrOle2Obj &rObject,
const SfxItemSet &rFlySet, const SfxItemSet &rGrfSet)
{
- SvPersist *pPersist = rDoc.GetPersist();
+ SfxObjectShell *pPersist = rDoc.GetPersist();
ASSERT(pPersist, "No persist, cannot insert objects correctly");
if (!pPersist)
return 0;
@@ -336,24 +335,30 @@ SwFlyFrmFmt* SwWW8ImplReader::InsertOle(SdrOle2Obj &rObject,
SwFlyFrmFmt *pRet = 0;
SfxItemSet *pMathFlySet = 0;
- if (SotExchange::IsMath(*rObject.GetObjRef()->GetSvFactory()))
+ com::sun::star::uno::Reference < com::sun::star::embed::XClassifiedObject > xClass( rObject.GetObjRef(), com::sun::star::uno::UNO_QUERY );
+ if( xClass.is() )
{
- /*
- StarMath sets it own fixed size, so its counter productive to use the
- size word says it is. i.e. Don't attempt to override its size.
- */
- pMathFlySet = new SfxItemSet(rFlySet);
- pMathFlySet->ClearItem(RES_FRM_SIZE);
+ SvGlobalName aClassName( xClass->getClassID() );
+ if (SotExchange::IsMath(aClassName))
+ {
+ /*
+ StarMath sets it own fixed size, so its counter productive to use the
+ size word says it is. i.e. Don't attempt to override its size.
+ */
+ pMathFlySet = new SfxItemSet(rFlySet);
+ pMathFlySet->ClearItem(RES_FRM_SIZE);
+ }
}
- String sNewName = Sw3Io::UniqueName(mpDocShell->GetStorage(),"Obj");
-
/*
Take complete responsibility of the object away from SdrOle2Obj and to
me here locally. This utility class now owns the object.
*/
- sw::hack::DrawingOLEAdaptor aOLEObj(rObject, *pPersist);
+ // TODO/MBA: is the object inserted multiple times here? Testing!
+ // And is it a problem that we now use the same naming scheme as in the other apps?
+ sw::hack::DrawingOLEAdaptor aOLEObj(rObject, *pPersist);
+ ::rtl::OUString sNewName;
bool bSuccess = aOLEObj.TransferToDoc(sNewName);
ASSERT(bSuccess, "Insert OLE failed");
@@ -471,7 +476,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
// ergibt Name "_4711"
aSrcStgName += String::CreateFromInt32( nObjLocFc );
- SvStorageRef xSrc0 = pStg->OpenStorage(CREATE_CONST_ASC(SL::aObjectPool));
+ SvStorageRef xSrc0 = pStg->OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool));
if (pGrf)
{
@@ -483,7 +488,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
}
else
{
- SvStorageRef xSrc1 = xSrc0->OpenStorage( aSrcStgName,
+ SvStorageRef xSrc1 = xSrc0->OpenSotStorage( aSrcStgName,
STREAM_READWRITE| STREAM_SHARE_DENYALL );
GDIMetaFile aWMF;
@@ -514,7 +519,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
}
}
- SvStorageRef xSrc1 = xSrc0->OpenStorage( aSrcStgName,
+ SvStorageRef xSrc1 = xSrc0->OpenSotStorage( aSrcStgName,
STREAM_READWRITE| STREAM_SHARE_DENYALL );
if (!(bIsHeader || bIsFooter))
@@ -548,10 +553,9 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
pTmpData->Seek( nObjLocFc );
}
- SvStorageRef xDst0(mpDocShell->GetStorage());
-
+ ErrCode nError = ERRCODE_NONE;
pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
- aSrcStgName, xSrc0, xDst0, rGraph, aRect, pTmpData,
+ aSrcStgName, xSrc0, mpDocShell->GetStorage(), rGraph, aRect, pTmpData, nError,
SwMSDffManager::GetFilterFlags());
pDataStream->Seek( nOldPos );
}