[Libreoffice-commits] core.git: 36 commits - basctl/source basic/source bridges/source compilerplugins/clang connectivity/source cppu/source cui/source dbaccess/source editeng/source filter/source framework/source hwpfilter/source idl/source include/svtools jvmfwk/source l10ntools/source lingucomponent/source oox/source pyuno/source registry/source rsc/source sal/osl sal/qa sc/source sd/source sfx2/source stoc/source svl/source svtools/source svx/source sw/source toolkit/source tools/source unoxml/source vcl/generic vcl/source vcl/unx writerperfect/source xmloff/source xmlsecurity/source

Stephan Bergmann sbergman at redhat.com
Mon May 11 03:52:53 PDT 2015


 basctl/source/dlged/dlgedobj.cxx                          |    2 
 basic/source/basmgr/basmgr.cxx                            |    2 
 basic/source/classes/eventatt.cxx                         |    2 
 basic/source/classes/sbunoobj.cxx                         |   36 +++++-----
 basic/source/runtime/methods.cxx                          |    2 
 basic/source/runtime/runtime.cxx                          |    8 +-
 basic/source/runtime/stdobj.cxx                           |    2 
 basic/source/sbx/sbxvalue.cxx                             |    2 
 basic/source/sbx/sbxvar.cxx                               |    2 
 bridges/source/jni_uno/jni_bridge.cxx                     |    4 -
 compilerplugins/clang/cstylecast.cxx                      |    9 +-
 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx  |    2 
 connectivity/source/drivers/evoab2/NResultSet.cxx         |    4 -
 connectivity/source/drivers/evoab2/NResultSetMetaData.cxx |    2 
 connectivity/source/drivers/jdbc/InputStream.cxx          |    2 
 connectivity/source/drivers/jdbc/tools.cxx                |    4 -
 cppu/source/uno/copy.hxx                                  |    2 
 cui/source/tabpages/tpgradnt.cxx                          |    4 -
 cui/source/tabpages/tphatch.cxx                           |    4 -
 dbaccess/source/ui/browser/formadapter.cxx                |    2 
 editeng/source/editeng/impedit2.cxx                       |    2 
 editeng/source/editeng/impedit3.cxx                       |    2 
 editeng/source/uno/unotext.cxx                            |    2 
 filter/source/msfilter/escherex.cxx                       |    4 -
 filter/source/msfilter/svdfppt.cxx                        |    4 -
 framework/source/uielement/menubarmanager.cxx             |    2 
 hwpfilter/source/lexer.cxx                                |    4 -
 idl/source/prj/globals.cxx                                |    2 
 include/svtools/treelist.hxx                              |    8 +-
 jvmfwk/source/elements.cxx                                |    2 
 l10ntools/source/xmlparse.cxx                             |    2 
 lingucomponent/source/languageguessing/guess.cxx          |    4 -
 oox/source/export/drawingml.cxx                           |    2 
 pyuno/source/module/pyuno_gc.cxx                          |    2 
 registry/source/keyimpl.cxx                               |   10 +--
 registry/source/regimpl.cxx                               |    6 -
 rsc/source/tools/rsctree.cxx                              |   20 +++---
 sal/osl/unx/profile.cxx                                   |    2 
 sal/osl/unx/socket.cxx                                    |    6 -
 sal/qa/rtl/process/rtl_Process.cxx                        |    4 -
 sc/source/filter/xml/xmlstyli.cxx                         |    2 
 sc/source/ui/docshell/docfunc.cxx                         |    2 
 sc/source/ui/drawfunc/drawsh5.cxx                         |    2 
 sc/source/ui/drawfunc/drtxtob2.cxx                        |    2 
 sc/source/ui/drawfunc/fuconstr.cxx                        |    2 
 sc/source/ui/drawfunc/fuins2.cxx                          |    6 -
 sc/source/ui/view/drawview.cxx                            |    2 
 sc/source/ui/view/gridwin.cxx                             |    3 
 sc/source/ui/view/tabview.cxx                             |    2 
 sd/source/core/drawdoc4.cxx                               |    8 +-
 sd/source/core/sdpage.cxx                                 |    2 
 sd/source/core/sdpage2.cxx                                |    4 -
 sd/source/filter/ppt/pptin.cxx                            |    2 
 sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx |    2 
 sd/source/ui/app/sdmod2.cxx                               |    2 
 sd/source/ui/app/sdxfer.cxx                               |    2 
 sd/source/ui/dlg/animobjs.cxx                             |    2 
 sd/source/ui/dlg/custsdlg.cxx                             |    4 -
 sd/source/ui/dlg/navigatr.cxx                             |    2 
 sd/source/ui/dlg/present.cxx                              |    4 -
 sd/source/ui/dlg/sdtreelb.cxx                             |    6 -
 sd/source/ui/dlg/tpoption.cxx                             |    2 
 sd/source/ui/docshell/docshel4.cxx                        |    2 
 sd/source/ui/remotecontrol/BluetoothServer.cxx            |    2 
 sd/source/ui/unoidl/unomodel.cxx                          |    2 
 sd/source/ui/unoidl/unopage.cxx                           |   10 +--
 sd/source/ui/view/drviews2.cxx                            |    4 -
 sd/source/ui/view/drviews6.cxx                            |    2 
 sd/source/ui/view/drviews9.cxx                            |    2 
 sd/source/ui/view/outlview.cxx                            |   10 +--
 sd/source/ui/view/sdview3.cxx                             |   12 +--
 sfx2/source/appl/module.cxx                               |    2 
 sfx2/source/dialog/templdlg.cxx                           |    4 -
 sfx2/source/doc/objserv.cxx                               |    2 
 sfx2/source/menu/mnumgr.cxx                               |    2 
 sfx2/source/view/viewfrm.cxx                              |    2 
 sfx2/source/view/viewprn.cxx                              |    2 
 sfx2/source/view/viewsh.cxx                               |    2 
 stoc/source/corereflection/crcomp.cxx                     |    2 
 stoc/source/corereflection/criface.cxx                    |    2 
 svl/source/items/poolio.cxx                               |    8 +-
 svtools/source/brwbox/datwin.cxx                          |    2 
 svtools/source/brwbox/editbrowsebox.cxx                   |    6 -
 svtools/source/contnr/svimpbox.cxx                        |   16 ++--
 svtools/source/contnr/svtabbx.cxx                         |    2 
 svtools/source/contnr/treelist.cxx                        |    4 -
 svtools/source/contnr/treelistbox.cxx                     |   46 +++++++-------
 svtools/source/graphic/grfcache.cxx                       |    4 -
 svtools/source/graphic/grfmgr2.cxx                        |    4 -
 svx/source/accessibility/GraphCtlAccessibleContext.cxx    |    4 -
 svx/source/dialog/compressgraphicdialog.cxx               |    2 
 svx/source/dialog/connctrl.cxx                            |    2 
 svx/source/dialog/contwnd.cxx                             |    6 -
 svx/source/dialog/imapwnd.cxx                             |    6 -
 svx/source/dialog/optgrid.cxx                             |    6 -
 svx/source/svdraw/sdrpagewindow.cxx                       |    4 -
 svx/source/svdraw/svdedxv.cxx                             |    4 -
 svx/source/svdraw/svdoedge.cxx                            |    6 -
 svx/source/svdraw/svdopath.cxx                            |    2 
 svx/source/svdraw/svdpagv.cxx                             |    4 -
 sw/source/core/access/accdoc.cxx                          |    2 
 sw/source/core/bastyp/swcache.cxx                         |    2 
 sw/source/core/crsr/callnk.cxx                            |    2 
 sw/source/core/crsr/crsrsh.cxx                            |    2 
 sw/source/core/crsr/crstrvl.cxx                           |    4 -
 sw/source/core/crsr/pam.cxx                               |    4 -
 sw/source/core/crsr/swcrsr.cxx                            |    2 
 sw/source/core/doc/CntntIdxStore.cxx                      |    6 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx   |    8 +-
 sw/source/core/doc/doc.cxx                                |    6 -
 sw/source/core/doc/docdraw.cxx                            |    2 
 sw/source/core/doc/docedt.cxx                             |    2 
 sw/source/core/doc/docfmt.cxx                             |   10 +--
 sw/source/core/doc/doclay.cxx                             |    2 
 sw/source/core/doc/docsort.cxx                            |    6 -
 sw/source/core/doc/doctxm.cxx                             |   22 +++---
 sw/source/core/doc/htmltbl.cxx                            |    2 
 sw/source/core/doc/number.cxx                             |    2 
 sw/source/core/doc/tblcpy.cxx                             |    4 -
 sw/source/core/doc/tblrwcl.cxx                            |    8 +-
 sw/source/core/doc/visiturl.cxx                           |    2 
 sw/source/core/docnode/ndsect.cxx                         |    2 
 sw/source/core/docnode/ndtbl.cxx                          |    6 -
 sw/source/core/docnode/node.cxx                           |    2 
 sw/source/core/edit/eddel.cxx                             |    4 -
 sw/source/core/fields/docufld.cxx                         |    2 
 sw/source/core/fields/reffld.cxx                          |    2 
 sw/source/core/fields/tblcalc.cxx                         |    2 
 sw/source/core/frmedt/fecopy.cxx                          |    4 -
 sw/source/core/frmedt/fefly1.cxx                          |    4 -
 sw/source/core/frmedt/feshview.cxx                        |    4 -
 sw/source/core/frmedt/tblsel.cxx                          |    2 
 sw/source/core/layout/findfrm.cxx                         |    8 +-
 sw/source/core/layout/flowfrm.cxx                         |    2 
 sw/source/core/layout/fly.cxx                             |    2 
 sw/source/core/layout/flycnt.cxx                          |    4 -
 sw/source/core/layout/flyincnt.cxx                        |    2 
 sw/source/core/layout/flylay.cxx                          |    6 -
 sw/source/core/layout/ftnfrm.cxx                          |   10 +--
 sw/source/core/layout/layact.cxx                          |    2 
 sw/source/core/layout/sectfrm.cxx                         |    2 
 sw/source/core/layout/tabfrm.cxx                          |   14 ++--
 sw/source/core/layout/trvlfrm.cxx                         |   10 +--
 sw/source/core/ole/ndole.cxx                              |    2 
 sw/source/core/table/swtable.cxx                          |    2 
 sw/source/core/text/EnhancedPDFExportHelper.cxx           |    4 -
 sw/source/core/txtnode/atrfld.cxx                         |    2 
 sw/source/core/txtnode/txtatr2.cxx                        |   10 +--
 sw/source/core/txtnode/txtedt.cxx                         |    2 
 sw/source/core/undo/undel.cxx                             |    2 
 sw/source/core/undo/undobj1.cxx                           |    4 -
 sw/source/core/undo/undraw.cxx                            |   14 ++--
 sw/source/core/undo/unredln.cxx                           |    4 -
 sw/source/core/undo/unsect.cxx                            |    2 
 sw/source/core/undo/untbl.cxx                             |    8 +-
 sw/source/core/undo/untblk.cxx                            |    4 -
 sw/source/core/unocore/SwXTextDefaults.cxx                |    2 
 sw/source/core/unocore/unofield.cxx                       |    2 
 sw/source/core/unocore/unoframe.cxx                       |    2 
 sw/source/core/unocore/unoobj2.cxx                        |    2 
 sw/source/core/unocore/unotbl.cxx                         |    2 
 sw/source/core/view/vdraw.cxx                             |    2 
 sw/source/filter/basflt/fltshell.cxx                      |    4 -
 sw/source/filter/html/htmlatr.cxx                         |    6 -
 sw/source/filter/html/htmltab.cxx                         |    4 -
 sw/source/filter/ww8/wrtw8num.cxx                         |    2 
 sw/source/filter/ww8/wrtww8.cxx                           |    2 
 sw/source/filter/ww8/ww8par5.cxx                          |    2 
 sw/source/ui/config/optcomp.cxx                           |    2 
 sw/source/ui/table/tabledlg.cxx                           |    2 
 sw/source/uibase/app/docsh2.cxx                           |    2 
 sw/source/uibase/app/docstyle.cxx                         |    2 
 sw/source/uibase/dbui/dbtree.cxx                          |    2 
 sw/source/uibase/dochdl/gloshdl.cxx                       |    4 -
 sw/source/uibase/docvw/edtwin.cxx                         |    2 
 sw/source/uibase/shells/frmsh.cxx                         |    4 -
 sw/source/uibase/shells/textfld.cxx                       |    4 -
 sw/source/uibase/uno/unotxdoc.cxx                         |    2 
 sw/source/uibase/utlui/glbltree.cxx                       |    6 -
 sw/source/uibase/utlui/uitool.cxx                         |    2 
 toolkit/source/controls/unocontrolcontainermodel.cxx      |    2 
 tools/source/generic/poly.cxx                             |    2 
 tools/source/rc/resmgr.cxx                                |    2 
 tools/source/stream/stream.cxx                            |    8 +-
 unoxml/source/dom/attr.cxx                                |    2 
 vcl/generic/fontmanager/parseAFM.cxx                      |    6 -
 vcl/source/control/ilstbox.cxx                            |    4 -
 vcl/source/fontsubset/cff.cxx                             |    2 
 vcl/source/fontsubset/ttcr.cxx                            |    8 +-
 vcl/source/gdi/gdimtf.cxx                                 |    4 -
 vcl/source/gdi/print.cxx                                  |    2 
 vcl/source/gdi/virdev.cxx                                 |    2 
 vcl/source/outdev/text.cxx                                |    4 -
 vcl/unx/generic/app/i18n_xkb.cxx                          |    2 
 vcl/unx/gtk/window/gtksalmenu.cxx                         |    2 
 writerperfect/source/common/DocumentHandler.cxx           |    2 
 xmloff/source/draw/XMLNumberStyles.cxx                    |    2 
 xmlsecurity/source/xmlsec/saxhelper.cxx                   |    6 -
 198 files changed, 420 insertions(+), 420 deletions(-)

