[Libreoffice-commits] .: sw/source

Michael Stahl mst at kemper.freedesktop.org
Mon May 14 14:01:45 PDT 2012


 sw/source/core/unocore/unofield.cxx |    9 ++++++---
 sw/source/ui/fldui/fldmgr.cxx       |    8 ++++----
 sw/source/ui/index/toxmgr.cxx       |    9 ++++++---
 3 files changed, 16 insertions(+), 10 deletions(-)

New commits:
commit 2c4fbc8785aff024e22f657c735d5cdafe5b9a70
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon May 14 22:58:27 2012 +0200

    sw: try to fix Mac tinderbox SwAuthorityFieldType:
    
    Apparently Apple GCC 4.0.1 wants to invoke a copy constructor for
    SwAuthorityFieldType when it is given as parameter to InsertFldType,
    which seems entirely spurious; let's try if this works around the issue.

diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index e613e8b..168eb28 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1680,15 +1680,18 @@ void SwXTextField::attachToRange(
             }
             break;
             case SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY:
-                pFld = new SwAuthorityField( (SwAuthorityFieldType*)
-                        pDoc->InsertFldType(SwAuthorityFieldType(pDoc)),
+            {
+                SwAuthorityFieldType const type(pDoc);
+                pFld = new SwAuthorityField(static_cast<SwAuthorityFieldType*>(
+                            pDoc->InsertFldType(type)),
                         aEmptyStr );
                 if(m_pProps->aPropSeq.getLength())
                 {
                     uno::Any aVal; aVal <<= m_pProps->aPropSeq;
                     pFld->PutValue( aVal, FIELD_PROP_PROP_SEQ );
                 }
-                break;
+            }
+            break;
             case SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS:
                 // create field
                 pFld = new SwCombinedCharField( (SwCombinedCharFieldType*)
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 2981723..c50e688 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -890,11 +890,11 @@ sal_Bool SwFldMgr::InsertFld(  const SwInsertFld_Data& rData )
         {
             SwAuthorityFieldType* pType =
                 (SwAuthorityFieldType*)pCurShell->GetFldType(0, RES_AUTHORITY);
-            if(!pType)
+            if (!pType)
             {
-                pType =
-                    (SwAuthorityFieldType*)pCurShell->InsertFldType(
-                                    SwAuthorityFieldType(pCurShell->GetDoc()));
+                SwAuthorityFieldType const type(pCurShell->GetDoc());
+                pType = static_cast<SwAuthorityFieldType*>(
+                            pCurShell->InsertFldType(type));
             }
             pFld = new SwAuthorityField(pType, rData.sPar1);
         }
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index 6593456..0383453 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -368,9 +368,12 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
             {
                 SwAuthorityFieldType* pFType = (SwAuthorityFieldType*)
                                                 pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
-                if(!pFType)
-                    pFType = (SwAuthorityFieldType*)pSh->InsertFldType(
-                                    SwAuthorityFieldType(pSh->GetDoc()));
+                if (!pFType)
+                {
+                    SwAuthorityFieldType const type(pSh->GetDoc());
+                    pFType = static_cast<SwAuthorityFieldType*>(
+                                pSh->InsertFldType(type));
+                }
                 pFType->SetPreSuffix(rDesc.GetAuthBrackets().GetChar(0),
                     rDesc.GetAuthBrackets().GetChar(1));
                 pFType->SetSequence(rDesc.IsAuthSequence());


More information about the Libreoffice-commits mailing list