extensions/source/propctrlr/genericpropertyhandler.cxx |    3 +-
 extensions/source/propctrlr/genericpropertyhandler.hxx |    2 -
 formula/source/ui/dlg/funcutl.cxx                      |   24 -----------------
 include/formula/funcutl.hxx                            |    5 ---
 l10ntools/source/export.cxx                            |    2 -
 sc/source/filter/xml/xmlfonte.cxx                      |    9 +-----
 sc/source/ui/unoobj/exceldetect.cxx                    |   18 +++++++++---
 sd/source/core/sdpage.cxx                              |    2 -
 sd/source/ui/func/fuinsfil.cxx                         |    2 -
 sd/source/ui/unoidl/unoobj.cxx                         |    4 +-
 starmath/source/node.cxx                               |    2 -
 starmath/source/parse.cxx                              |    4 +-
 starmath/source/smdetect.cxx                           |   24 ++++++++++++-----
 svtools/source/contnr/imivctl2.cxx                     |   13 +++++----
 svx/source/unogallery/unogalitem.cxx                   |    7 ++--
 svx/source/unogallery/unogalitem.hxx                   |    2 -
 sw/inc/IDocumentDrawModelAccess.hxx                    |   10 +++----
 sw/source/core/access/accmap.cxx                       |    1 
 sw/source/core/doc/DocumentDeviceManager.cxx           |    1 
 sw/source/core/doc/DocumentDrawModelManager.cxx        |   10 +++----
 sw/source/core/doc/DocumentSettingManager.cxx          |    1 
 sw/source/core/doc/docfly.cxx                          |    1 
 sw/source/core/doc/doclay.cxx                          |    1 
 sw/source/core/docnode/nodedump.cxx                    |    1 
 sw/source/core/draw/dcontact.cxx                       |    1 
 sw/source/core/frmedt/feshview.cxx                     |    1 
 sw/source/core/inc/DocumentDrawModelManager.hxx        |   12 ++++----
 sw/source/core/layout/fly.cxx                          |    1 
 sw/source/core/layout/frmtool.cxx                      |    1 
 sw/source/core/layout/newfrm.cxx                       |    1 
 sw/source/core/layout/paintfrm.cxx                     |    1 
 sw/source/core/text/itrform2.cxx                       |    5 +--
 sw/source/core/undo/docundo.cxx                        |    1 
 sw/source/core/undo/unattr.cxx                         |    1 
 sw/source/core/unocore/unodraw.cxx                     |    1 
 sw/source/core/unocore/unoframe.cxx                    |    1 
 sw/source/core/view/vdraw.cxx                          |    1 
 sw/source/core/view/viewimp.cxx                        |    1 
 sw/source/core/view/viewsh.cxx                         |    1 
 sw/source/filter/html/htmldrawreader.cxx               |    1 
 sw/source/filter/writer/writer.cxx                     |   16 ++++++++---
 sw/source/filter/ww8/docxsdrexport.cxx                 |    1 
 sw/source/filter/ww8/rtfattributeoutput.cxx            |    1 
 sw/source/filter/ww8/wrtw8esh.cxx                      |    1 
 sw/source/filter/ww8/wrtww8.cxx                        |    1 
 sw/source/filter/ww8/ww8graf.cxx                       |    1 
 sw/source/filter/xml/swxml.cxx                         |    1 
 sw/source/filter/xml/xmlexp.cxx                        |    1 
 sw/source/filter/xml/xmlimp.cxx                        |    1 
 sw/source/uibase/app/docshdrw.cxx                      |    1 
 sw/source/uibase/app/docstyle.cxx                      |    1 
 sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx   |    1 
 sw/source/uibase/lingu/sdrhhcwrap.cxx                  |    1 
 sw/source/uibase/shells/drwbassh.cxx                   |    1 
 sw/source/uibase/shells/frmsh.cxx                      |    1 
 sw/source/uibase/shells/grfsh.cxx                      |    1 
 sw/source/uibase/shells/grfshex.cxx                    |    1 
 sw/source/uibase/uno/unodefaults.cxx                   |    2 -
 sw/source/uibase/uno/unotxdoc.cxx                      |   12 ++++----
 sw/source/uibase/utlui/content.cxx                     |    1 
 unusedcode.easy                                        |    2 -
 61 files changed, 130 insertions(+), 99 deletions(-)

New commits:
commit cf309ee274fad755de1b53b40bc1d2b112f16171
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 10:24:08 2014 +0100

    coverity#704771 Explicit null dereferenced
    
    Change-Id: I653866006a54f5bc73dae4614b0b9c8ddfeb4989

diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 2305df2..bb2411b 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -775,9 +775,9 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& 
aPropertyName, const :
         case WID_BOOKMARK:
         {
             OUString aString;
-            if( pInfo )
+            SdDrawDocument* pDoc = mpModel ? mpModel->GetDoc() : NULL;
+            if (pInfo && pDoc)
             {
-                SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL;
                 // is the bookmark a page?
                 bool bIsMasterPage;
                 if(pDoc->GetPageByName( pInfo->GetBookmark(), bIsMasterPage ) 
!= SDRPAGE_NOTFOUND)
commit 4e6c9caf4a131baf8c1fe15267b43f22ff7c1660
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 10:13:36 2014 +0100

    coverity#988426 Explicit null dereferenced
    
    Change-Id: I76d1764c6bdce565705e87ae88e3eccc1c3a617e

diff --git a/sc/source/filter/xml/xmlfonte.cxx 
b/sc/source/filter/xml/xmlfonte.cxx
index 3ae2821..82f1ca4 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -81,17 +81,12 @@ 
ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP,
     sal_uInt16 aPageWhichIds[4] = { ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERLEFT,
                                     ATTR_PAGE_HEADERRIGHT, 
ATTR_PAGE_FOOTERRIGHT };
 
-    const SfxItemPool* pItemPool(rExportP.GetDocument() ? 
rExportP.GetDocument()->GetPool() : NULL);
+    const SfxItemPool* pItemPool(rExportP.GetDocument()->GetPool());
     AddFontItems(aWhichIds, 3, pItemPool, true);
     const SfxItemPool* pEditPool(rExportP.GetDocument()->GetEditPool());
     AddFontItems(aEditWhichIds, 3, pEditPool, false);
 
-    SfxStyleSheetIteratorPtr pItr;
-
-    if(rExportP.GetDocument())
-    {
-        pItr = 
rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SFX_STYLE_FAMILY_PAGE,
 0xFFFF);
-    }
+    SfxStyleSheetIteratorPtr pItr = 
rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SFX_STYLE_FAMILY_PAGE,
 0xFFFF);
 
     if(pItr)
     {
commit ea98e70e916372a2cb1a3504c74c9d1ab4020dcc
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 10:06:03 2014 +0100

    coverity#983931 Uncaught exception
    
    Change-Id: I9fef42b9a6540a549d6a28928b982671f07f9fe6

diff --git a/svx/source/unogallery/unogalitem.cxx 
b/svx/source/unogallery/unogalitem.cxx
index cbffcd4..f469953 100644
--- a/svx/source/unogallery/unogalitem.cxx
+++ b/svx/source/unogallery/unogalitem.cxx
@@ -250,13 +250,12 @@ sal_Int8 SAL_CALL GalleryItem::getType()
     return pRet;
 }
 