New commits:
commit 3f3c4000d44a8b4175e1669a4324e2308b0fd77d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:57 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I16fdb3a6e92c854f4143b5afd19d33818735222b

diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index d34e729..afbcacd 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -53,7 +53,6 @@ private:
 
 static const char * recommendedFix(clang::CastKind ck) {
     switch(ck) {
-        case CK_NoOp: return "const_cast";
         case CK_IntegralToPointer: return "reinterpret_cast";
         case CK_PointerToIntegral: return "reinterpret_cast";
         case CK_BaseToDerived: return "static_cast";
@@ -101,9 +100,11 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
         } else {
             return true;
         }
-        if (!t1.isMoreQualifiedThan(t2)
-            || (t1.getUnqualifiedType().getCanonicalType().getTypePtr()
-                != t2.getUnqualifiedType().getCanonicalType().getTypePtr()))
+        if (expr->getSubExprAsWritten()->getType() != expr->getType()
+            && (!t1.isMoreQualifiedThan(t2)
+                || (t1.getUnqualifiedType().getCanonicalType().getTypePtr()
+                    != (t2.getUnqualifiedType().getCanonicalType()
+                        .getTypePtr()))))
         {
             return true;
         }
commit 7011bf7817e1ed40c3c5a8020698996bf634045f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:47 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: Idac7d377f3798a56d3fb32d8e3ec393bd2a53e9d

diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx
index be771e0..b017efa 100644
--- a/xmlsecurity/source/xmlsec/saxhelper.cxx
+++ b/xmlsecurity/source/xmlsec/saxhelper.cxx
@@ -303,7 +303,7 @@ void SAXHelper::endElement( const OUString& aName )
 
     if( fullname != NULL )
     {
-        xmlFree( ( xmlChar* )fullname ) ;
+        xmlFree( fullname ) ;
         fullname = NULL ;
     }
 }
@@ -362,13 +362,13 @@ void SAXHelper::processingInstruction(
 
     if( target != NULL )
     {
-        xmlFree( ( xmlChar* )target ) ;
+        xmlFree( target ) ;
         target = NULL ;
     }
 
     if( data != NULL )
     {
-        xmlFree( ( xmlChar* )data ) ;
+        xmlFree( data ) ;
         data = NULL ;
     }
 }
commit 00be1308d029f70ececc7e16c17e91f90573d798
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:43 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I72713a31aebe594b1a89c2d4a1c9f8aa37590e61

diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx
index fe03906..2bf25e6 100644
--- a/xmloff/source/draw/XMLNumberStyles.cxx
+++ b/xmloff/source/draw/XMLNumberStyles.cxx
@@ -358,7 +358,7 @@ static void SdXMLExportStyle( SdXMLExport& rExport, const SdXMLFixedDataStyle* p
     do
     {
 
-        const sal_uInt8* pElements = (const sal_uInt8*)&pStyle->mpFormat[0];
+        const sal_uInt8* pElements = &pStyle->mpFormat[0];
 
         while( *pElements )
         {
commit 80434c1cde058b5dfe6b2fd4dde2b8307e2bf421
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:38 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I2986cc33a29bdb9a388ce6ac715a3b25502eb556

diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx
index d87a736..1d93bf5 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -32,7 +32,7 @@ static const unsigned char librvng_utf8_skip_data[256] =
     3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
 };
 
-#define librvng_utf8_next_char(p) (char const *)((p) + librvng_utf8_skip_data[*reinterpret_cast<unsigned char const *>(p)])
+#define librvng_utf8_next_char(p) ((p) + librvng_utf8_skip_data[*reinterpret_cast<unsigned char const *>(p)])
 
 static void unescapeXML(const char *s, const unsigned long sz, librevenge::RVNGString &res)
 {
commit a71478d8ba7347f41c20585c56e1d5283757f82e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:33 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I0f844c7265b52d668bc6a2368321950a1a00cce5

diff --git a/vcl/generic/fontmanager/parseAFM.cxx b/vcl/generic/fontmanager/parseAFM.cxx
index 267ef1c..91c7a89 100644
--- a/vcl/generic/fontmanager/parseAFM.cxx
+++ b/vcl/generic/fontmanager/parseAFM.cxx
@@ -793,7 +793,7 @@ static int parseCharMetrics( FileInputStream* fp, FontInfo* fi)
                 break;
             case CHARNAME:
                 if ((keyword = token(fp,tokenlen)) != NULL)
-                    temp->name = (char *)strdup(keyword);
+                    temp->name = strdup(keyword);
                 break;
             case CHARBBOX:
                 if ((keyword = token(fp,tokenlen)) != NULL)
@@ -818,9 +818,9 @@ static int parseCharMetrics( FileInputStream* fp, FontInfo* fi)
 
                 *tail = static_cast<Ligature *>(calloc(1, sizeof(Ligature)));
                 if ((keyword = token(fp,tokenlen)) != NULL)
-                    (*tail)->succ = (char *)strdup(keyword);
+                    (*tail)->succ = strdup(keyword);
                 if ((keyword = token(fp,tokenlen)) != NULL)
-                    (*tail)->lig = (char *)strdup(keyword);
+                    (*tail)->lig = strdup(keyword);
                 break; }
             case ENDCHARMETRICS:
                 cont = false;
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index ca1027a..637263d 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -187,7 +187,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
             else
             {
                 nLow  = mnMRUCount;
-                pTemp = (ImplEntryType*)GetEntry( (sal_Int32)nLow );
+                pTemp = GetEntry( (sal_Int32)nLow );
 
                 nComp = rSorter.compare(rStr, pTemp->maStr);
                 if ( nComp <= 0 )
@@ -202,7 +202,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
                     do
                     {
                         nMid = (nLow + nHigh) / 2;
-                        pTemp = (ImplEntryType*)GetEntry( nMid );
+                        pTemp = GetEntry( nMid );
 
                         nComp = rSorter.compare(rStr, pTemp->maStr);
 
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 2b47760..9e2d1d3 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1253,7 +1253,7 @@ if( mbSawError) {
     int nRDCryptR = 4330; // TODO: mnRDCryptSeed;
     for( U8* p = pT1Ops; p < mpWritePtr; ++p) {
         *p ^= (nRDCryptR >> 8);
-        nRDCryptR = (*(U8*)p + nRDCryptR) * 52845 + 22719;
+        nRDCryptR = (*p + nRDCryptR) * 52845 + 22719;
     }
 
     return nType1Len;
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 813b5f6..6f467b0 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -782,7 +782,7 @@ static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
     qsort(nr, n, sizeof(NameRecord), NameRecordCompareF);
 
     int nameLen = stringLen + 12 * n + 6;
-    sal_uInt8* name = (sal_uInt8*)ttmalloc(nameLen);
+    sal_uInt8* name = ttmalloc(nameLen);
 
     PutUInt16(0, name, 0, 1);
     PutUInt16(n, name, 2, 1);
@@ -911,7 +911,7 @@ TrueTypeTable *TrueTypeTableNew_head(sal_uInt32 fontRevision,
     assert(created != 0);
 
     TrueTypeTable* table  = static_cast<TrueTypeTable*>(smalloc(sizeof(TrueTypeTable)));
-    sal_uInt8* ptr = (sal_uInt8*)ttmalloc(TABLESIZE_head);
+    sal_uInt8* ptr = ttmalloc(TABLESIZE_head);
 
     PutUInt32(0x00010000, ptr, 0, 1);             /* version */
     PutUInt32(fontRevision, ptr, 4, 1);
@@ -939,7 +939,7 @@ TrueTypeTable *TrueTypeTableNew_hhea(sal_Int16  ascender,
                                      sal_Int16  caretSlopeRun)
 {
     TrueTypeTable* table = static_cast<TrueTypeTable*>(smalloc(sizeof(TrueTypeTable)));
-    sal_uInt8* ptr = (sal_uInt8*)ttmalloc(TABLESIZE_hhea);
+    sal_uInt8* ptr = ttmalloc(TABLESIZE_hhea);
 
     PutUInt32(0x00010000, ptr, 0, 1);             /* version */
     PutUInt16(ascender, ptr, 4, 1);
@@ -1016,7 +1016,7 @@ TrueTypeTable *TrueTypeTableNew_cmap()
     cmap->s = static_cast<CmapSubTable *>(scalloc(CMAP_SUBTABLE_INIT, sizeof(CmapSubTable)));
     memset(cmap->s, 0, sizeof(CmapSubTable) * CMAP_SUBTABLE_INIT);
 
-    table->data = (table_cmap *) cmap;
+    table->data = cmap;
 
     table->rawdata = 0;
     table->tag = T_cmap;
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 2701046..2b34158 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2875,11 +2875,11 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
 
     aWriteData.meActualCharSet = rOStm.GetStreamCharSet();
 
-    MetaAction* pAct = (MetaAction*)FirstAction();
+    MetaAction* pAct = FirstAction();
     while ( pAct )
     {
         pAct->Write( rOStm, &aWriteData );
-        pAct = (MetaAction*)NextAction();
+        pAct = NextAction();
     }
 
     rOStm.SetEndian( nOldFormat );
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 590d696..ebc5f2b 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -690,7 +690,7 @@ void Printer::ReleaseGraphics( bool bRelease )
 
     ImplSVData* pSVData = ImplGetSVData();
 
-    Printer* pPrinter = (Printer*)this;
+    Printer* pPrinter = this;
 
     if ( !pPrinter->mpJobGraphics )
     {
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index c453d91..e6c3fe1 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -105,7 +105,7 @@ void VirtualDevice::ReleaseGraphics( bool bRelease )
 
     ImplSVData* pSVData = ImplGetSVData();
 
-    VirtualDevice* pVirDev = (VirtualDevice*)this;
+    VirtualDevice* pVirDev = this;
 
     if ( bRelease )
         pVirDev->mpVirDev->ReleaseGraphics( mpGraphics );
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 7d2e65f..9dc3aa5 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -307,7 +307,7 @@ bool OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout,
            rSalLayout.DrawBase().X() = w - 1 - x;
         if( !IsRTLEnabled() )
         {
-            OutputDevice *pOutDevRef = (OutputDevice *)this;
+            OutputDevice *pOutDevRef = this;
             // mirror this window back
             long devX = w-pOutDevRef->mnOutWidth-pOutDevRef->mnOutOffX;   // re-mirrored mnOutOffX
             rSalLayout.DrawBase().X() = devX + ( pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) ) ;
@@ -315,7 +315,7 @@ bool OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout,
     }
     else if( IsRTLEnabled() )
     {
-        OutputDevice *pOutDevRef = (OutputDevice *)this;
+        OutputDevice *pOutDevRef = this;
 
         // mirror this window back
         long devX = pOutDevRef->mnOutOffX;   // re-mirrored mnOutOffX
diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx
index cfc3bef..f9618f4 100644
--- a/vcl/unx/generic/app/i18n_xkb.cxx
+++ b/vcl/unx/generic/app/i18n_xkb.cxx
@@ -57,7 +57,7 @@ SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay )
         int nExtMinorVersion = XkbMinorVersion;
 
         mbUseExtension = XkbQueryExtension( mpDisplay,
-            &nMajorExtOpcode, (int*)&mnEventBase, (int*)&mnErrorBase,
+            &nMajorExtOpcode, &mnEventBase, &mnErrorBase,
             &nExtMajorVersion, &nExtMinorVersion ) != 0;
     }
 
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 73ca34b..94668ff 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -160,7 +160,7 @@ bool GtkSalMenu::PrepUpdate()
     if (pFrame)
     {
         GtkSalFrame* pNonConstFrame = const_cast<GtkSalFrame*>(pFrame);
-        GtkSalMenu* pSalMenu = ((GtkSalMenu*) this);
+        GtkSalMenu* pSalMenu = this;
 
         if ( !pNonConstFrame->GetMenu() )
             pNonConstFrame->SetMenu( pSalMenu );
commit 4a1eddb6d7d27030b119cef147147d77c9a3ff5f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:29 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: Ic046e96b395713336cb33ce48a003183f7648d36

diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index ba0eef5..3a97fb7 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -192,7 +192,7 @@ namespace DOM
             xmlStringGetNodeList(m_aAttrPtr->doc, buffer.get());
         xmlNodePtr tmp = m_aAttrPtr->children;
         while (tmp != NULL) {
-            tmp->parent = (xmlNodePtr) m_aNodePtr;
+            tmp->parent = m_aNodePtr;
             tmp->doc = m_aAttrPtr->doc;
             if (tmp->next == NULL)
                 m_aNodePtr->last = tmp;
commit ad5daefda679ccbfb5b2759c970d34548bc2ba29
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:23 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: Ic4b6409013a19a78025973b26318ef05611a6984

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 76973f2..457a05b 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -584,7 +584,7 @@ Polygon::~Polygon()
 
 const Point* Polygon::GetConstPointAry() const
 {
-    return (Point*)mpImplPolygon->mpPointAry;
+    return mpImplPolygon->mpPointAry;
 }
 
 const sal_uInt8* Polygon::GetConstFlagAry() const
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 13b60e2..d17c315 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -597,7 +597,7 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
                 pStm->Read( pStringBlock, nSize );
             }
             *pResHandle = pStringBlock;
-            return (sal_uInt8*)pStringBlock + pFind->nOffset - nOffCorrection;
+            return pStringBlock + pFind->nOffset - nOffCorrection;
         } // if( nRT == RSC_STRING && bEqual2Content )
         else
         {
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 16cd342..002d9e5 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -577,7 +577,7 @@ bool SvStream::ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead )
     if ( bEnd && (c=='\r' || c=='\n') )  // Special treatment for DOS files
     {
         char cTemp;
-        sal_Size nLen = Read((char*)&cTemp , sizeof(cTemp) );
+        sal_Size nLen = Read(&cTemp , sizeof(cTemp) );
         if ( nLen ) {
             if( cTemp == c || (cTemp != '\n' && cTemp != '\r') )
                 Seek( nOldFilePos );
@@ -984,7 +984,7 @@ SvStream& SvStream::ReadChar( char& r )
         nBufFree -= sizeof(char);
     }
     else
-        Read( (char*)&r, sizeof(char) );
+        Read( &r, sizeof(char) );
     return *this;
 }
 
@@ -1154,7 +1154,7 @@ SvStream& SvStream::WriteChar( char v )
         bIsDirty = true;
     }
     else
-        Write( (char*)&v, sizeof(char) );
+        Write( &v, sizeof(char) );
     return *this;
 }
 
@@ -1724,7 +1724,7 @@ SvMemoryStream::~SvMemoryStream()
 const void* SvMemoryStream::GetBuffer()
 {
     Flush();
-    return (const void*)GetData();
+    return GetData();
 }
 
 sal_uIntPtr SvMemoryStream::GetSize()
commit 2244ba7bc3e146e3ec8303064fb6d13ef548cdb2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:19 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I9873e5be7c9ea97a44baf13f8ca720aff0ff2793

diff --git a/toolkit/source/controls/unocontrolcontainermodel.cxx b/toolkit/source/controls/unocontrolcontainermodel.cxx
index f1c23d9..5784645 100644
--- a/toolkit/source/controls/unocontrolcontainermodel.cxx
+++ b/toolkit/source/controls/unocontrolcontainermodel.cxx
@@ -81,7 +81,7 @@ UnoControlContainerModel::getSupportedServiceNames()
 
 ::cppu::IPropertyArrayHelper& UnoControlContainerModel::getInfoHelper()
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( ((UnoControlContainerModel*)this)->GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     static UnoPropertyArrayHelper* pHelper = NULL;
     if ( !pHelper )
commit 80c2dfa225a3e082b0a7fdab95cfed3eef17d0c1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:13 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I0e42e757a6f7b0c28758193aad8b3cb01607b8b1

diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 765ce5f..435a247 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -705,7 +705,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes()
                 pCurrPageCol = pCurrPageCol->GetUpper();
             }
 
-            SwLayoutFrm* pParent = (SwLayoutFrm*)(pCurrPageCol->GetUpper());
+            SwLayoutFrm* pParent = pCurrPageCol->GetUpper();
 
             if(pParent!=NULL)
             {
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx
index aa0a415..58e722b 100644
--- a/sw/source/core/bastyp/swcache.cxx
+++ b/sw/source/core/bastyp/swcache.cxx
@@ -154,7 +154,7 @@ void SwCache::Flush( const sal_uInt8 )
         else
 #endif
         {
-            pTmp = (SwCacheObj*)pObj;
+            pTmp = pObj;
             pObj = pTmp->GetNext();
             aFreePositions.push_back( pTmp->GetCachePos() );
             m_aCacheObjects[pTmp->GetCachePos()] = NULL;
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 1c1a095..60ddc46 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -236,7 +236,7 @@ long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, sal_Int32
     if ( pFrm && !pFrm->IsHiddenNow() )
     {
         if( pFrm->HasFollow() )
-            while( 0 != ( pNext = (SwTxtFrm*)pFrm->GetFollow() ) &&
+            while( 0 != ( pNext = pFrm->GetFollow() ) &&
                     nCntPos >= pNext->GetOfst() )
                 pFrm = pNext;
 
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 98e3360..4aa3dcd 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -979,7 +979,7 @@ bool SwCrsrShell::ChgCurrPam(
         return false;
 
     // search in all selections for this position
-    SwShellCrsr* pCmp = (SwShellCrsr*)m_pCurCrsr; // keep the pointer on cursor
+    SwShellCrsr* pCmp = m_pCurCrsr; // keep the pointer on cursor
     do {
         if( pCmp && pCmp->HasMark() &&
             *pCmp->Start() <= aPtPos && *pCmp->End() > aPtPos )
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 32ceba6..727c219 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -789,7 +789,7 @@ bool SwCrsrShell::GotoFld( const SwFmtFld& rFld )
         SwCursor* pCrsr = getShellCrsr( true );
         SwCrsrSaveState aSaveState( *pCrsr );
 
-        SwTxtNode* pTNd = (SwTxtNode*)rFld.GetTxtFld()->GetpTxtNode();
+        SwTxtNode* pTNd = rFld.GetTxtFld()->GetpTxtNode();
         pCrsr->GetPoint()->nNode = *pTNd;
         pCrsr->GetPoint()->nContent.Assign( pTNd, rFld.GetTxtFld()->GetStart() );
 
@@ -916,7 +916,7 @@ void SwCrsrShell::GotoOutline( sal_uInt16 nIdx )
     SwCrsrSaveState aSaveState( *pCrsr );
 
     const SwNodes& rNds = GetDoc()->GetNodes();
-    SwTxtNode* pTxtNd = (SwTxtNode*)rNds.GetOutLineNds()[ nIdx ]->GetTxtNode();
+    SwTxtNode* pTxtNd = rNds.GetOutLineNds()[ nIdx ]->GetTxtNode();
     pCrsr->GetPoint()->nNode = *pTxtNd;
     pCrsr->GetPoint()->nContent.Assign( pTxtNd, 0 );
 
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index d09e1f3..9579433 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -806,7 +806,7 @@ SwCntntNode* GetNode( SwPaM & rPam, bool& rbFirst, SwMoveFn fnMove,
                             pNd = 0;
                             continue;
                         }
-                        *(SwPosition*)rPam.GetPoint() = aPos;
+                        *rPam.GetPoint() = aPos;
                     }
                     else
                         pNd = 0; // no valid node
@@ -874,7 +874,7 @@ bool GoInDoc( SwPaM & rPam, SwMoveFn fnMove )
 
 bool GoInSection( SwPaM & rPam, SwMoveFn fnMove )
 {
-    (*fnMove->fnSections)( (SwPosition*)rPam.GetPoint() );
+    (*fnMove->fnSections)( rPam.GetPoint() );
     return true;
 }
 
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 0000eb9..1df0894 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -74,7 +74,7 @@ struct _PercentHdl
     }
 
     _PercentHdl( const SwPaM& rPam )
-        : pDSh( (SwDocShell*)rPam.GetDoc()->GetDocShell() )
+        : pDSh( rPam.GetDoc()->GetDocShell() )
     {
         sal_uLong nStt, nEnd;
         if( rPam.GetPoint()->nNode == rPam.GetMark()->nNode )
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index 79bf10c..1f0260e 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -162,7 +162,7 @@ namespace
         }
         virtual void Restore(SwNode& rNd, sal_Int32 nLen, sal_Int32 nCorrLen) SAL_OVERRIDE
         {
-            SwCntntNode* pCNd = (SwCntntNode*)rNd.GetCntntNode();
+            SwCntntNode* pCNd = rNd.GetCntntNode();
             SwDoc* pDoc = rNd.GetDoc();
             updater_t aUpdater = LimitUpdater(pCNd, nLen, nCorrLen);
             RestoreBkmks(pDoc, aUpdater);
@@ -296,9 +296,9 @@ void CntntIdxStoreImpl::RestoreRedlines(SwDoc* pDoc, updater_t& rUpdater)
     const SwRedlineTbl& rRedlTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl();
     for (const MarkEntry& aEntry : m_aRedlineEntries)
     {
-        SwPosition* const pPos = (SwPosition*)( aEntry.m_bOther
+        SwPosition* const pPos = aEntry.m_bOther
             ? rRedlTbl[ aEntry.m_nIdx ]->GetMark()
-            : rRedlTbl[ aEntry.m_nIdx ]->GetPoint());
+            : rRedlTbl[ aEntry.m_nIdx ]->GetPoint();
         rUpdater(*pPos, aEntry.m_nCntnt);
     }
 }
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 562b54e..970d2bc 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3434,7 +3434,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
 bool DocumentContentOperationsManager::lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
 {
     ParaRstFmt* pPara = static_cast<ParaRstFmt*>(pArgs);
-    SwTxtNode * pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
+    SwTxtNode * pTxtNode = rpNd->GetTxtNode();
     if( pTxtNode && pTxtNode->GetpSwpHints() )
     {
         SwIndex aSt( pTxtNode, 0 );
@@ -3568,7 +3568,7 @@ bool DocumentContentOperationsManager::DeleteRangeImpl(SwPaM & rPam, const bool)
 
 bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam)
 {
-    SwPosition *pStt = (SwPosition*)rPam.Start(), *pEnd = (SwPosition*)rPam.End();
+    SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
 
     if( !rPam.HasMark() || *pStt >= *pEnd )
         return false;
@@ -3764,8 +3764,8 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
         SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
         ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
 
-        SwPosition *pStt = (SwPosition*)aDelPam.Start(),
-                   *pEnd = (SwPosition*)aDelPam.End();
+        SwPosition *pStt = aDelPam.Start(),
+                   *pEnd = aDelPam.End();
         OSL_ENSURE( pStt->nNode == pEnd->nNode ||
                 ( pStt->nNode.GetIndex() + 1 == pEnd->nNode.GetIndex() &&
                     !pEnd->nContent.GetIndex() ),
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 9c3e75f..5eba073 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1092,7 +1092,7 @@ sal_uInt16 SwDoc::GetRefMarks( std::vector<OUString>* pNames ) const
 
 static bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs )
 {
-    SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
+    SwTxtNode *pTxtNode = rpNd->GetTxtNode();
     bool bOnlyWrong = *static_cast<sal_Bool*>(pArgs);
     if( pTxtNode )
     {
@@ -1120,7 +1120,7 @@ static bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs )
 
 static bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void*  )
 {
-    SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
+    SwTxtNode *pTxtNode = rpNd->GetTxtNode();
     if( pTxtNode )
     {
         pTxtNode->SetSmartTagDirty( true );
@@ -1279,7 +1279,7 @@ bool SwDoc::RemoveInvisibleContent()
         for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld;  pFmtFld = aIter.Next() )
         {
             if( pFmtFld->GetTxtFld() &&
-                0 != ( pTxtNd = (SwTxtNode*)pFmtFld->GetTxtFld()->GetpTxtNode() ) &&
+                0 != ( pTxtNd = pFmtFld->GetTxtFld()->GetpTxtNode() ) &&
                 pTxtNd->GetpSwpHints() && pTxtNd->HasHiddenParaField() &&
                 &pTxtNd->GetNodes() == &GetNodes() )
             {
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index ff8190f..5324063 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -399,7 +399,7 @@ bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
             SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
             if( pObj->ISA(SwVirtFlyDrawObj) )
             {
-                SwFlyFrmFmt* pFrmFmt = (SwFlyFrmFmt*)
+                SwFlyFrmFmt* pFrmFmt =
                     static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm()->GetFmt();
                 if( pFrmFmt )
                 {
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 287c8d1..a83eb03 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -750,7 +750,7 @@ static bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs )
                 }
                 long nStat = nPageNr >= *pPageSt ? nPageNr - *pPageSt + 1
                                          : nPageNr + *pPageCnt - *pPageSt + 1;
-                ::SetProgressState( nStat, (SwDocShell*)pNode->GetDoc()->GetDocShell() );
+                ::SetProgressState( nStat, pNode->GetDoc()->GetDocShell() );
             }
             pHyphArgs->SetRange( rpNd );
             if( pNode->Hyphenate( *pHyphArgs ) )
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 5e41a85..4ba534c 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -99,7 +99,7 @@ static void SetTxtFmtCollNext( SwTxtFmtColl* pTxtColl, const SwTxtFmtColl* pDel
 static bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
 {
     const sw::DocumentContentOperationsManager::ParaRstFmt* pPara = static_cast<sw::DocumentContentOperationsManager::ParaRstFmt*>(pArgs);
-    SwCntntNode* pNode = (SwCntntNode*)rpNd->GetCntntNode();
+    SwCntntNode* pNode = rpNd->GetCntntNode();
     if( pNode && pNode->HasSwAttrSet() )
     {
         const bool bLocked = pNode->IsModifyLocked();
@@ -1115,7 +1115,7 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt,
         {
             // Does the Doc already contain the template?
             if( rFmtArr.GetFmt(n)->GetName()==rFmt.GetName() )
-                return (SwFmt*)rFmtArr.GetFmt(n);
+                return rFmtArr.GetFmt(n);
         }
 
     // Search for the "parent" first
@@ -1258,7 +1258,7 @@ void SwDoc::CopyFmtArr( const SwFmtsBase& rSourceArr,
     // 1st step: Create all formats (skip the 0th - it's the default one)
     for( size_t nSrc = rSourceArr.GetFmtCount(); nSrc > 1; )
     {
-        pSrc = (SwFmt*)rSourceArr.GetFmt( --nSrc );
+        pSrc = rSourceArr.GetFmt( --nSrc );
         if( pSrc->IsDefault() || pSrc->IsAuto() )
             continue;
 
@@ -1275,7 +1275,7 @@ void SwDoc::CopyFmtArr( const SwFmtsBase& rSourceArr,
     // 2nd step: Copy all attributes, set the right parents
     for( size_t nSrc = rSourceArr.GetFmtCount(); nSrc > 1; )
     {
-        pSrc = (SwFmt*)rSourceArr.GetFmt( --nSrc );
+        pSrc = rSourceArr.GetFmt( --nSrc );
         if( pSrc->IsDefault() || pSrc->IsAuto() )
             continue;
 
@@ -1606,7 +1606,7 @@ SwFmt* SwDoc::FindFmtByName( const SwFmtsBase& rFmtArr,
         // Does the Doc already contain the template?
         if( rFmtArr.GetFmt(n)->GetName() == rName )
         {
-            pFnd = (SwFmt*)rFmtArr.GetFmt(n);
+            pFnd = rFmtArr.GetFmt(n);
             break;
         }
     }
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index c73ebca..0d0ebe4 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -402,7 +402,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
                     // So that this FlyFrame is preserved.
                     if( aRg.aEnd.GetNode().IsEndNode() )
                         GetNodes().MakeTxtNode( aRg.aStart,
-                                    (SwTxtFmtColl*)GetDfltTxtFmtColl() );
+                                    GetDfltTxtFmtColl() );
 
                     getIDocumentContentOperations().MoveNodeRange( aRg, aPos.nNode, SwMoveFlags::DEFAULT );
                 }
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 3637d34..69ee652 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -622,7 +622,7 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
 
         if( pS != pT )
         {
-            SwFrmFmt* pTFmt = (SwFrmFmt*)pT->GetFrmFmt();
+            SwFrmFmt* pTFmt = pT->GetFrmFmt();
             const SfxItemSet* pSSet = rBox.GetItemSet( i, nS );
 
             if( pSSet ||
@@ -666,7 +666,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
 
         if( pS != pT )
         {
-            SwFrmFmt* pTFmt = (SwFrmFmt*)pT->GetFrmFmt();
+            SwFrmFmt* pTFmt = pT->GetFrmFmt();
             const SfxItemSet* pSSet = rBox.GetItemSet( nS, i );
 
             if( pSSet ||
@@ -708,7 +708,7 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
     // points to the first ContentNode
     if( pNd->StartOfSectionNode() == pSource->GetSttNd() )
         pNd = pDoc->GetNodes().MakeTxtNode( aRg.aStart,
-                (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
+                pDoc->GetDfltTxtFmtColl() );
     aRg.aEnd = *pNd->EndOfSectionNode();
 
     // If the Target is empty (there is one empty Node)
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index e26b20f..9a2cbba 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -993,7 +993,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
                                 sw::DefaultToxTabStopTokenHandler::TABSTOPS_RELATIVE_TO_INDENT :
                                 sw::DefaultToxTabStopTokenHandler::TABSTOPS_RELATIVE_TO_PAGE);
         sw::ToxTextGenerator ttgn(GetTOXForm(), tabStopTokenHandler);
-        ttgn.GenerateText((SwDoc*) GetFmt()->GetDoc(), aSortArr, nCnt, nRange);
+        ttgn.GenerateText(GetFmt()->GetDoc(), aSortArr, nCnt, nRange);
         nCnt += nRange - 1;
     }
 
@@ -1038,7 +1038,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
 
 void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     OUString sLastDeli;
     SwTOXSortTabBases::size_type i = 0;
     while( i < aSortArr.size() )
@@ -1079,7 +1079,7 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
 /// Evaluate Template
 SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     const OUString& rName = GetTOXForm().GetTemplate( nLevel );
     SwTxtFmtColl* pColl = !rName.isEmpty() ? pDoc->FindTxtFmtCollByName(rName) :0;
     if( !pColl )
@@ -1134,7 +1134,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
     if( !pType->HasWriterListeners() )
         return;
 
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     TOXTypes eTOXTyp = GetTOXType()->GetType();
     SwIterator<SwTOXMark,SwTOXType> aIter( *pType );
 
@@ -1202,7 +1202,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
 /// Generate table of contents from outline
 void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     SwNodes& rNds = pDoc->GetNodes();
 
     const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
@@ -1227,7 +1227,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
 /// Generate table of contents from template areas
 void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
     {
         const OUString sTmpStyleNames = GetStyleNames(i);
@@ -1268,7 +1268,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
 /// Generate content from sequence fields
 void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     SwFieldType* pSeqFld = pDoc->getIDocumentFieldsAccess().GetFldType(RES_SETEXPFLD, GetSequenceName(), false);
     if(!pSeqFld)
         return;
@@ -1310,7 +1310,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
 
 void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     SwFieldType* pAuthFld = pDoc->getIDocumentFieldsAccess().GetFldType(RES_AUTHORITY, OUString(), false);
     if(!pAuthFld)
         return;
@@ -1396,7 +1396,7 @@ static long lcl_IsSOObject( const SvGlobalName& rFactoryNm )
 void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
                                     const SwTxtNode* pOwnChapterNode )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     SwNodes& rNds = pDoc->GetNodes();
     // on the 1st Node of the 1st Section
     sal_uLong nIdx = rNds.GetEndOfAutotext().StartOfSectionIndex() + 2,
@@ -1496,7 +1496,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
 /// Collect table entries
 void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
 {
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
     SwNodes& rNds = pDoc->GetNodes();
     const SwFrmFmts& rArr = *pDoc->GetTblFrmFmts();
 
@@ -1550,7 +1550,7 @@ void SwTOXBaseSection::UpdatePageNum()
     // Insert the current PageNumber into the TOC
     SwPageFrm*  pAktPage    = 0;
     sal_uInt16      nPage       = 0;
-    SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
+    SwDoc* pDoc = GetFmt()->GetDoc();
 
     SwTOXInternational aIntl( GetLanguage(),
                               TOX_INDEX == GetTOXType()->GetType() ?
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index cc43de1..1af1548 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1733,7 +1733,7 @@ void SwHTMLTableLayout::_Resize( sal_uInt16 nAbsAvail, bool bRecalc )
     if( bRecalc )
         AutoLayoutPass1();
 
-    SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout();
+    SwRootFrm *pRoot = GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout();
     if ( pRoot && pRoot->IsCallbackActionEnabled() )
         pRoot->StartAllAction();
 
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 8a01ce7..085f502 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -227,7 +227,7 @@ SwNumFmt::~SwNumFmt()
 void SwNumFmt::NotifyGraphicArrived()
 {
     if( GetCharFmt() )
-        UpdateNumNodes( (SwDoc*)GetCharFmt()->GetDoc() );
+        UpdateNumNodes( GetCharFmt()->GetDoc() );
 }
 
 // #i22362#
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 8d0d7d7..f2adfb5 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -535,7 +535,7 @@ static void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
     if( pRg.get() )
         pCpyDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly( *pRg, 0, aInsIdx, NULL, false );
     else
-        pDoc->GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
+        pDoc->GetNodes().MakeTxtNode( aInsIdx, pDoc->GetDfltTxtFmtColl() );
     ++aSavePos;
 
     SwTableLine* pLine = pDstBox->GetUpper();
@@ -729,7 +729,7 @@ bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
     SwTableNode* pTblNd = pDoc->IsIdxInTbl( rSttBox );
 
     // Find the Box, to which should be copied:
-    SwTableBox* pMyBox = (SwTableBox*)GetTblBox(
+    SwTableBox* pMyBox = GetTblBox(
             rSttBox.GetNode().FindTableBoxStartNode()->GetIndex() );
 
     OSL_ENSURE( pMyBox, "Index is not in a Box in this Table" );
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 420318f..eee05b9 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -356,7 +356,7 @@ static void lcl_CopyCol( _FndBox & rFndBox, _CpyPara *const pCpyPara)
         else
         {
             aFindFrm = pCpyPara->rTabFrmArr[ nFndPos ];
-            pBox->ChgFrmFmt( (SwTableBoxFmt*)aFindFrm.pNewFrmFmt );
+            pBox->ChgFrmFmt( aFindFrm.pNewFrmFmt );
         }
     }
     else
@@ -1251,7 +1251,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
         else
         {
             aFindFrm = aFrmArr[ nFndPos ];
-            pSelBox->ChgFrmFmt( (SwTableBoxFmt*)aFindFrm.pNewFrmFmt );
+            pSelBox->ChgFrmFmt( aFindFrm.pNewFrmFmt );
             pLastBoxFmt = aLastBoxArr[ nFndPos ];
         }
 
@@ -1456,7 +1456,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
     if( pULPara->bUL_LR )   // UpperLower ?
     {
         sal_uInt16 nPos;
-        SwTableLine* pFndLn = (SwTableLine*)rFndLine.GetLine();
+        SwTableLine* pFndLn = rFndLine.GetLine();
         pLines = pFndLn->GetUpper() ?
                         &pFndLn->GetUpper()->GetTabLines() :
                         &pULPara->pTblNd->GetTable().GetTabLines();
@@ -1880,7 +1880,7 @@ static void lcl_CopyBoxToDoc(_FndBox const& rFndBox, _CpyPara *const pCpyPara)
             // Create an empty Box
             pCpyPara->pDoc->GetNodes().InsBoxen( pCpyPara->pTblNd, pCpyPara->pInsLine,
                             aFindFrm.pNewFrmFmt,
-                            (SwTxtFmtColl*)pCpyPara->pDoc->GetDfltTxtFmtColl(),
+                            pCpyPara->pDoc->GetDfltTxtFmtColl(),
                             0, pCpyPara->nInsPos );
             pBox = pCpyPara->pInsLine->GetTabBoxes()[ pCpyPara->nInsPos ];
             if( bDummy )
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 7dafb6b..6f8ea5e 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -116,7 +116,7 @@ bool SwDoc::IsVisitedURL( const OUString& rURL )
         // We also want to be informed about status updates in the History
         if( !mpURLStateChgd )
         {
-            SwDoc* pD = (SwDoc*)this;
+            SwDoc* pD = this;
             pD->mpURLStateChgd = new SwURLStateChanged( this );
         }
     }
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 5f7b6df..71b418d 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -885,7 +885,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
             pCpyTNd->MakeFrms( *pTNd );
         }
         else
-            new SwTxtNode( aInsPos, (SwTxtFmtColl*)GetDoc()->GetDfltTxtFmtColl() );
+            new SwTxtNode( aInsPos, GetDoc()->GetDfltTxtFmtColl() );
     }
     new SwEndNode( aInsPos, *pSectNd );
 
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index fe562d5..c9ebc12 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -316,7 +316,7 @@ bool SwNodes::InsBoxen( SwTableNode* pTblNd,
             // Handle Outline numbering correctly!
             SwTxtNode* pTNd = new SwTxtNode(
                             SwNodeIndex( *pSttNd->EndOfSectionNode() ),
-                            (SwTxtFmtColl*)GetDoc()->GetDfltTxtFmtColl(),
+                            GetDoc()->GetDfltTxtFmtColl(),
                             pAutoAttr );
             pTNd->ChgFmtColl( pTxtColl );
         }
@@ -2416,7 +2416,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
                             dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) );
             }
         }
-        ((SwTabFrm*)pNew)->RegistFlys();
+        pNew->RegistFlys();
     }
 }
 
@@ -3393,7 +3393,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, bool bAfter,
     // Insert an EndNode and TableNode into the Nodes Array
     SwTableNode * pNewTblNd;
     {
-        SwEndNode* pOldTblEndNd = (SwEndNode*)pTNd->EndOfSectionNode()->GetEndNode();
+        SwEndNode* pOldTblEndNd = pTNd->EndOfSectionNode()->GetEndNode();
         OSL_ENSURE( pOldTblEndNd, "Where is the EndNode?" );
 
         SwNodeIndex aIdx( *pBox->GetSttNd() );
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index ee96eb7..15da2b3 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1344,7 +1344,7 @@ void SwCntntNode::DelFrms( bool bIsDisposeAccTable )
 
         if( pFrm->IsFollow() )
         {
-            SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
+            SwCntntFrm* pMaster = pFrm->FindMaster();
             pMaster->SetFollow( pFrm->GetFollow() );
         }
         pFrm->SetFollow( 0 );//So it doesn't get funny ideas.
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 37d9b55..48c376f 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -167,7 +167,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell )
                 {
                     // First cursor represents the target position!!
                     rPaM.DeleteMark();
-                    pPos = (SwPosition*)rPaM.GetPoint();
+                    pPos = rPaM.GetPoint();
                     continue;
                 }
                 else
@@ -215,7 +215,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell )
             {
                 // First cursor represents the target position!!
                 rPaM.DeleteMark();
-                pPos = (SwPosition*)rPaM.GetPoint();
+                pPos = rPaM.GetPoint();
                 continue;
             }
             else
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 67d7356..75139a9 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2128,7 +2128,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
     pGetFld->SetText( OUString() );
 
     // then search the correct RefPageSet field
-    SwTxtNode* pTxtNode = (SwTxtNode*)&pTxtFld->GetTxtNode();
+    SwTxtNode* pTxtNode = &pTxtFld->GetTxtNode();
     if( pTxtNode->StartOfSectionIndex() >
         pDoc->GetNodes().GetEndOfExtras().GetIndex() )
     {
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 4b99ae8..6ea05f5 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -847,7 +847,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
                         static_cast<SwSetExpField*>(pFmtFld->GetField())->GetSeqNumber() )
                     {
                         SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
-                        pTxtNd = (SwTxtNode*)pTxtFld->GetpTxtNode();
+                        pTxtNd = pTxtFld->GetpTxtNode();
                         *pStt = pTxtFld->GetStart();
                         if( pEnd )
                             *pEnd = (*pStt) + 1;
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index 29d878e..b993fd8 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -84,7 +84,7 @@ const SwNode* SwTblField::GetNodeOfFormula() const
     SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() );
     for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
             if( this == pFmtFld->GetField() )
-                return (SwTxtNode*)&pFmtFld->GetTxtFld()->GetTxtNode();
+                return &pFmtFld->GetTxtFld()->GetTxtNode();
     return 0;
 }
 
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 4618a33..5611070 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -97,7 +97,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt )
         pClpDoc->GetNodes().Delete( aSttIdx,
             pClpDoc->GetNodes().GetEndOfContent().GetIndex() - aSttIdx.GetIndex() );
         pTxtNd = pClpDoc->GetNodes().MakeTxtNode( aSttIdx,
-                            (SwTxtFmtColl*)pClpDoc->GetDfltTxtFmtColl() );
+                            pClpDoc->GetDfltTxtFmtColl() );
         --aSttIdx;
     }
 
@@ -146,7 +146,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt )
 
        // assure the "RootFmt" is the first element in Spz-Array
         // (if necessary Flys were copied in Flys)
-        SwFrmFmts& rSpzFrmFmts = *(SwFrmFmts*)pClpDoc->GetSpzFrmFmts();
+        SwFrmFmts& rSpzFrmFmts = *pClpDoc->GetSpzFrmFmts();
         if( rSpzFrmFmts[ 0 ] != pFlyFmt )
         {
             SwFrmFmts::iterator it = std::find( rSpzFrmFmts.begin(), rSpzFrmFmts.end(), pFlyFmt );
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 0636002..a7b1c1f 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1040,7 +1040,7 @@ bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
 
             if( SfxItemState::SET == rSet.GetItemState( RES_ANCHOR, false ))
                 sw_ChkAndSetNewAnchor( *pFly, rSet );
-            SwFlyFrmFmt* pFlyFmt = (SwFlyFrmFmt*)pFly->GetFmt();
+            SwFlyFrmFmt* pFlyFmt = pFly->GetFmt();
 
             if( GetDoc()->SetFlyFrmAttr( *pFlyFmt, rSet ))
             {
@@ -1171,7 +1171,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, bool bKeepOrient, Point* pDocPos )
         StartAllAction();
         SET_CURR_SHELL( this );
 
-        SwFlyFrmFmt* pFlyFmt = (SwFlyFrmFmt*)pFly->GetFmt();
+        SwFlyFrmFmt* pFlyFmt = pFly->GetFmt();
         const Point aPt( pFly->Frm().Pos() );
 
         SfxItemSet* pSet = 0;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index cf8481b..00eee4f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2597,14 +2597,14 @@ SwChainRet SwFEShell::Chain( SwFrmFmt &rSource, const Point &rPt )
         StartAllAction();
         SdrObject* pObj;
         SdrPageView* pPView;
-        SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
+        SwDrawView *pDView = Imp()->GetDrawView();
         const auto nOld = pDView->GetHitTolerancePixel();
         pDView->SetHitTolerancePixel( 0 );
         pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SdrSearchOptions::PICKMARKABLE );
         pDView->SetHitTolerancePixel( nOld );
         SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
 
-        SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)pFly->GetFmt();
+        SwFlyFrmFmt *pFmt = pFly->GetFmt();
         GetDoc()->Chain(rSource, *pFmt);
         EndAllAction();
         SetChainMarker();
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 95fe266a..d5e742a 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -860,7 +860,7 @@ static void lcl_InsTblBox( SwTableNode* pTblNd, SwDoc* pDoc, SwTableBox* pBox,
     else
         pDoc->GetNodes().InsBoxen( pTblNd, pBox->GetUpper(),
                 static_cast<SwTableBoxFmt*>(pBox->GetFrmFmt()),
-                (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl(), 0,
+                pDoc->GetDfltTxtFmtColl(), 0,
                 nInsPos, nCnt );
 }
 
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index b69a258..afd6b12 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -751,7 +751,7 @@ SwFrm *SwFrm::_FindNext()
                        )
                     {
                         pRet = pNxtCnt->IsInTab() ? pNxtCnt->FindTabFrm()
-                                                    : (SwFrm*)pNxtCnt;
+                                                    : pNxtCnt;
                         break;
                     }
                     pNxtCnt = lcl_NextFrm( pNxtCnt );
@@ -760,7 +760,7 @@ SwFrm *SwFrm::_FindNext()
             else if ( pThis->IsInFly() )
             {
                 pRet = pNxtCnt->IsInTab() ? pNxtCnt->FindTabFrm()
-                                            : (SwFrm*)pNxtCnt;
+                                            : pNxtCnt;
             }
             else    //footer-/or header section
             {
@@ -775,7 +775,7 @@ SwFrm *SwFrm::_FindNext()
                 if ( pCntUp == pUp )
                 {
                     pRet = pNxtCnt->IsInTab() ? pNxtCnt->FindTabFrm()
-                                                : (SwFrm*)pNxtCnt;
+                                                : pNxtCnt;
                 }
             }
         }
@@ -1531,7 +1531,7 @@ SwCellFrm* SwCellFrm::GetPreviousCell() const
 
         if ( bIsInFirstLine )
         {
-            SwTabFrm *pMaster = (SwTabFrm*)pTab->FindMaster();
+            SwTabFrm *pMaster = pTab->FindMaster();
             if ( pMaster && pMaster->HasFollowFlowLine() )
             {
                 SwRowFrm* pMasterRow = static_cast<SwRowFrm*>(pMaster->GetLastLower());
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index a41bb67..4af6708 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2506,7 +2506,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat )
                 {
                     // First page could get empty for example by disabling
                     // a section
-                    SwFrm::CheckPageDescs( (SwPageFrm*)pNewPage, false);
+                    SwFrm::CheckPageDescs( pNewPage, false);
                 }
             }
         }
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 3d00dcf..c183d74 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -408,7 +408,7 @@ void SwFlyFrm::InitDrawObj( bool bNotify )
     if ( !pContact )
     {
         // #i52858# - method name changed
-        pContact = new SwFlyDrawContact( (SwFlyFrmFmt*)GetFmt(),
+        pContact = new SwFlyDrawContact( GetFmt(),
                                           pIDDMA->GetOrCreateDrawModel() );
     }
     OSL_ENSURE( pContact, "InitDrawObj failed" );
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index fd59530..20ac174 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -343,7 +343,7 @@ void SwFlyAtCntFrm::MakeAll()
         {
             bSetCompletePaintOnInvalidate = true;
             {
-                SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
+                SwFlyFrmFmt *pFmt = GetFmt();
                 const SwFmtFrmSize &rFrmSz = GetFmt()->GetFrmSize();
                 if( rFrmSz.GetHeightPercent() != 0xFF &&
                     rFrmSz.GetHeightPercent() >= 100 )
@@ -1284,7 +1284,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
         }
     }
 
-    SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
+    SwFlyFrmFmt *pFmt = GetFmt();
 
     if( bVert )
     {
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 1d9c8ba..7758b7a 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -153,7 +153,7 @@ void SwFlyInCntFrm::MakeObjPos()
     if ( !mbValidPos )
     {
         mbValidPos = true;
-        SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
+        SwFlyFrmFmt *pFmt = GetFmt();
         const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
         //Update the current values in the format if needed, during this we of
         //course must not send any Modify.
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 61ce8bb..8e5dce7 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -403,7 +403,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                      static_cast<SwCntntFrm*>(Lower())->GetNode()->GetOLENode() &&
                      ( bWidthClipped || bHeightClipped ) )
                 {
-                    SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
+                    SwFlyFrmFmt *pFmt = GetFmt();
                     pFmt->LockModify();
                     SwFmtFrmSize aFrmSize( rSz );
                     aFrmSize.SetWidth( aFrmRect.Width() );
@@ -886,7 +886,7 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
         else
         {
             OSL_ENSURE( pFmt, ":-( No Format given for Fly." );
-            pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this, this );
+            pFly = new SwFlyLayFrm( pFmt, this, this );
             AppendFly( pFly );
             ::RegistFlys( this, pFly );
         }
@@ -1173,7 +1173,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
     else
     {
         const SwDrawContact *pC = static_cast<const SwDrawContact*>(GetUserCall(pSdrObj));
-        const SwFrmFmt  *pFmt = (const SwFrmFmt*)pC->GetFmt();
+        const SwFrmFmt  *pFmt = pC->GetFmt();
         const SwFmtAnchor &rAnch = pFmt->GetAnchor();
         if ( FLY_AS_CHAR == rAnch.GetAnchorId() )
         {
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 197290a..23f683a 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -495,7 +495,7 @@ void SwFtnFrm::Cut()
     SwLayoutFrm *pUp = GetUpper();
 
     // correct chaining
-    SwFtnFrm *pFtn = (SwFtnFrm*)this;
+    SwFtnFrm *pFtn = this;
     if ( pFtn->GetFollow() )
         pFtn->GetFollow()->SetMaster( pFtn->GetMaster() );
     if ( pFtn->GetMaster() )
@@ -732,7 +732,7 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
                     }
                     else
                     {
-                        pSect = (SwSectionFrm*)pSect->FindMaster();
+                        pSect = pSect->FindMaster();
                         if( !pSect || !pSect->Lower() )
                             return 0;
                         OSL_ENSURE( pSect->Lower()->IsColumnFrm(),
@@ -1586,7 +1586,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
                         continue;
                     }
                 }
-                pCnt = (SwCntntFrm*)pCnt->FindNextCnt();
+                pCnt = pCnt->FindNextCnt();
             }
             // #i49383#
             if ( !bOldFtnFrmLocked )
@@ -1667,7 +1667,7 @@ void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
         if( bPrep && pRef->IsFollow() )
         {
             OSL_ENSURE( pRef->IsTxtFrm(), "NoTxtFrm has Footnote?" );
-            SwTxtFrm* pMaster = (SwTxtFrm*)pRef->FindMaster();
+            SwTxtFrm* pMaster = pRef->FindMaster();
             if( !pMaster->IsLocked() )
                 pMaster->Prepare( PREP_FTN_GONE );
         }
@@ -2596,7 +2596,7 @@ bool SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
         {
             if ( static_cast<SwTxtFrm*>(pStart)->HasFtn() )
                 static_cast<SwFtnBossFrm*>(pNewChief)->CollectFtns( pStart,
-                                        (SwFtnBossFrm*)pOldBoss, *pFtnArr );
+                                        pOldBoss, *pFtnArr );
             pStart = pStart->GetNextCntntFrm();
         }
         if( pFtnArr->empty() )
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 732c67a..e8010ae 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1618,7 +1618,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect )
         SwLayoutFrm *pLow = static_cast<SwLayoutFrm*>(pTab->Lower());
         while ( pLow )
         {
-            bChanged |= FormatLayout( (SwLayoutFrm*)pLow, bAddRect );
+            bChanged |= FormatLayout( pLow, bAddRect );
             if ( IsAgain() )
                 return false;
             pLow = static_cast<SwLayoutFrm*>(pLow->GetNext());
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 144973b..cb8ccff 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1632,7 +1632,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
                                     pLayLeaf->FindFtnBossFrm( true ), false );
                     }
                 }
-                ((SwFlowFrm*)pNxt)->MoveSubTree( pLayLeaf, pNew->GetNext() );
+                pNxt->MoveSubTree( pLayLeaf, pNew->GetNext() );
             }
             if( pNew->GetFollow() )
                 pNew->SimpleFormat();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 79dc690..fe60fda 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -434,7 +434,7 @@ static void lcl_MoveRowContent( SwRowFrm& rSourceLine, SwRowFrm& rDestLine )
         }
         else
         {
-            SwFrm *pTmp = ::SaveCntnt( (SwCellFrm*)pCurrSourceCell );
+            SwFrm *pTmp = ::SaveCntnt( pCurrSourceCell );
             if ( pTmp )
             {
                 // NEW TABLES
@@ -640,7 +640,7 @@ static bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
     // Lock this tab frame and its follow
     bool bUnlockMaster = false;
     bool bUnlockFollow = false;
-    SwTabFrm* pMaster = rTab.IsFollow() ? (SwTabFrm*)rTab.FindMaster() : 0;
+    SwTabFrm* pMaster = rTab.IsFollow() ? rTab.FindMaster() : 0;
     if ( pMaster && !pMaster->IsJoinLocked() )
     {
         bUnlockMaster = true;
@@ -1696,7 +1696,7 @@ void SwTabFrm::MakeAll()
 
     if ( HasFollow() )
     {
-        SwTabFrm* pFollowFrm = (SwTabFrm*)GetFollow();
+        SwTabFrm* pFollowFrm = GetFollow();
         OSL_ENSURE( !pFollowFrm->IsJoinLocked() || !pFollowFrm->IsRebuildLastLine(),
                 "SwTabFrm::MakeAll for master while follow is in RebuildLastLine()" );
         if ( pFollowFrm->IsJoinLocked() && pFollowFrm->IsRebuildLastLine() )
@@ -1929,7 +1929,7 @@ void SwTabFrm::MakeAll()
                 SwFrm *pFrm = GetFirstNonHeadlineRow();
                 if( pFrm && n1StLineHeight >(pFrm->Frm().*fnRect->fnGetHeight )() )
                 {
-                    SwTabFrm *pMaster = (SwTabFrm*)FindMaster();
+                    SwTabFrm *pMaster = FindMaster();
                     bool bDummy;
                     if ( ShouldBwdMoved( pMaster->GetUpper(), false, bDummy ) )
                         pMaster->InvalidatePos();
@@ -2378,7 +2378,7 @@ void SwTabFrm::MakeAll()
                             pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
                             pAttrs = pAccess->Get();
 
-                            ((SwTabFrm*)GetFollow())->SetLowersFormatted(false);
+                            GetFollow()->SetLowersFormatted(false);
                             // #i43913# - lock follow table
                             // to avoid its formatting during the format of
                             // its content.
@@ -2420,7 +2420,7 @@ void SwTabFrm::MakeAll()
                             --nStack;
                         }
                         else if ( GetFollow() == GetNext() )
-                            ((SwTabFrm*)GetFollow())->MoveFwd( true, false );
+                            GetFollow()->MoveFwd( true, false );
                     }
                     continue;
                 }
@@ -5340,7 +5340,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
         {
             const bool bOldJoinLock = IsJoinLocked();
             const_cast<SwTabFrm*>(this)->LockJoin();
-            const SwTwips nHeightOfFirstContentLine = lcl_CalcHeightOfFirstContentLine( *(SwRowFrm*)pFirstRow );
+            const SwTwips nHeightOfFirstContentLine = lcl_CalcHeightOfFirstContentLine( *pFirstRow );
 
             // Consider minimum row height:
             const SwFmtFrmSize &rSz = static_cast<const SwRowFrm*>(pFirstRow)->GetFmt()->GetFrmSize();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index bc127de..076f215 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -609,7 +609,7 @@ bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
     if( &pPam->GetNode() != GetNode() )
         return false;
     const_cast<SwCntntNode*>(GetNode())->
-        MakeStartIndex((SwIndex *) &pPam->GetPoint()->nContent);
+        MakeStartIndex(&pPam->GetPoint()->nContent);
     return true;
 }
 
@@ -618,7 +618,7 @@ bool SwCntntFrm::RightMargin(SwPaM *pPam, bool) const
     if( &pPam->GetNode() != GetNode() )
         return false;
     const_cast<SwCntntNode*>(GetNode())->
-        MakeEndIndex((SwIndex *) &pPam->GetPoint()->nContent);
+        MakeEndIndex(&pPam->GetPoint()->nContent);
     return true;
 }
 
@@ -933,9 +933,9 @@ static bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
         SwCntntNode *pCNd = const_cast<SwCntntNode*>(pCnt->GetNode());
         pPam->GetPoint()->nNode = *pCNd;
         if ( fnNxtPrv == lcl_GetPrvCnt )
-            pCNd->MakeEndIndex( (SwIndex*)&pPam->GetPoint()->nContent );
+            pCNd->MakeEndIndex( &pPam->GetPoint()->nContent );
         else
-            pCNd->MakeStartIndex( (SwIndex*)&pPam->GetPoint()->nContent );
+            pCNd->MakeStartIndex( &pPam->GetPoint()->nContent );
         return true;
     }
     return false;
@@ -1012,7 +1012,7 @@ sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
     {
         SwCntntNode* pCNd = const_cast<SwCntntNode*>(pCntnt->GetNode());
         pToSet->GetPoint()->nNode = *pCNd;
-        pCNd->MakeStartIndex( (SwIndex*)&pToSet->GetPoint()->nContent );
+        pCNd->MakeStartIndex( &pToSet->GetPoint()->nContent );
         pToSet->GetPoint()->nContent = static_cast<const SwTxtFrm*>(pCntnt)->GetOfst();
 
         SwShellCrsr* pSCrsr = dynamic_cast<SwShellCrsr*>(pToSet);
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 6ab0164..649d0b7 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -443,7 +443,7 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
         OUString());
 
     SwOLENode* pOLENd = pDoc->GetNodes().MakeOLENode( rIdx, aNewName, GetAspect(),
-                                    (SwGrfFmtColl*)pDoc->GetDfltGrfFmtColl(),
+                                    pDoc->GetDfltGrfFmtColl(),
                                     const_cast<SwAttrSet*>(GetpSwAttrSet()) );
 
     pOLENd->SetChartTblName( GetChartTblName() );
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 685fcfa..48de8ac 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -228,7 +228,7 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
     }
     else
         pDoc->GetNodes().InsBoxen( pTblNd, pLine, pBoxFrmFmt,
-                (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl(), 0,
+                pDoc->GetDfltTxtFmtColl(), 0,
                 nInsPos, nCnt );
 
     long nRowSpan = pBox->getRowSpan();
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 36d41f4..ab8f3cb 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1571,7 +1571,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
             {
                 if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
                 {
-                    const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode();
+                    const SwTxtNode* pTNd = pFirst->GetTxtFld()->GetpTxtNode();
                     OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
 
                     // 1. Check if the whole paragraph is hidden
@@ -1822,7 +1822,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
         {
             if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
             {
-                const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode();
+                const SwTxtNode* pTNd = pFirst->GetTxtFld()->GetpTxtNode();
                OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
 
                 // 1. Check if the whole paragraph is hidden
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 018b448..2fb6b16 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -245,7 +245,7 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
     if( pNew && pNew->Which() == RES_OBJECTDYING )
         return;
 
-    SwTxtNode* pTxtNd = (SwTxtNode*)&mpTxtFld->GetTxtNode();
+    SwTxtNode* pTxtNd = &mpTxtFld->GetTxtNode();
     OSL_ENSURE( pTxtNd, "wo ist denn mein Node?" );
     if( pNew )
     {
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 7af7b01..923da67 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -145,17 +145,17 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
         if ( bResetMod )
         {
             aOle2Lnk = pDoc->GetOle2Link();
-            ( (SwDoc*) pDoc )->SetOle2Link( Link<>() );
+            pDoc->SetOle2Link( Link<>() );
         }
 
         pRet = IsPoolUserFmt( nId )
-               ? ( (SwDoc*) pDoc )->FindCharFmtByName( rStr )
-               : ( (SwDoc*) pDoc )->getIDocumentStylePoolAccess().GetCharFmtFromPool( nId );
+               ? pDoc->FindCharFmtByName( rStr )
+               : pDoc->getIDocumentStylePoolAccess().GetCharFmtFromPool( nId );
 
         if ( bResetMod )
         {
-            ( (SwDoc*) pDoc )->getIDocumentState().ResetModified();
-            ( (SwDoc*) pDoc )->SetOle2Link( aOle2Lnk );
+            pDoc->getIDocumentState().ResetModified();
+            pDoc->SetOle2Link( aOle2Lnk );
         }
     }
 
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index ba0e2ad..9c8ea97 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1615,7 +1615,7 @@ bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
             pFrm->SetCompletePaint();
             return true;
         }
-        pFrm = (SwTxtFrm*)(pFrm->GetFollow());
+        pFrm = pFrm->GetFollow();
         if( pFrm )
         {
             rHyphInf.nEnd = rHyphInf.nEnd - (pFrm->GetOfst() - rHyphInf.nStart);
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 51999e7..e03897b 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -762,7 +762,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
             if( pInsNd->IsTableNode() )
             {
                 pInsNd = pDoc->GetNodes().MakeTxtNode( aIdx,
-                        (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
+                        pDoc->GetDfltTxtFmtColl() );
                 --aIdx;
                 aPos.nNode = aIdx;
                 aPos.nContent.Assign( pInsNd->GetCntntNode(), nSttCntnt );
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 8f22cc7..fc68292 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -60,7 +60,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
     SwDoc *const pDoc = & rContext.GetDoc();
 
     // add again into array
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
     rFlyFmts.push_back( pFrmFmt );
 
     // OD 26.06.2003 #108784# - insert 'master' drawing object into drawing page
@@ -219,7 +219,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
     pFrmFmt->ResetFmtAttr( RES_ANCHOR );        // delete anchor
 
     // delete from array
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
     rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFrmFmt ));
 }
 
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 3be72dd..ecbfd4f 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -226,7 +226,7 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
 
     // remove from array
     SwDoc* pDoc = pFmt->GetDoc();
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
     rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt ));
 
     for( sal_uInt16 n = 1; n < nSize; ++n )
@@ -258,7 +258,7 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
 
     // remove from array
     SwDoc* pDoc = pObjArr->pFmt->GetDoc();
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
 
     for( sal_uInt16 n = 1; n < nSize; ++n )
     {
@@ -309,7 +309,7 @@ void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt, SdrObject* pO
     ::lcl_SendRemoveToUno( *pFmt );
 
     // remove from array
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pFmt->GetDoc()->GetSpzFrmFmts();
     rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt ));
 }
 
