summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-02 16:49:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-02 18:23:31 +0000
commit012607dc600d85553f5a1db68ae9c36797000474 (patch)
tree411d1023ee47384a7d587fade1674db472fb28ae /sw/source/filter/ww8
parentb6ac3a95570a1e648e030994c33a5a6c570e266c (diff)
unwind the casts to initial entry points
Change-Id: Id8d90569c079a753314ba88b419de9a08b0b6a8b
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx23
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx5
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx3
-rw-r--r--sw/source/filter/ww8/ww8par.hxx3
4 files changed, 14 insertions, 20 deletions
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index d5f0ae026ef1..acb862bc6f1f 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1310,13 +1310,8 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr)
}
}
-void WW8Export::WriteSdrTextObj(const SdrObject& rObj, sal_uInt8 nTyp)
+void WW8Export::WriteSdrTextObj(const SdrTextObj& rTxtObj, sal_uInt8 nTyp)
{
- const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, &rObj);
- OSL_ENSURE(pTxtObj, "That is no SdrTextObj!");
- if (!pTxtObj)
- return;
-
const OutlinerParaObject* pParaObj = 0;
bool bOwnParaObj = false;
@@ -1325,14 +1320,14 @@ void WW8Export::WriteSdrTextObj(const SdrObject& rObj, sal_uInt8 nTyp)
When the object is actively being edited, that text is not set into
the objects normal text object, but lives in a separate object.
*/
- if (pTxtObj->IsTextEditActive())
+ if (rTxtObj.IsTextEditActive())
{
- pParaObj = pTxtObj->GetEditOutlinerParaObject();
+ pParaObj = rTxtObj.GetEditOutlinerParaObject();
bOwnParaObj = true;
}
else
{
- pParaObj = pTxtObj->GetOutlinerParaObject();
+ pParaObj = rTxtObj.GetOutlinerParaObject();
}
if( pParaObj )
@@ -3112,23 +3107,19 @@ bool SwMSConvertControls::ReadOCXStream( SotStorageRef& rSrc1,
return bRes;
}
-bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pObj)
+bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrUnoObj& rFormObj)
{
if (!rWW8Wrt.bWrtWW8)
return false;
- const SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObj);
- assert(pFormObj);
- if (!pFormObj)
- return false;
uno::Reference< awt::XControlModel > xControlModel =
- pFormObj->GetUnoControlModel();
+ rFormObj.GetUnoControlModel();
//Why oh lord do we use so many different units ?
//I think I painted myself into a little bit of a
//corner by trying to use the uno interface for
//controls export
- Rectangle aRect = pFormObj->GetLogicRect();
+ Rectangle aRect = rFormObj.GetLogicRect();
aRect.SetPos(Point(0,0));
awt::Size aSize;
aSize.Width = TWIPS_TO_MM(aRect.Right());
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 74134b364c4e..b46f2b4cd78e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -30,6 +30,7 @@
#include <editeng/fontitem.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdotext.hxx>
+#include <svx/svdouno.hxx>
#include <svx/fmglob.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/lrspitem.hxx>
@@ -2165,11 +2166,11 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
{
sal_uInt8 nOldTyp = rWrt.nTxtTyp;
rWrt.nTxtTyp = nTTyp;
- rWrt.GetOCXExp().ExportControl(rWrt,&rObj);
+ rWrt.GetOCXExp().ExportControl(rWrt, dynamic_cast<const SdrUnoObj&>(rObj));
rWrt.nTxtTyp = nOldTyp;
}
else if( rObj.ISA( SdrTextObj ) )
- rWrt.WriteSdrTextObj(rObj, nTTyp);
+ rWrt.WriteSdrTextObj(dynamic_cast<const SdrTextObj&>(rObj), nTTyp);
else
{
const SwFrmFmt* pFmt = ::FindFrmFmt( &rObj );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 347852192e3c..a02906379386 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -61,6 +61,7 @@ class DateTime;
namespace vcl { class Font; }
class MSWordExportBase;
class SdrObject;
+class SdrTextObj;
class SfxItemSet;
class SvStream;
class SvxFontItem;
@@ -1038,7 +1039,7 @@ public:
void AppendFlyInFlys(const sw::Frame& rFrmFmt, const Point& rNdTopLeft);
void WriteOutliner(const OutlinerParaObject& rOutliner, sal_uInt8 nTyp);
- void WriteSdrTextObj(const SdrObject& rObj, sal_uInt8 nTyp);
+ void WriteSdrTextObj(const SdrTextObj& rObj, sal_uInt8 nTyp);
sal_uInt32 GetSdrOrdNum( const SwFrmFmt& rFmt ) const;
void CreateEscher();
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index da3610bb6e37..ca6b5face7ae 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -89,6 +89,7 @@ class SdrModel;
class SdrPage;
class SdrObject;
class SdrTextObj;
+class SdrUnoObj;
class Size;
class EditEngine;
struct SwPosition;
@@ -749,7 +750,7 @@ public:
const ::com::sun::star::awt::Size& rSize,
com::sun::star::uno::Reference <
com::sun::star::drawing::XShape > *pShape, bool bFloatingCtrl) SAL_OVERRIDE;
- bool ExportControl(WW8Export &rWrt, const SdrObject *pObj);
+ bool ExportControl(WW8Export &rWrt, const SdrUnoObj& rFormObj);
bool ReadOCXStream( SotStorageRef& rSrc1,
com::sun::star::uno::Reference<
com::sun::star::drawing::XShape > *pShapeRef=0,