-
-
 void GalleryItem::_setPropertyValues( const comphelper::PropertyMapEntry** 
ppEntries, const uno::Any* pValues )
-    throw( beans::UnknownPropertyException,
+    throw (beans::UnknownPropertyException,
            beans::PropertyVetoException,
            lang::IllegalArgumentException,
-           lang::WrappedTargetException )
+           lang::WrappedTargetException,
+           uno::RuntimeException)
 {
     const SolarMutexGuard aGuard;
 
diff --git a/svx/source/unogallery/unogalitem.hxx 
b/svx/source/unogallery/unogalitem.hxx
index 6449cc4..7f60ad8 100644
--- a/svx/source/unogallery/unogalitem.hxx
+++ b/svx/source/unogallery/unogalitem.hxx
@@ -76,7 +76,7 @@ protected:
     virtual ::sal_Int8 SAL_CALL getType(  ) throw 
(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
     // PropertySetHelper
-    virtual void _setPropertyValues( const comphelper::PropertyMapEntry** 
ppEntries, const ::com::sun::star::uno::Any* pValues ) 
throw(::com::sun::star::beans::UnknownPropertyException, 
::com::sun::star::beans::PropertyVetoException, 
::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::lang::WrappedTargetException ) SAL_OVERRIDE;
+    virtual void _setPropertyValues( const comphelper::PropertyMapEntry** 
ppEntries, const ::com::sun::star::uno::Any* pValues ) 
throw(::com::sun::star::beans::UnknownPropertyException, 
::com::sun::star::beans::PropertyVetoException, 
::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::lang::WrappedTargetException, css::uno::RuntimeException ) 
SAL_OVERRIDE;
     virtual void _getPropertyValues( const comphelper::PropertyMapEntry** 
ppEntries, ::com::sun::star::uno::Any* pValue )
         throw (css::beans::UnknownPropertyException,
                css::lang::WrappedTargetException,
commit d176340628b55ad859d63c9b769822fd9467863e
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 10:00:09 2014 +0100

    coverity#983728 Uncaught exception
    
    Change-Id: Ifa6f0bf05e9a71aa3db6c63291f99dc0665e57bf

diff --git a/sc/source/ui/unoobj/exceldetect.cxx 
b/sc/source/ui/unoobj/exceldetect.cxx
index 3f56fa4..40ea9be 100644
--- a/sc/source/ui/unoobj/exceldetect.cxx
+++ b/sc/source/ui/unoobj/exceldetect.cxx
@@ -58,14 +58,24 @@ bool hasStream(const uno::Reference<io::XInputStream>& 
xInStream, const OUString
     pStream->Seek(0);
 
     if (!nSize)
+    {
         // 0-size stream.  Failed.
         return false;
+    }
 
-    SotStorageRef xStorage = new SotStorage(pStream, false);
-    if (!xStorage.Is() || xStorage->GetError())
-        return false;
+    try
+    {
+        SotStorageRef xStorage = new SotStorage(pStream, false);
+        if (!xStorage.Is() || xStorage->GetError())
+            return false;
+        return xStorage->IsStream(rName);
+    }
+    catch (const css::ucb::ContentCreationException &e)
+    {
+        SAL_WARN("sc", "hasStream caught " << e.Message);
+    }
 
-    return xStorage->IsStream(rName);
+    return false;
 }
 
 /**
commit 71293087a5121c5553e6e95bb8da2ec954e22e55
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:57:49 2014 +0100

    coverity#707363 Uncaught exception
    
    Change-Id: I0c61a0176bb108e8e42c56e6cdbfa342ffe2512f

diff --git a/sw/source/filter/writer/writer.cxx 
b/sw/source/filter/writer/writer.cxx
index be1cfe6..ec2afb5 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -245,10 +245,18 @@ sal_uLong Writer::Write( SwPaM& rPaM, SvStream& rStrm, 
const OUString* pFName )
 {
     if ( IsStgWriter() )
     {
-        SotStorageRef aRef = new SotStorage( rStrm );
-        sal_uLong nResult = Write( rPaM, *aRef, pFName );
-        if ( nResult == ERRCODE_NONE )
-            aRef->Commit();
+        sal_uLong nResult = ERRCODE_ABORT;
+        try
+        {
+            SotStorageRef aRef = new SotStorage( rStrm );
+            nResult = Write( rPaM, *aRef, pFName );
+            if ( nResult == ERRCODE_NONE )
+                aRef->Commit();
+        }
+        catch (const css::ucb::ContentCreationException &e)
+        {
+            SAL_WARN("sw", "SmFilterDetect::detect caught " << e.Message);
+        }
         return nResult;
     }
 
commit bf89444ca8e7a544056a2162fc48dae43b05f9d2
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:53:41 2014 +0100

    coverity#707196 Uncaught exception
    
    Change-Id: I4f42040c7e12507365f12d09f80d3641b4d5ca02

diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index 51a8f42..27982f9 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -66,17 +66,27 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< 
PropertyValue >& lDescriptor
     if ( pInStrm->remainingSize() == 0 )
         return OUString();
 
-    SotStorageRef aStorage = new SotStorage( pInStrm, false );
-    if ( !aStorage->GetError() )
+    bool bStorageOk = false;
+    try
     {
-        if ( aStorage->IsStream("Equation Native") )
+        SotStorageRef aStorage = new SotStorage( pInStrm, false );
+        bStorageOk = !aStorage->GetError();
+        if (bStorageOk)
         {
-            sal_uInt8 nVersion;
-            if ( GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3 )
-                return OUString("math_MathType_3x");
+            if ( aStorage->IsStream("Equation Native") )
+            {
+                sal_uInt8 nVersion;
+                if ( GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3 )
+                    return OUString("math_MathType_3x");
+            }
         }
     }
-    else
+    catch (const css::ucb::ContentCreationException &e)
+    {
+        SAL_WARN("starmath", "SmFilterDetect::detect caught " << e.Message);
+    }
+
+    if (!bStorageOk)
     {
         // 200 should be enough for the XML
         // version, encoding and !DOCTYPE
commit c12a299784bbfc7c6806c076f8e4daa9f345e1c1
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:37:32 2014 +0100

    coverity#706525 Uncaught exception
    
    Change-Id: I2b48e88a1041823f825f4c7e00db74285aaae39d

diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx 
b/extensions/source/propctrlr/genericpropertyhandler.cxx
index 15d78f4..e29196b 100644
--- a/extensions/source/propctrlr/genericpropertyhandler.cxx
+++ b/extensions/source/propctrlr/genericpropertyhandler.cxx
@@ -439,7 +439,8 @@ namespace pcr
         return eState;
     }
 
-    void SAL_CALL GenericPropertyHandler::addPropertyChangeListener( const 
Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException, 
std::exception)
+    void SAL_CALL GenericPropertyHandler::addPropertyChangeListener(const 
Reference< XPropertyChangeListener >& _rxListener)
+        throw (NullPointerException, RuntimeException, std::exception)
     {
         if ( !_rxListener.is() )
             throw NullPointerException();
diff --git a/extensions/source/propctrlr/genericpropertyhandler.hxx 
b/extensions/source/propctrlr/genericpropertyhandler.hxx
index 652d18d..fde5d9b 100644
--- a/extensions/source/propctrlr/genericpropertyhandler.hxx
+++ b/extensions/source/propctrlr/genericpropertyhandler.hxx
@@ -100,7 +100,7 @@ namespace pcr
         virtual ::com::sun::star::uno::Any                          SAL_CALL 
convertToPropertyValue( const OUString& _rPropertyName, const 
::com::sun::star::uno::Any& _rControlValue ) throw 
(::com::sun::star::beans::UnknownPropertyException, 
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::uno::Any                          SAL_CALL 
convertToControlValue( const OUString& _rPropertyName, const 
::com::sun::star::uno::Any& _rPropertyValue, const ::com::sun::star::uno::Type& 
_rControlValueType ) throw (::com::sun::star::beans::UnknownPropertyException, 
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::beans::PropertyState              SAL_CALL 
getPropertyState( const OUString& _rPropertyName ) throw 
(::com::sun::star::beans::UnknownPropertyException, 
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-        virtual void                                                SAL_CALL 
addPropertyChangeListener( const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw 
(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+        virtual void                                                SAL_CALL 
addPropertyChangeListener( const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw 
(::com::sun::star::lang::NullPointerException, 
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual void                                                SAL_CALL 
removePropertyChangeListener( const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw 
(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::uno::Sequence< 
::com::sun::star::beans::Property >
                                                                     SAL_CALL 
getSupportedProperties() throw (::com::sun::star::uno::RuntimeException, 
std::exception) SAL_OVERRIDE;
commit 9c883e6a27a6c6cccc17f6ed77520d9073d10693
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:24:35 2014 +0100

    coverity#1019333 Explicit null dereferenced
    
    Change-Id: I3ac21f8613558cb0413f405287cdd394f3facf02

diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index d3d4cfb..6f8c8b8 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -637,7 +637,7 @@ int Export::Execute( int nToken, const char * pToken )
         case RSCDEFINELEND:
         break;
         case CONDITION: {
-            if ( nLevel ) {
+            if ( nLevel && pResData ) {
                 WriteData( pResData, true );
             }
         }
commit 0766b83a2b461a73bd5574019fae5fd3ac0ff37f
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:18:42 2014 +0100

    coverity#735837 Explicit null dereferenced
    
    Change-Id: Idaf39928e4f48f8cf823de22e2ded995046624fc

diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index a22e877..6ba1ebe 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -567,7 +567,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
     Paragraph* pPara = aSelList.empty() ? NULL : *(aSelList.begin());
 
     // what should we insert?
-    while( !pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
+    while (pPara && !pDocliner->HasParaFlag(pPara, PARAFLAG_ISPAGE))
         pPara = pDocliner->GetParent(pPara);
 
     sal_Int32 nTargetPos = pDocliner->GetAbsPos(pPara) + 1;
commit 67820a90370513cd65cd7f042c1d0dea6fb0965f
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:15:04 2014 +0100

    coverity#705037 Unchecked dynamic_cast
    
    Change-Id: I9f6c8ceafd09b4a5d4e951e01e1a06b2b5265181

diff --git a/sw/inc/IDocumentDrawModelAccess.hxx 
b/sw/inc/IDocumentDrawModelAccess.hxx
index 4c76292..ad8415a 100644
--- a/sw/inc/IDocumentDrawModelAccess.hxx
+++ b/sw/inc/IDocumentDrawModelAccess.hxx
@@ -22,7 +22,7 @@
 
 #include <svx/svdtypes.hxx>
 
-class SdrModel;
+class SwDrawDocument;
 class SdrPageView;
 
 class IDocumentDrawModelAccess
@@ -31,10 +31,10 @@ public:
 
     /** Draw Model and id accessors
      */
-    virtual const SdrModel* GetDrawModel() const = 0;
-    virtual SdrModel* GetDrawModel() = 0;
-    virtual SdrModel* _MakeDrawModel() = 0;
-    virtual SdrModel* GetOrCreateDrawModel() = 0;
+    virtual const SwDrawDocument* GetDrawModel() const = 0;
+    virtual SwDrawDocument* GetDrawModel() = 0;
+    virtual SwDrawDocument* _MakeDrawModel() = 0;
+    virtual SwDrawDocument* GetOrCreateDrawModel() = 0;
     virtual SdrLayerID GetHeavenId() const = 0;
     virtual SdrLayerID GetHellId() const = 0;
     virtual SdrLayerID GetControlsId() const = 0;
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 33ebb32..ae46e24 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -65,6 +65,7 @@
 #include <svx/unoapi.hxx>
 #include <svx/svdmark.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
 #include <dflyobj.hxx>
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx 
b/sw/source/core/doc/DocumentDeviceManager.cxx
index aabfd96..f1b76a4 100644
--- a/sw/source/core/doc/DocumentDeviceManager.cxx
+++ b/sw/source/core/doc/DocumentDeviceManager.cxx
@@ -32,6 +32,7 @@
 #include <svl/itemset.hxx>
 #include <svx/svdmodel.hxx>
 #include <cmdid.h>
+#include <drawdoc.hxx>
 #include <wdocsh.hxx>
 #include <prtopt.hxx>
 #include <viewsh.hxx>
diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx 
b/sw/source/core/doc/DocumentDrawModelManager.cxx
index e87ae39..7dc30f9 100644
--- a/sw/source/core/doc/DocumentDrawModelManager.cxx
+++ b/sw/source/core/doc/DocumentDrawModelManager.cxx
@@ -98,7 +98,7 @@ void DocumentDrawModelManager::InitDrawModel()
     m_rSwdoc.GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, 
EE_CHAR_FONTHEIGHT ));
 
     SAL_INFO( "sw.doc", "before create DrawDocument" );
-    // The document owns the SdrModel. We always have two layers and one page.
+    // The document owns the SwDrawDocument. We always have two layers and one 
page.
     mpDrawModel = new SwDrawDocument( &m_rSwdoc );
 
     mpDrawModel->EnableUndo( m_rSwdoc.GetIDocumentUndoRedo().DoesUndo() );
@@ -196,17 +196,17 @@ void DocumentDrawModelManager::ReleaseDrawModel()
 
 
 
-const SdrModel* DocumentDrawModelManager::GetDrawModel() const
+const SwDrawDocument* DocumentDrawModelManager::GetDrawModel() const
 {
     return mpDrawModel;
 }
 
-SdrModel* DocumentDrawModelManager::GetDrawModel()
+SwDrawDocument* DocumentDrawModelManager::GetDrawModel()
 {
     return mpDrawModel;
 }
 
-SdrModel* DocumentDrawModelManager::_MakeDrawModel()
+SwDrawDocument* DocumentDrawModelManager::_MakeDrawModel()
 {
     OSL_ENSURE( !mpDrawModel, "_MakeDrawModel: Why?" );
     InitDrawModel();
@@ -229,7 +229,7 @@ SdrModel* DocumentDrawModelManager::_MakeDrawModel()
     return mpDrawModel;
 }
 
-SdrModel* DocumentDrawModelManager::GetOrCreateDrawModel()
+SwDrawDocument* DocumentDrawModelManager::GetOrCreateDrawModel()
 {
     return GetDrawModel() ? GetDrawModel() : _MakeDrawModel();
 }
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 85f605b..6886d86 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -24,6 +24,7 @@
 #include <editeng/forbiddencharacterstable.hxx>
 #include <svx/svdmodel.hxx>
 #include <unotools/compatibility.hxx>
+#include <drawdoc.hxx>
 #include <swmodule.hxx>
 #include <linkenum.hxx>
 #include <rootfrm.hxx>
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 8418a99..d3982f1 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -35,6 +35,7 @@
 #include <IDocumentDrawModelAccess.hxx>
 #include <ndindex.hxx>
 #include <docary.hxx>
+#include <drawdoc.hxx>
 #include <fmtcntnt.hxx>
 #include <fmtanchr.hxx>
 #include <txtflcnt.hxx>
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 965af9a..9db67c3 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -42,6 +42,7 @@
 #include <modcfg.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <SwStyleNameMapper.hxx>
+#include <drawdoc.hxx>
 #include <fchrfmt.hxx>
 #include <frmatr.hxx>
 #include <txatbase.hxx>
diff --git a/sw/source/core/docnode/nodedump.cxx 
b/sw/source/core/docnode/nodedump.cxx
index adc9a1b..743d749 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "doc.hxx"
+#include "drawdoc.hxx"
 #include <IDocumentDrawModelAccess.hxx>
 #include "ndtxt.hxx"
 #include "MarkManager.hxx"
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2f6dba7..4377594 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -34,6 +34,7 @@
 #include <svx/shapepropertynotifier.hxx>
 #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
 #include <svx/sdr/contact/displayinfo.hxx>
+#include <drawdoc.hxx>
 #include <fmtornt.hxx>
 #include <viewimp.hxx>
 #include <fmtsrnd.hxx>
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 25a76bd..904f901 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -39,6 +39,7 @@
 #include <IDocumentSettingAccess.hxx>
 #include <DocumentSettingManager.hxx>
 #include <cmdid.h>
+#include <drawdoc.hxx>
 #include <poolfmt.hrc>
 #include <frmfmt.hxx>
 #include <frmatr.hxx>
diff --git a/sw/source/core/inc/DocumentDrawModelManager.hxx 
b/sw/source/core/inc/DocumentDrawModelManager.hxx
index 596ee83..d142c71 100644
--- a/sw/source/core/inc/DocumentDrawModelManager.hxx
+++ b/sw/source/core/inc/DocumentDrawModelManager.hxx
@@ -25,7 +25,7 @@
 #include <boost/utility.hpp>
 #include <svx/svdtypes.hxx>
 
-class SdrModel;
+class SwDrawDocument;
 class SdrPageView;
 class SwDoc;
 
@@ -44,10 +44,10 @@ public:
     void DrawNotifyUndoHdl();
 
     //IDocumentDrawModelAccess
-    virtual const SdrModel* GetDrawModel() const SAL_OVERRIDE;
-    virtual SdrModel* GetDrawModel() SAL_OVERRIDE;
-    virtual SdrModel* _MakeDrawModel() SAL_OVERRIDE;
-    virtual SdrModel* GetOrCreateDrawModel() SAL_OVERRIDE;
+    virtual const SwDrawDocument* GetDrawModel() const SAL_OVERRIDE;
+    virtual SwDrawDocument* GetDrawModel() SAL_OVERRIDE;
+    virtual SwDrawDocument* _MakeDrawModel() SAL_OVERRIDE;
+    virtual SwDrawDocument* GetOrCreateDrawModel() SAL_OVERRIDE;
     virtual SdrLayerID GetHeavenId() const SAL_OVERRIDE;
     virtual SdrLayerID GetHellId() const SAL_OVERRIDE;
     virtual SdrLayerID GetControlsId() const SAL_OVERRIDE;
@@ -70,7 +70,7 @@ private:
     SwDoc& m_rSwdoc;
 
 
-    SdrModel* mpDrawModel;
+    SwDrawDocument* mpDrawModel;
 
     /** Draw Model Layer IDs
      * LayerIds, Heaven == above document
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index dfb2d41..306875b 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -24,6 +24,7 @@
 #include <editeng/opaqitem.hxx>
 #include <editeng/ulspitem.hxx>
 #include <editeng/frmdiritem.hxx>
+#include <drawdoc.hxx>
 #include <fmtfsize.hxx>
 #include <fmtclds.hxx>
 #include <fmtcntnt.hxx>
diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 37f6dda..daa1205 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -25,6 +25,7 @@
 #include <editeng/boxitem.hxx>
 #include <editeng/lspcitem.hxx>
 
+#include <drawdoc.hxx>
 #include <fmtornt.hxx>
 #include <fmthdft.hxx>
 #include <fmtfsize.hxx>
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index ee10a0d..4aaa767 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -19,6 +19,7 @@
 
 #include <svx/svdmodel.hxx>
 #include <svx/svdpage.hxx>
+#include <drawdoc.hxx>
 #include <fmtpdsc.hxx>
 #include <swtable.hxx>
 #include <rootfrm.hxx>
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index e5c8604..35634f4 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -28,6 +28,7 @@
 #include <editeng/shaditem.hxx>
 #include <svx/framelink.hxx>
 #include <svx/xflgrit.hxx>
+#include <drawdoc.hxx>
 #include <tgrditem.hxx>
 #include <switerator.hxx>
 #include <fmtsrnd.hxx>
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 9f6c498..845dfb7 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -25,6 +25,7 @@
 
 #include <swmodule.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <ndarr.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 5401023..2f482e3 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -22,6 +22,7 @@
 #include <editeng/tstpitem.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/svdpage.hxx>
+#include <drawdoc.hxx>
 #include <hintids.hxx>
 #include <fmtflcnt.hxx>
 #include <txtftn.hxx>
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index f4924b9..8bcc0ca 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -21,6 +21,7 @@
 
 #include <cmdid.h>
 
+#include <drawdoc.hxx>
 #include <unodraw.hxx>
 #include <unocoll.hxx>
 #include <unoframe.hxx>
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index 58e46f3..e02024c 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -42,6 +42,7 @@
 #include <memory>
 #include <hints.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <docsh.hxx>
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 99519e8..e8a8bdb 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -28,6 +28,7 @@
 
 #include <svx/svdoutl.hxx>
 
+#include "drawdoc.hxx"
 #include "fesh.hxx"
 #include "pagefrm.hxx"
 #include "rootfrm.hxx"
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 707370b..34e15aa 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "crsrsh.hxx"
+#include "drawdoc.hxx"
 #include "rootfrm.hxx"
 #include "pagefrm.hxx"
 #include "viewimp.hxx"
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 766a8ac..ea111dd 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -27,6 +27,7 @@
 #include <svx/srchdlg.hxx>
 #include <svx/svdobj.hxx>
 #include <sfx2/viewsh.hxx>
+#include <drawdoc.hxx>
 #include <swwait.hxx>
 #include <swmodule.hxx>
 #include <fesh.hxx>
diff --git a/sw/source/filter/html/htmldrawreader.cxx 
b/sw/source/filter/html/htmldrawreader.cxx
index a3670fa..a50926e 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -39,6 +39,7 @@
 #include <svx/svdpool.hxx>
 
 #include "charatr.hxx"
+#include "drawdoc.hxx"
 #include <frmfmt.hxx>
 #include <fmtanchr.hxx>
 #include <fmtsrnd.hxx>
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 6323ec9..435dc2b 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -39,6 +39,7 @@
 #include <fmtautofmt.hxx>
 #include <fmtfsize.hxx>
 
+#include <drawdoc.hxx>
 #include <docxsdrexport.hxx>
 #include <docxexport.hxx>
 #include <docxexportfilter.hxx>
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 130edf1..969e0e2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -75,6 +75,7 @@
 #include <sfx2/sfxbasemodel.hxx>
 #include <svx/xflgrit.hxx>
 
+#include <drawdoc.hxx>
 #include <docufld.hxx>
 #include <fmtclds.hxx>
 #include <fmtinfmt.hxx>
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 0bc4ea8..b2e33e6 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -62,6 +62,7 @@
 #include <fmtcntnt.hxx>
 #include <ndindex.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <docary.hxx>
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index db37d41..368422f 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <osl/endian.h>
 #include <docsh.hxx>
+#include <drawdoc.hxx>
 
 #include <unotools/fltrcfg.hxx>
 #include <vcl/salbtype.hxx>
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index ca60186..6a235e7 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -65,6 +65,7 @@
 #include <fmtanchr.hxx>
 #include <pam.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <docary.hxx>
 #include <ndgrf.hxx>
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 193e767..ff47693 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -48,6 +48,7 @@
 #include <unotools/ucbstreamhelper.hxx>
 #include <swerror.h>
 #include <fltini.hxx>
+#include <drawdoc.hxx>
 #include <doc.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <IDocumentDrawModelAccess.hxx>
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index bf4812c..090c675 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -39,6 +39,7 @@
 #include <xmloff/ProgressBarHelper.hxx>
 #include <xmloff/xmluconv.hxx>
 #include <xmloff/xformsexport.hxx>
+#include <drawdoc.hxx>
 #include <pam.hxx>
 #include <unofreg.hxx>
 #include <doc.hxx>
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index c2a5e90..2e7d370 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -34,6 +34,7 @@
 #include <xmloff/XMLFontStylesContext.hxx>
 #include <xmloff/ProgressBarHelper.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <IDocumentDeviceAccess.hxx>
 #include <IDocumentDrawModelAccess.hxx>
diff --git a/sw/source/uibase/app/docshdrw.cxx 
b/sw/source/uibase/app/docshdrw.cxx
index 0388228..479aa30 100644
--- a/sw/source/uibase/app/docshdrw.cxx
+++ b/sw/source/uibase/app/docshdrw.cxx
@@ -27,6 +27,7 @@
 
 #include <docsh.hxx>
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 
 using namespace ::com::sun::star;
diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index 8cb9c2a..aea1897 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -25,6 +25,7 @@
 #include <editeng/boxitem.hxx>
 #include <editeng/numitem.hxx>
 #include <editeng/lrspitem.hxx>
+#include <drawdoc.hxx>
 #include <fmtcol.hxx>
 #include <uitool.hxx>
 #include <swmodule.hxx>
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx 
b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index c3fcc36..a53cc29 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -41,6 +41,7 @@
 #include <IDocumentDrawModelAccess.hxx>
 #include <docsh.hxx>
 #include <docary.hxx>
+#include <drawdoc.hxx>
 #include <frmfmt.hxx>
 #include <dcontact.hxx>
 #include <edtwin.hxx>
diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx 
b/sw/source/uibase/lingu/sdrhhcwrap.cxx
index fe7bec3..9875627 100644
--- a/sw/source/uibase/lingu/sdrhhcwrap.cxx
+++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx
@@ -32,6 +32,7 @@
 #include <svx/svdview.hxx>
 #include <editeng/unolingu.hxx>
 #include <unotools/localedatawrapper.hxx>
+#include <drawdoc.hxx>
 #include <sdrhhcwrap.hxx>
 #include <frmfmt.hxx>
 #include <docsh.hxx>
diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index b17d41b..3be5529 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -32,6 +32,7 @@
 #include <svx/swframevalidation.hxx>
 #include <svx/anchorid.hxx>
 #include <sfx2/htmlmode.hxx>
+#include <drawdoc.hxx>
 #include <uitool.hxx>
 #include <fmtornt.hxx>
 #include <cmdid.h>
diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index e1c59e6..da54124 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -44,6 +44,7 @@
 #include <tools/diagnose_ex.h>
 
 #include <doc.hxx>
+#include <drawdoc.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <fmturl.hxx>
diff --git a/sw/source/uibase/shells/grfsh.cxx 
b/sw/source/uibase/shells/grfsh.cxx
index f60b2d4..ed018dc 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -45,6 +45,7 @@
 #include <svx/compressgraphicdialog.hxx>
 #include <vcl/GraphicNativeTransform.hxx>
 #include <svx/tbxcolor.hxx>
+#include <drawdoc.hxx>
 #include <fmturl.hxx>
 #include <view.hxx>
 #include <wrtsh.hxx>
diff --git a/sw/source/uibase/shells/grfshex.cxx 
b/sw/source/uibase/shells/grfshex.cxx
index dd763f0..0cbca7a 100644
--- a/sw/source/uibase/shells/grfshex.cxx
+++ b/sw/source/uibase/shells/grfshex.cxx
@@ -28,6 +28,7 @@
 #include <caption.hxx>
 #include <vcl/graphicfilter.hxx>
 #include <sfx2/htmlmode.hxx>
+#include <drawdoc.hxx>
 #include <doc.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <docsh.hxx>
diff --git a/sw/source/uibase/uno/unodefaults.cxx 
b/sw/source/uibase/uno/unodefaults.cxx
index 3529b2f..a1cc59c 100644
--- a/sw/source/uibase/uno/unodefaults.cxx
+++ b/sw/source/uibase/uno/unodefaults.cxx
@@ -18,8 +18,8 @@
  */
 
 #include <unodefaults.hxx>
-#include <svx/svdmodel.hxx>
 #include <svx/unoprov.hxx>
+#include <drawdoc.hxx>
 #include <doc.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index c020b75..cc8e066 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1921,7 +1921,7 @@ void SwXTextDocument::setPropertyValue(const OUString& 
rPropertyName, const Any&
             SwDrawDocument * pDrawDoc;
             bool bAuto = *(sal_Bool*) aValue.getValue();
 
-            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * >( 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) )
+            if ( 0 != ( pDrawDoc = 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
                 pDrawDoc->SetAutoControlFocus( bAuto );
             else if (bAuto)
             {
@@ -1931,7 +1931,7 @@ void SwXTextDocument::setPropertyValue(const OUString& 
rPropertyName, const Any&
                 // SdrModel and we are leaving the default at false,
                 // we don't need to make an SdrModel and can do nothing
                 // #i52858# - method name changed
-                pDrawDoc = dynamic_cast< SwDrawDocument * > 
(pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel() );
+                pDrawDoc = 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
                 pDrawDoc->SetAutoControlFocus ( bAuto );
             }
         }
@@ -1941,7 +1941,7 @@ void SwXTextDocument::setPropertyValue(const OUString& 
rPropertyName, const Any&
             SwDrawDocument * pDrawDoc;
             bool bMode = *(sal_Bool*)aValue.getValue();
 
-            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > 
(pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) )
+            if ( 0 != ( pDrawDoc = 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
                 pDrawDoc->SetOpenInDesignMode( bMode );
             else if (!bMode)
             {
@@ -1952,7 +1952,7 @@ void SwXTextDocument::setPropertyValue(const OUString& 
rPropertyName, const Any&
                 // we don't need to make an SdrModel and can do
                 // nothing
                 // #i52858# - method name changed
-                pDrawDoc = dynamic_cast< SwDrawDocument * > 
(pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel() );
+                pDrawDoc = 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
                 pDrawDoc->SetOpenInDesignMode ( bMode );
             }
         }
@@ -2091,7 +2091,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& 
rPropertyName)
         {
             SwDrawDocument * pDrawDoc;
             bool bAuto;
-            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > 
(pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) )
+            if ( 0 != ( pDrawDoc = 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
                 bAuto = pDrawDoc->GetAutoControlFocus();
             else
                 bAuto = false;
@@ -2102,7 +2102,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& 
rPropertyName)
         {
             SwDrawDocument * pDrawDoc;
             bool bMode;
-            if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > 
(pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) )
+            if ( 0 != ( pDrawDoc = 
pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
                 bMode = pDrawDoc->GetOpenInDesignMode();
             else
                 bMode = true;
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 0a838e8..e6a827e 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -34,6 +34,7 @@
 #include <wrtsh.hxx>
 #include <view.hxx>
 #include <docsh.hxx>
+#include <drawdoc.hxx>
 #include <content.hxx>
 #include <frmfmt.hxx>
 #include <fldbas.hxx>
commit 9191f44fed1e1ede6a5efcaac6bc92bbe74305ec
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:04:10 2014 +0100

    coverity#706069 Unintended sign extension
    
    Change-Id: I605adc70d054fe3d5aea3bf1984348aae0e7fc28

diff --git a/svtools/source/contnr/imivctl2.cxx 
b/svtools/source/contnr/imivctl2.cxx
index f19ef08..0c48a7c 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -557,9 +557,11 @@ void IcnGridMap_Impl::Expand()
         else
             nNewGridCols += 50;
 
-        bool* pNewGridMap = new bool[nNewGridRows*nNewGridCols];
-        memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(bool) );
-        memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(bool) 
);
+        size_t nNewCellCount = static_cast<size_t>(nNewGridRows) * 
nNewGridCols;
+        bool* pNewGridMap = new bool[nNewCellCount];
+        memset(pNewGridMap, 0, nNewCellCount * sizeof(bool));
+        size_t nOldCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
+        memcpy(pNewGridMap, _pGridMap, nOldCellCount * sizeof(bool));
         delete[] _pGridMap;
         _pGridMap = pNewGridMap;
         _nGridRows = nNewGridRows;
commit 3daec14fd62a6a1655813d26e470513237129263
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:01:56 2014 +0100

    sizeof(bool) is not required to be 1
    
    Change-Id: I19ba4e27a4403d2c17d0bbf3f29c42e4745e4c41

diff --git a/svtools/source/contnr/imivctl2.cxx 
b/svtools/source/contnr/imivctl2.cxx
index 962ce2a..f19ef08 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -580,7 +580,7 @@ void IcnGridMap_Impl::Create_Impl()
 
     size_t nCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
     _pGridMap = new bool[nCellCount];
-    memset(_pGridMap, 0, nCellCount);
+    memset(_pGridMap, 0, nCellCount * sizeof(bool));
 
     const size_t nCount = _pView->aEntries.size();
     for( size_t nCur=0; nCur < nCount; nCur++ )
commit 6194080c53b752f1bbf78b298c90ddee66830865
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 09:00:59 2014 +0100

    coverity#706067 Unintended sign extension
    
    Change-Id: I7b1ace9726c38eafd063e7bd87f463b23fe9d74a

diff --git a/svtools/source/contnr/imivctl2.cxx 
b/svtools/source/contnr/imivctl2.cxx
index dda5d4e..962ce2a 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -578,8 +578,9 @@ void IcnGridMap_Impl::Create_Impl()
     else
         _nGridCols += 50;
 
-    _pGridMap = new bool[ _nGridRows * _nGridCols];
-    memset( (void*)_pGridMap, 0, _nGridRows * _nGridCols );
+    size_t nCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
+    _pGridMap = new bool[nCellCount];
+    memset(_pGridMap, 0, nCellCount);
 
     const size_t nCount = _pView->aEntries.size();
     for( size_t nCur=0; nCur < nCount; nCur++ )
commit 7c97720c2e1164ff41e5eb0218dd1f5543dd4d1f
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 08:56:47 2014 +0100

    coverity#706103 Unintended sign extension
    
    Change-Id: Icc0161f80982a9cab5776981a4848ea48709ecd2

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 253f174..abbfeca 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -649,12 +649,11 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf 
)
                     pTmpPor = pTmpPor->GetPortion();
                 }
 
-                const sal_uInt16 i = nSumWidth ?
+                const SwTwips i = nSumWidth ?
                                  ( nSumWidth - 1 ) / nGridWidth + 1 :
                                  0;
                 const SwTwips nTmpWidth = i * nGridWidth;
-                const SwTwips nKernWidth = std::min( (SwTwips)(nTmpWidth - 
nSumWidth),
-                                                nRestWidth );
+                const SwTwips nKernWidth = std::min(nTmpWidth - nSumWidth, 
nRestWidth);
                 const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2);
 
                 OSL_ENSURE( nKernWidth <= nRestWidth,
commit 0e09134a4a4cbb0639fc586c560c6fb2765487be
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jun 19 08:51:49 2014 +0100

    callcatcher: update unused code
    
    Change-Id: Ia25c686dac799707cae3f6112c731f8cd3f686c2

diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index f833bf8..856d8ba 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -583,30 +583,6 @@ RefButton::RefButton( Window* _pParent, WinBits nStyle ) :
     SetStartImage();
 }
 
-RefButton::RefButton( Window* _pParent, const ResId& rResId) :
-    ImageButton( _pParent, rResId ),
-    aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
-    aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ),
-    aShrinkQuickHelp( ModuleRes( RID_STR_SHRINK ).toString() ),
-    aExpandQuickHelp( ModuleRes( RID_STR_EXPAND ).toString() ),
-    pAnyRefDlg( NULL ),
-    pRefEdit( NULL )
-{
-    SetStartImage();
-}
-
-RefButton::RefButton( Window* _pParent, const ResId& rResId, RefEdit* pEdit, 
IControlReferenceHandler* _pDlg ) :
-    ImageButton( _pParent, rResId ),
-    aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
-    aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ),
-    aShrinkQuickHelp( ModuleRes( RID_STR_SHRINK ).toString() ),
-    aExpandQuickHelp( ModuleRes( RID_STR_EXPAND ).toString() ),
-    pAnyRefDlg( _pDlg ),
-    pRefEdit( pEdit )
-{
-    SetStartImage();
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeRefButton(Window 
*pParent, VclBuilder::stringmap &)
 {
     return new RefButton(pParent, 0);
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index 18e94ab..5752cf0 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -95,13 +95,8 @@ protected:
     virtual void LoseFocus() SAL_OVERRIDE;
 
 public:
-    RefButton(Window* _pParent, const ResId& rResId);
     RefButton(Window* _pParent, WinBits nStyle = 0);
-    RefButton(Window* _pParent, const ResId& rResId,
-              RefEdit* pEdit,   IControlReferenceHandler* pDlg);
-
     void SetReferences( IControlReferenceHandler* pDlg, RefEdit* pEdit );
-
     void SetStartImage();
     void SetEndImage();
     void DoRef()
diff --git a/unusedcode.easy b/unusedcode.easy
index ab59d9c..15dd8ac 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -184,12 +184,10 @@ 
basegfx::tools::containsOnlyHorizontalAndVerticalEdges(basegfx::B2DPolyPolygon c
 canvas::createSurfaceProxyManager(boost::shared_ptr<canvas::IRenderModule> 
const&)
 
chart::ChartTypeUnoDlg::Create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
 const&)
 
chart::ShapeToolbarController::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
 const&)
-chart::opengl3D::Text::getSize() const
 
comphelper::detail::ConfigurationWrapper::getGroupReadWrite(boost::shared_ptr<comphelper::ConfigurationChanges>
 const&, rtl::OUString const&) const
 
comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(rtl::OUString
 const&) const
 
comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(boost::shared_ptr<comphelper::ConfigurationChanges>
 const&, rtl::OUString const&, com::sun::star::uno::Any const&) const
 connectivity::OSQLParseNode::showParseTree(rtl::OUString&) const
-connectivity::file::OStatement_Base::reset()
 connectivity::firebird::release(int&, 
cppu::OBroadcastHelperVar<cppu::OMultiTypeInterfaceContainerHelper, 
com::sun::star::uno::Type>&, 
com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, 
com::sun::star::lang::XComponent*)
 connectivity::sdbcx::OGroup::OGroup(bool)
 connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, bool)