@@ -341,7 +341,7 @@ SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj )
     ::lcl_SendRemoveToUno( *pFmt );
 
     // remove from array
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pFmt->GetDoc()->GetSpzFrmFmts();
     rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt ));
 }
 
@@ -364,7 +364,7 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
     bDelFmt = true;
 
     SwDoc *const pDoc = & rContext.GetDoc();
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
 
     // remove from array
     for( sal_uInt16 n = 1; n < nSize; ++n )
@@ -416,7 +416,7 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
 
     // remove from array
     SwDoc* pDoc = pFmt->GetDoc();
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
     rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt ));
 
     for( sal_uInt16 n = 1; n < nSize; ++n )
@@ -573,7 +573,7 @@ void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt,
 
     // remove from array
     SwDoc* pDoc = pFmt->GetDoc();
-    SwFrmFmts& rFlyFmts = *(SwFrmFmts*)pDoc->GetSpzFrmFmts();
+    SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts();
     rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt ));
 
     pMarkLst->InsertEntry( rMark );
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 0251924..016ad41 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -355,7 +355,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns )
     : SwUndo( UNDO_COMPAREDOC ), SwUndRng( rRg ), pRedlData( 0 ),
     pUnDel( 0 ), pUnDel2( 0 ), pRedlSaveData( 0 ), bInsert( bIns )
 {
-    SwDoc* pDoc = (SwDoc*)rRg.GetDoc();
+    SwDoc* pDoc = rRg.GetDoc();
     if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
     {
         RedlineType_t eTyp = bInsert ? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_DELETE;
@@ -370,7 +370,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwRangeRedline& rRedl )
     // for MergeDoc the corresponding inverse is needed
     bInsert( nsRedlineType_t::REDLINE_DELETE == rRedl.GetType() )
 {
-    SwDoc* pDoc = (SwDoc*)rRedl.GetDoc();
+    SwDoc* pDoc = rRedl.GetDoc();
     if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
     {
         pRedlData = new SwRedlineData( rRedl.GetRedlineData() );
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 4fbf9f4..c78d02a 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -76,7 +76,7 @@ SwUndoInsSection::SwUndoInsSection(
     , m_bSplitAtEnd(false)
     , m_bUpdateFtn(false)
 {
-    SwDoc& rDoc = *(SwDoc*)rPam.GetDoc();
+    SwDoc& rDoc = *rPam.GetDoc();
     if( rDoc.getIDocumentRedlineAccess().IsRedlineOn() )
     {
         m_pRedlData.reset(new SwRedlineData( nsRedlineType_t::REDLINE_INSERT,
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 160b169..abbd5bd 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -306,7 +306,7 @@ void SwUndoInsTbl::RedoImpl(::sw::UndoRedoContext & rContext)
                                             nAdjust,
                                             pAutoFmt, pColWidth );
     ((SwFrmFmt*)pTbl->GetFrmFmt())->SetName( sTblNm );
-    SwTableNode* pTblNode = (SwTableNode*)rDoc.GetNodes()[nSttNode]->GetTableNode();
+    SwTableNode* pTblNode = rDoc.GetNodes()[nSttNode]->GetTableNode();
 
     if( pDDEFldType )
     {
@@ -2439,7 +2439,7 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext)
         SwTableBox& rBox = *pTblNd->GetTable().GetTblBox( nSttPos );
 
         SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 );
-        rDoc.GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)rDoc.GetDfltTxtFmtColl() );
+        rDoc.GetNodes().MakeTxtNode( aInsIdx, rDoc.GetDfltTxtFmtColl() );
 
         // b62341295: Redline for copying tables
         const SwNode *pEndNode = rBox.GetSttNd()->EndOfSectionNode();
@@ -2592,7 +2592,7 @@ void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
         SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 );
 
         // b62341295: Redline for copying tables - Start.
-        rDoc.GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)rDoc.GetDfltTxtFmtColl() );
+        rDoc.GetNodes().MakeTxtNode( aInsIdx, rDoc.GetDfltTxtFmtColl() );
         SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode());
         SwUndo* pUndo = IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ? 0 : new SwUndoDelete( aPam, true );
         if( pEntry->pUndo )
