diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-05-14 22:58:27 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-05-14 23:00:33 +0200 |
commit | 2c4fbc8785aff024e22f657c735d5cdafe5b9a70 (patch) | |
tree | a23eb723fca871075d60d0faceb6453b3635c951 | |
parent | e062c50b19aa5e0c43bab9a52b94247766083124 (diff) |
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.
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/index/toxmgr.cxx | 9 |
3 files changed, 16 insertions, 10 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index e613e8b9a6e0..168eb28ec4fe 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 2981723555d5..c50e688e8600 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 659345668090..038345387bdc 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()); |