commit d3a5b4e86f431c73a92b536b049c4b16b9c226b5
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Jun 18 17:03:40 2014 +0100

    coverity#706063 Unintended sign extension
    
    Change-Id: Idaec46756ef22bcec1335c219fdc3ebf64c43fc3

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 2a3fba1..c78a040 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2276,11 +2276,11 @@ void SmParser::Matrix()
             r++;
         }
 
-        long nRC = r * c;
+        size_t nRC = static_cast<size_t>(r) * c;
 
         ExpressionArray.resize(nRC);
 
-        for (sal_uInt16 i = 0; i < (nRC); i++)
+        for (size_t i = 0; i < (nRC); ++i)
         {
             ExpressionArray[(nRC) - (i + 1)] = lcl_popOrZero(m_aNodeStack);
         }
commit 3631f5b3ba13e177e4c82af4e90b0cb5998b33e2
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Jun 18 17:02:28 2014 +0100

    coverity#706062 Unintended sign extension
    
    Change-Id: I96e3054de033c550a54c8393c82d0efbe6f2e08d

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 50bfccd..184b012 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2544,7 +2544,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, 
const SmFormat &rFormat)
     }
 
     // norm distance from which the following two are calcutated
-    const int  nNormDist = 3 * GetFont().GetSize().Height();
+    const long  nNormDist = 3 * GetFont().GetSize().Height();
 
     // define horizontal and vertical minimal distances that separate
     // the elements
commit 32294e11a06e216a859fcdccaa5678f98a1c9c25
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Jun 18 17:01:08 2014 +0100

    coverity#706052 Unintended sign extension
    
    Change-Id: I5e9b8a8809f9736038f20493d1a24bbbd8846dbd

diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 30ea98d..c718ed2 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -3012,7 +3012,7 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& 
rModel, AutoLayout eLayout,
                 break;
         }
 
-        rAreas.resize( nColCnt * nRowCnt );
+        rAreas.resize(static_cast<size_t>(nColCnt) * nRowCnt);
 
         Size aPartArea, aSize;
         aPartArea.Width()  = ((aArea.Width()  - ((nColCnt-1) * nGapW) ) / 
nColCnt);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to