@@ -2667,7 +2667,7 @@ void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, bool bDelCntnt )
     if( bDelCntnt )
     {
         SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 );
-        pDoc->GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
+        pDoc->GetNodes().MakeTxtNode( aInsIdx, pDoc->GetDfltTxtFmtColl() );
         SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode() );
 
         if( !pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 126e2eb..01457c7 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -38,7 +38,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
     bSttWasTxtNd( true ), nNdDiff( 0 ), nSetPos( 0 )
 {
     pHistory = new SwHistory;
-    SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
+    SwDoc* pDoc = rPam.GetDoc();
 
     SwTxtNode* pTxtNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
     if( pTxtNd )
@@ -103,7 +103,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys,
     if( bScanFlys && !nSttCntnt )
     {
         // than collect all new Flys
-        SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
+        SwDoc* pDoc = rPam.GetDoc();
         const size_t nArrLen = pDoc->GetSpzFrmFmts()->size();
         for( size_t n = 0; n < nArrLen; ++n )
         {
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index b43ef01..e3c479f 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -93,7 +93,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName,
             SwFmtCharFmt *pCharFmt = 0;
             if(pStyle)
             {
-                rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pStyle ) );
+                rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) );
                 if (RES_PARATR_DROP == pMap->nWID)
                 {
                     pDrop = static_cast<SwFmtDrop*>(rItem.Clone());   // because rItem is const...
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index f4056a0..23760ad 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1343,7 +1343,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
                 sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
     }
 
-    SwDoc* pDoc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0;
+    SwDoc* pDoc = pRange ? pRange->GetDoc() : pCursor ? pCursor->GetDoc() : 0;
     // if a FieldMaster was attached, then the document is already fixed!
     // NOTE: sw.SwXAutoTextEntry unoapi test depends on m_pDoc = 0 being valid
     if (!pDoc || (m_pImpl->m_pDoc && m_pImpl->m_pDoc != pDoc))
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index db5f34c..2876c89 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2690,7 +2690,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
                 sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
     }
 
-    SwDoc* pDoc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0;
+    SwDoc* pDoc = pRange ? pRange->GetDoc() : pCursor ? pCursor->GetDoc() : 0;
     if(pDoc)
     {
         SwUnoInternalPaM aIntPam(*pDoc);
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 18cb6a5..e2cc2e3 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -291,7 +291,7 @@ void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem
     case RES_REMOVE_UNO_OBJECT:
     case RES_OBJECTDYING:
         if( (void*)pClient->GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
-            ((SwModify*)pClient->GetRegisteredIn())->Remove(pClient);
+            pClient->GetRegisteredIn()->Remove(pClient);
         break;
 
     case RES_FMT_CHG:
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 7218bae..7c80f56 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -3065,7 +3065,7 @@ void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
 {
     if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT &&
         (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
-            ((SwModify*)GetRegisteredIn())->Remove(this);
+            GetRegisteredIn()->Remove(this);
     else
         ClientModify(this, pOld, pNew);
     if(!GetRegisteredIn())
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 9d80861..c9bf715 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -213,7 +213,7 @@ void SwViewShellImp::NotifySizeChg( const Size &rNewSz )
         if( !pObj->ISA(SwVirtFlyDrawObj) )
         {
             // Objects not anchored to the frame, do not need to be adjusted
-            const SwContact *pCont = (SwContact*)GetUserCall(pObj);
+            const SwContact *pCont = GetUserCall(pObj);
             // this function might be called by the InsertDocument, when
             // a PageDesc-Attribute is set on a node. Then the SdrObject
             // must not have an UserCall.
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index c98211ef..96d2422 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -722,7 +722,7 @@ SfxPoolItem* SwFltControlStack::GetFmtStackAttr(sal_uInt16 nWhich, sal_uInt16 *
         {
             if (pPos)
                 *pPos = nSize;
-            return (SfxPoolItem*)rEntry.pAttr;      // Ok, so stop
+            return rEntry.pAttr;      // Ok, so stop
         }
     }
     return 0;
@@ -739,7 +739,7 @@ const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, s
         SwFltStackEntry &rEntry = maEntries[--nSize];
         if (rEntry.bOpen && rEntry.pAttr->Which() == nWhich && rEntry.m_aMkPos == aFltPos)
         {
-            return (SfxPoolItem*)rEntry.pAttr;
+            return rEntry.pAttr;
         }
     }
     return 0;
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index f85ae7f..5eb0314 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -537,7 +537,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
                                       false );
         rHWrt.aTxtCollInfos.insert( pFmtInfo );
         if( rHWrt.aScriptParaStyles.count( rFmt.GetName() ) )
-            ((SwHTMLFmtInfo *)pFmtInfo)->bScriptDependent = true;
+            pFmtInfo->bScriptDependent = true;
     }
 
     // Jetzt wird festgelegt, was aufgrund des Tokens so moeglich ist
@@ -1627,7 +1627,7 @@ const SwHTMLFmtInfo *HTMLEndPosLst::GetFmtInfo( const SwFmt& rFmt,
                                       bOutStyles );
         rFmtInfos.insert( pFmtInfo );
         if ( rScriptTxtStyles.count( rFmt.GetName() ) )
-            ((SwHTMLFmtInfo *)pFmtInfo)->bScriptDependent = true;
+            pFmtInfo->bScriptDependent = true;
     }
 
     return pFmtInfo;
@@ -1905,7 +1905,7 @@ void HTMLEndPosLst::Insert( const SfxItemSet& rItemSet,
 void HTMLEndPosLst::Insert( const SwDrawFrmFmt& rFmt, sal_Int32 nPos,
                             SwHTMLFmtInfos& rFmtInfos )
 {
-    const SdrObject* pTextObj = (const SdrObject*) SwHTMLWriter::GetMarqueeTextObj( rFmt );
+    const SdrObject* pTextObj = SwHTMLWriter::GetMarqueeTextObj( rFmt );
 
     if( pTextObj )
     {
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 050fd7f..cc1ac7f 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2536,8 +2536,8 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail,
     }
     else
     {
-        pLineFmt = (SwTableLineFmt*)pTopTable->pLineFmt;
-        pBoxFmt = (SwTableBoxFmt*)pTopTable->pBoxFmt;
+        pLineFmt = pTopTable->pLineFmt;
+        pBoxFmt = pTopTable->pBoxFmt;
     }
 
     // ggf. muessen fuer Tabellen in Tabellen "Filler"-Zellen eingefuegt
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index bc14531..b1b9c36 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -618,7 +618,7 @@ void WW8Export::OutputOlst( const SwNumRule& rRule )
     WW8_OLST aOlst;
     memset( &aOlst, 0, sizeof(aOlst) );
     sal_uInt8* pC = aOlst.rgch;
-    sal_uInt8* pChars = (sal_uInt8*)pC;
+    sal_uInt8* pChars = pC;
     sal_uInt16 nCharLen = 64;
 
     for (sal_uInt16 j = 0; j < WW8ListManager::nMaxLevel; j++ ) // 9 variable ANLVs
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 129beb3..09184f0 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1128,7 +1128,7 @@ bool WW8_WrFkp::Combine()
         memcpy( pFkp + ( nIMax + 1 ) * 4, pOfs, nIMax * nItemSize );
     delete[] pOfs;
     pOfs = 0;
-    ((sal_uInt8*)pFkp)[511] = nIMax;
+    pFkp[511] = nIMax;
     bCombined = true;
 
 #if defined OSL_BIGENDIAN           // only the FCs will be rotated here
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 1192fd4..a01a99e 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -3323,7 +3323,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
     SwPaM aRegion(*m_pPaM, m_pPaM);
 
     OSL_ENSURE(SwDoc::GetCurTOX(*aRegion.GetPoint()), "Misunderstood how toc works");
-    if (SwTOXBase* pBase2 = (SwTOXBase*)SwDoc::GetCurTOX(*aRegion.GetPoint()))
+    if (SwTOXBase* pBase2 = SwDoc::GetCurTOX(*aRegion.GetPoint()))
     {
         pBase2->SetMSTOCExpression(rStr);
 
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index f60ab88..d479d58 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -311,7 +311,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
 IMPL_LINK_NOARG(SwCompatibilityOptPage, SelectHdl)
 {
     const sal_Int32 nPos = m_pFormattingLB->GetSelectEntryPos();
-    sal_uLong nOptions = reinterpret_cast<sal_uLong>((void*)m_pFormattingLB->GetEntryData( nPos ));
+    sal_uLong nOptions = reinterpret_cast<sal_uLong>(m_pFormattingLB->GetEntryData( nPos ));
     SetCurrentOptions( nOptions );
 
     return 0;
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index f96ccb5..30f5dd4 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1458,7 +1458,7 @@ bool  SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
                 aBreak.SetValue( SVX_BREAK_NONE );
         }
 
-        if ( !pBreak || !( *(const SvxFmtBreakItem*)pBreak == aBreak ) )
+        if ( !pBreak || !( *pBreak == aBreak ) )
         {
             bModified |= 0 != rSet->Put( aBreak );
         }
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index cddd9ae..9b0f6cf 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -161,7 +161,7 @@ void SwDocShell::ToggleBrowserMode(bool bSet, SwView* _pView )
 {
     GetDoc()->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, bSet );
     UpdateFontList();
-    SwView* pTempView = _pView ? _pView : (SwView*)GetView();
+    SwView* pTempView = _pView ? _pView : GetView();
     if( pTempView )
     {
         pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 2f5802c..d3ac73f 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -128,7 +128,7 @@ static SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc,
                                                 RES_POOLCOLL_TEXT_BEGIN ] )
         {
             // Standard-Character template
-            pFmt = (SwCharFmt*)rDoc.GetDfltCharFmt();
+            pFmt = rDoc.GetDfltCharFmt();
         }
 
         if( !pFmt && bCreate )
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index caa9df6..2d893cb 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -261,7 +261,7 @@ void SwDBTreeList::ShowColumns(bool bShowCol)
 
         while (pEntry)
         {
-            pEntry = (SvTreeListEntry*)GetRootLevelParent( pEntry );
+            pEntry = GetRootLevelParent( pEntry );
             Collapse(pEntry);       // zuklappen
 
             SvTreeListEntry* pChild;
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 42eb6f0..be9179a 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -437,7 +437,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
             if(1 == aFoundArr.size())
             {
                 TextBlockInfo_Impl* pData = &aFoundArr.front();
-                pGlossary = (SwTextBlocks *)pGlossaries->GetGroupDoc(pData->sGroupName);
+                pGlossary = pGlossaries->GetGroupDoc(pData->sGroupName);
                 nFound = pGlossary->GetIndex( aShortName );
             }
             else
@@ -460,7 +460,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
                 if(LISTBOX_ENTRY_NOTFOUND != nRet)
                 {
                     TextBlockInfo_Impl* pData = &aFoundArr[nRet];
-                    pGlossary = (SwTextBlocks *)pGlossaries->GetGroupDoc(pData->sGroupName);
+                    pGlossary = pGlossaries->GetGroupDoc(pData->sGroupName);
                     nFound = pGlossary->GetIndex( aShortName );
                 }
                 else
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 663395e..ed45693 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1340,7 +1340,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
         rSh.ToggleHeaderFooterEdit();
     }
 
-    SfxObjectShell *pObjSh = (SfxObjectShell*)m_rView.GetViewFrame()->GetObjectShell();
+    SfxObjectShell *pObjSh = m_rView.GetViewFrame()->GetObjectShell();
     if ( m_bLockInput || (pObjSh && pObjSh->GetProgress()) )
         // When the progress bar is active or a progress is
         // running on a document, no order is being taken
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index a486f9d..e78ef35 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -534,7 +534,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                             const SwFmtChain &rChain = pCurrFlyFmt->GetChain();
                             //needs cast - no non-const method available
                             SwFlyFrmFmt* pFlyFmt =
-                                (SwFlyFrmFmt*)rChain.GetPrev();
+                                rChain.GetPrev();
                             if(pFlyFmt)
                             {
                                 if (pFlyFmt->GetName() != sPrevName)
@@ -568,7 +568,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                             const SwFmtChain &rChain = pCurrFlyFmt->GetChain();
                             //needs cast - no non-const method available
                             SwFlyFrmFmt* pFlyFmt =
-                                (SwFlyFrmFmt*)rChain.GetNext();
+                                rChain.GetNext();
                             if(pFlyFmt)
                             {
                                 if (pFlyFmt->GetName() != sNextName)
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 150325f..8351914 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -855,7 +855,7 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
 IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn )
 {
     SwWrtShell* pSh = GetShellPtr();
-    AbstractSvxPostItDialog *pDlg = (AbstractSvxPostItDialog*)pBtn;
+    AbstractSvxPostItDialog *pDlg = pBtn;
 
     // Insert or change a comment.
     pSh->SetRedlineComment(pDlg->GetNote());
@@ -905,7 +905,7 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn )
 IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn )
 {
     SwWrtShell* pSh = GetShellPtr();
-    AbstractSvxPostItDialog *pDlg = (AbstractSvxPostItDialog*)pBtn;
+    AbstractSvxPostItDialog *pDlg = pBtn;
 
     // Insert or change a comment.
     pSh->SetRedlineComment(pDlg->GetNote());
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index c86e8d1..01a4cb4 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3913,7 +3913,7 @@ void SwXLinkNameAccessWrapper::removeVetoableChangeListener(
 Reference< XNameAccess >  SwXLinkNameAccessWrapper::getLinks()
                                     throw( RuntimeException, std::exception )
 {
-    return (SwXLinkNameAccessWrapper*)this;
+    return this;
 }
 
 OUString SwXLinkNameAccessWrapper::getImplementationName() throw( RuntimeException, std::exception )
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index bf2b8fe..f60f7fe 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -197,7 +197,7 @@ void SwGlobalTree::dispose()
 sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
 {
     sal_Int8 nRet = DND_ACTION_NONE;
-    SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible();
+    SvTreeListEntry* pLast = LastVisible();
     if(pEmphasisEntry)
     {
         ImplShowTargetEmphasis( Prev(pEmphasisEntry), false );
@@ -278,7 +278,7 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt )
 
     //initiate scrolling
     GetDropTarget( rEvt.maPosPixel );
-    SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible();
+    SvTreeListEntry* pLast = LastVisible();
     if( rEvt.mbLeaving )
     {
         if( pEmphasisEntry )
@@ -1277,7 +1277,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
         bool bMove = false;
         if ( !_pContent )
         {
-            SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible();
+            SvTreeListEntry* pLast = LastVisible();
             _pContent = static_cast<SwGlblDocContent*>(pLast->GetUserData());
             bMove = true;
         }
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 9a134a4e..d7b30ac 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -420,7 +420,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
                     pColl = rDoc.getIDocumentStylePoolAccess().GetTxtCollFromPool( nId );
                 else
                     pColl = rDoc.MakeTxtFmtColl( rColl,
-                                (SwTxtFmtColl*)rDoc.GetDfltTxtFmtColl() );
+                                rDoc.GetDfltTxtFmtColl() );
             }
             if( pColl )
                 pColl->SetFmtAttr( SwRegisterItem ( true ));
commit 9672e6c81e1ded79ff964d0a0d667e4e172c4475
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon May 11 12:51:10 2015 +0200

    loplugin:cstylecast: nop between pointer types of exactly same spelling
    
    Change-Id: I76a990da8aba9b62b3925d9632150930656e510f

diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 85164cb..e0b8fc9 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -80,7 +80,7 @@ SvxGraphCtrlAccessibleContext::SvxGraphCtrlAccessibleContext(
     {
         mpModel = mpControl->GetSdrModel();
         if (mpModel != NULL)
-            mpPage = (SdrPage*)mpModel->GetPage( 0 );
+            mpPage = mpModel->GetPage( 0 );
         mpView = mpControl->GetSdrView();
 
         if( mpModel == NULL || mpPage == NULL || mpView == NULL )
@@ -665,7 +665,7 @@ void SvxGraphCtrlAccessibleContext::setModelAndView (
 
     mpModel = pModel;
     if (mpModel != NULL)
-        mpPage = (SdrPage*)mpModel->GetPage( 0 );
+        mpPage = mpModel->GetPage( 0 );
     mpView = pView;
 
     if (mpModel == NULL || mpPage == NULL || mpView == NULL)
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 0360ea2..48f763a 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -401,7 +401,7 @@ SdrGrafObj* CompressGraphicsDialog::GetCompressedSdrGrafObj()
 {
     if ( m_dResolution > 0.0  )
     {
-        SdrGrafObj* pNewObject = (SdrGrafObj*) m_pGraphicObj->Clone();
+        SdrGrafObj* pNewObject = m_pGraphicObj->Clone();
 
         if ( m_pReduceResolutionCB->IsChecked() )
         {
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index 4777283..e7b8c41 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -166,7 +166,7 @@ void SvxXConnectionPreview::Construct()
             {
                 bFound = true;
                 const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj);
-                pEdgeObj = (SdrEdgeObj*) pTmpEdgeObj->Clone();
+                pEdgeObj = pTmpEdgeObj->Clone();
 
                 SdrObjConnection& rConn1 = (SdrObjConnection&)pEdgeObj->GetConnection( true );
                 SdrObjConnection& rConn2 = (SdrObjConnection&)pEdgeObj->GetConnection( false );
diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx
index 49e47aa..d883417 100644
--- a/svx/source/dialog/contwnd.cxx
+++ b/svx/source/dialog/contwnd.cxx
@@ -45,7 +45,7 @@ ContourWindow::ContourWindow( vcl::Window* pParent, WinBits nBits ) :
 
 void ContourWindow::SetPolyPolygon( const tools::PolyPolygon& rPolyPoly )
 {
-    SdrPage*        pPage = (SdrPage*) pModel->GetPage( 0 );
+    SdrPage*        pPage = pModel->GetPage( 0 );
     const sal_uInt16    nPolyCount = rPolyPoly.Count();
 
     // First delete all drawing objects
@@ -87,7 +87,7 @@ const tools::PolyPolygon& ContourWindow::GetPolyPolygon()
 {
     if ( pModel->IsChanged() )
     {
-        SdrPage* pPage = (SdrPage*) pModel->GetPage( 0 );
+        SdrPage* pPage = pModel->GetPage( 0 );
 
         aPolyPoly = tools::PolyPolygon();
 
@@ -126,7 +126,7 @@ void ContourWindow::SdrObjCreated( const SdrObject&  )
 
 bool ContourWindow::IsContourChanged() const
 {
-    SdrPage*    pPage = (SdrPage*) pModel->GetPage( 0 );
+    SdrPage*    pPage = pModel->GetPage( 0 );
     bool        bRet = false;
 
     if ( pPage && pPage->GetObjCount() )
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 1b7fed9..3ae8137 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -153,7 +153,7 @@ const ImageMap& IMapWindow::GetImageMap()
 {
     if ( pModel->IsChanged() )
     {
-        SdrPage* pPage = (SdrPage*) pModel->GetPage( 0 );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list