summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-07-25 09:31:59 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-25 15:02:32 -0400
commitd1cc007108442056f50d3a6d1212b2b4cfdc4c14 (patch)
tree09d2b40a466930120c926bcc0f8474f061a877f4
parent452e452d3e9dcc259bc3e58ed6509284004f04fe (diff)
sal_Bool to bool, String to OUString, in SfxMedium.
Change-Id: I1bc8486b3fbbcdd45407eeda52a7e239646cd204
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx5
-rw-r--r--sc/source/ui/docshell/tablink.cxx2
-rw-r--r--sd/source/core/sdpage2.cxx2
-rw-r--r--sd/source/ui/dlg/navigatr.cxx2
-rw-r--r--sd/source/ui/view/sdview2.cxx6
-rw-r--r--sfx2/inc/sfx2/docfile.hxx20
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/doc/docfile.cxx38
-rw-r--r--sfx2/source/doc/objserv.cxx10
-rw-r--r--sfx2/source/doc/objstor.cxx12
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx7
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/ui/uiview/srcview.cxx8
14 files changed, 63 insertions, 55 deletions
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index e1e18c124909..02811e8a6638 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2077,11 +2077,10 @@ const ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileI
while (pShell)
{
SfxMedium* pMedium = pShell->GetMedium();
- if (pMedium && pMedium->GetName().Len())
+ if (pMedium && !pMedium->GetName().isEmpty())
{
- OUString aName = pMedium->GetName();
// TODO: We should make the case sensitivity platform dependent.
- if (pFileName->equalsIgnoreAsciiCase(aName))
+ if (pFileName->equalsIgnoreAsciiCase(pMedium->GetName()))
{
// Found !
pSrcDoc = pShell->GetDocument();
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 888df91567e3..29d1c939d772 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -472,7 +472,7 @@ bool ScDocumentLoader::GetFilterName( const String& rFileName,
if ( pDocSh->HasName() )
{
SfxMedium* pMed = pDocSh->GetMedium();
- if ( rFileName == pMed->GetName() )
+ if ( pMed->GetName().equals(rFileName) )
{
rFilter = pMed->GetFilter()->GetFilterName();
rOptions = GetOptions(*pMed);
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 73b9441a810f..d8ec4ec7a52d 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -340,7 +340,7 @@ void SdPage::ConnectLink()
**********************************************************************/
::sd::DrawDocShell* pDocSh = ((SdDrawDocument*) pModel)->GetDocSh();
- if (!pDocSh || pDocSh->GetMedium()->GetOrigURL() != maFileName)
+ if (!pDocSh || !pDocSh->GetMedium()->GetOrigURL().equals(maFileName))
{
// Keine Links auf Dokument-eigene Seiten!
mpPageLink = new SdPageLink(this, maFileName, maBookmarkName);
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index fd235bb5fb9f..cda0fbd31a7c 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -700,7 +700,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName )
aInfo.mpDocShell = pDocShell;
SfxMedium *pMedium = pDocShell->GetMedium();
- aStr = pMedium ? pMedium->GetName() : String();
+ aStr = pMedium ? pMedium->GetName() : OUString();
if( aStr.Len() )
aInfo.SetName();
else
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 5811fa18de07..aa119e048fdd 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -542,7 +542,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
else if( pSourceView )
{
if( !( nDropAction & DND_ACTION_LINK ) ||
- pSourceView->GetDocSh()->GetMedium()->GetName().Len() )
+ !pSourceView->GetDocSh()->GetMedium()->GetName().isEmpty() )
{
nRet = nDropAction;
}
@@ -787,9 +787,9 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
sal_Int32 nIndex = aBookmark.indexOf( (sal_Unicode)'#' );
if( nIndex != -1 )
{
- const String aDocName( aBookmark.copy( 0, nIndex ) );
+ const OUString aDocName( aBookmark.copy( 0, nIndex ) );
- if( mpDocSh->GetMedium()->GetName() == aDocName || mpDocSh->GetName() == aDocName )
+ if (mpDocSh->GetMedium()->GetName() == aDocName || aDocName.equals(mpDocSh->GetName()))
{
// internal jump, only use the part after and including '#'
eClickAction = presentation::ClickAction_BOOKMARK;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 30c2f64f9bbd..19faae1b4419 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -69,9 +69,10 @@ class DateTime;
class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
{
sal_uInt32 eError;
- sal_Bool bRoot:1,
- bSetFilter:1,
- bTriedStorage;
+ bool bRoot:1;
+ bool bSetFilter:1;
+ bool bTriedStorage:1;
+ bool bRemote:1;
StreamMode nStorOpenMode;
INetURLObject* pURLObj;
rtl::OUString aName;
@@ -81,9 +82,8 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
const SfxFilter* pFilter;
SfxItemSet* pSet;
SfxMedium_Impl* pImp;
- String aLogicName;
- String aLongName;
- sal_Bool bRemote;
+ rtl::OUString aLogicName;
+ rtl::OUString aLongName;
com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
m_xInputStreamToLoadFrom;
@@ -145,14 +145,14 @@ public:
void SetFilter(const SfxFilter *pFlt, sal_Bool bResetOrig = sal_False);
const SfxFilter * GetFilter() const { return pFilter; }
const SfxFilter * GetOrigFilter( sal_Bool bNotCurrent = sal_False ) const;
- const String& GetOrigURL() const;
+ const rtl::OUString& GetOrigURL() const;
SfxItemSet * GetItemSet() const;
void Close();
void CloseAndRelease();
void ReOpen();
void CompleteReOpen();
- const String& GetName() const {return aLogicName;}
+ const rtl::OUString& GetName() const;
const INetURLObject& GetURLObject() const;
void CheckFileDate( const ::com::sun::star::util::DateTime& aInitDate );
@@ -260,9 +260,9 @@ public:
SAL_DLLPRIVATE void SetUpdatePickList(sal_Bool);
SAL_DLLPRIVATE sal_Bool IsUpdatePickList() const;
- SAL_DLLPRIVATE void SetLongName(const String &rName)
+ SAL_DLLPRIVATE void SetLongName(const rtl::OUString &rName)
{ aLongName = rName; }
- SAL_DLLPRIVATE const String & GetLongName() const { return aLongName; }
+ SAL_DLLPRIVATE const rtl::OUString & GetLongName() const { return aLongName; }
SAL_DLLPRIVATE ErrCode CheckOpenMode_Impl( sal_Bool bSilent, sal_Bool bAllowRO = sal_True );
SAL_DLLPRIVATE sal_Bool IsPreview_Impl();
SAL_DLLPRIVATE void ClearBackup_Impl();
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 2b9e2ba087a8..a8cf492f7e5f 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -935,7 +935,7 @@ void SfxDocumentPage::ImplUpdateSignatures()
if ( pDoc )
{
SfxMedium* pMedium = pDoc->GetMedium();
- if ( pMedium && pMedium->GetName().Len() && pMedium->GetStorage().is() )
+ if ( pMedium && !pMedium->GetName().isEmpty() && pMedium->GetStorage().is() )
{
Reference< security::XDocumentDigitalSignatures > xD(
comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 915e601813aa..483f356200ff 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -266,7 +266,7 @@ public:
long nFileVersion;
const SfxFilter* pOrigFilter;
- String aOrigURL;
+ rtl::OUString aOrigURL;
String aPreRedirectionURL;
String aReferer;
DateTime aExpireTime;
@@ -464,7 +464,7 @@ sal_Bool SfxMedium::DocNeedsFileDateCheck()
//------------------------------------------------------------------
util::DateTime SfxMedium::GetInitFileDate( sal_Bool bIgnoreOldValue )
{
- if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && aLogicName.Len() )
+ if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && !aLogicName.isEmpty() )
{
try
{
@@ -510,7 +510,7 @@ Reference < XContent > SfxMedium::GetContent() const
rtl::OUString aURL;
if ( !aName.isEmpty() )
::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL );
- else if ( aLogicName.Len() )
+ else if ( !aLogicName.isEmpty() )
aURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
if (!aURL.isEmpty() )
::ucbhelper::Content::create( aURL, xEnv, pImp->aContent );
@@ -683,7 +683,7 @@ sal_Bool SfxMedium::CloseOutStream_Impl()
//------------------------------------------------------------------
const rtl::OUString& SfxMedium::GetPhysicalName() const
{
- if ( aName.isEmpty() && aLogicName.Len() )
+ if ( aName.isEmpty() && !aLogicName.isEmpty() )
(( SfxMedium*)this)->CreateFileStream();
// return the name then
@@ -787,7 +787,7 @@ void SfxMedium::StorageBackup_Impl()
::ucbhelper::Content aOriginalContent;
Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv;
- sal_Bool bBasedOnOriginalFile = ( !pImp->pTempFile && !( aLogicName.Len() && pImp->m_bSalvageMode )
+ bool bBasedOnOriginalFile = ( !pImp->pTempFile && !( !aLogicName.isEmpty() && pImp->m_bSalvageMode )
&& !GetURLObject().GetMainURL( INetURLObject::NO_DECODE ).isEmpty()
&& ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
&& ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) );
@@ -818,7 +818,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetOutputStorage()
// if the medium was constructed with a Storage: use this one, not a temp. storage
// if a temporary storage already exists: use it
- if ( pImp->xStorage.is() && ( !aLogicName.Len() || pImp->pTempFile ) )
+ if ( pImp->xStorage.is() && ( aLogicName.isEmpty() || pImp->pTempFile ) )
return pImp->xStorage;
// if necessary close stream that was used for reading
@@ -1777,7 +1777,7 @@ void SfxMedium::Transfer_Impl()
rtl::OUString aNameURL;
if ( pImp->pTempFile )
aNameURL = pImp->pTempFile->GetURL();
- else if ( aLogicName.Len() && pImp->m_bSalvageMode )
+ else if ( !aLogicName.isEmpty() && pImp->m_bSalvageMode )
{
// makes sence only in case logic name is set
if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aNameURL ) )
@@ -1793,7 +1793,7 @@ void SfxMedium::Transfer_Impl()
// in case an output stream is provided from outside and the URL is correct
// commit to the stream
- if( aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL )
+ if (aLogicName.compareToAscii("private:stream", 14) == 0)
{
// TODO/LATER: support storing to SID_STREAM
SFX_ITEMSET_ARG( pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM, sal_False);
@@ -2429,7 +2429,7 @@ void SfxMedium::Init_Impl()
pSet->ClearItem( SID_DOC_SALVAGE );
}
- if( aLogicName.Len() )
+ if (!aLogicName.isEmpty())
{
INetURLObject aUrl( aLogicName );
INetProtocol eProt = aUrl.GetProtocol();
@@ -2468,13 +2468,13 @@ void SfxMedium::Init_Impl()
SFX_ITEMSET_ARG( pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM, sal_False);
if( pOutStreamItem
&& ( !( pOutStreamItem->GetValue() >>= rOutStream )
- || !aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL ) )
+ || (aLogicName.compareToAscii("private:stream", 14) == 0)) )
{
pSet->ClearItem( SID_OUTPUTSTREAM );
OSL_FAIL( "Unexpected Output stream parameter!\n" );
}
- if ( aLogicName.Len() )
+ if (!aLogicName.isEmpty())
{
// if the logic name is set it should be set in MediaDescriptor as well
SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
@@ -2733,7 +2733,7 @@ void SfxMedium::SetIsRemote_Impl()
case INET_PROT_VIM:
bRemote = sal_True; break;
default:
- bRemote = ( GetName().CompareToAscii( "private:msgid", 13 ) == COMPARE_EQUAL );
+ bRemote = GetName().compareToAscii("private:msgid", 13) == 0;
break;
}
@@ -2747,7 +2747,7 @@ void SfxMedium::SetIsRemote_Impl()
void SfxMedium::SetName( const String& aNameP, sal_Bool bSetOrigURL )
{
- if( !pImp->aOrigURL.Len() )
+ if (pImp->aOrigURL.isEmpty())
pImp->aOrigURL = aLogicName;
if( bSetOrigURL )
pImp->aOrigURL = aNameP;
@@ -2758,9 +2758,9 @@ void SfxMedium::SetName( const String& aNameP, sal_Bool bSetOrigURL )
}
//----------------------------------------------------------------
-const String& SfxMedium::GetOrigURL() const
+const OUString& SfxMedium::GetOrigURL() const
{
- return !pImp->aOrigURL.Len() ? (String &)aLogicName : pImp->aOrigURL;
+ return pImp->aOrigURL.isEmpty() ? aLogicName : pImp->aOrigURL;
}
//----------------------------------------------------------------
@@ -2974,7 +2974,11 @@ SfxMedium::~SfxMedium()
delete pImp;
}
-//----------------------------------------------------------------
+const OUString& SfxMedium::GetName() const
+{
+ return aLogicName;
+}
+
const INetURLObject& SfxMedium::GetURLObject() const
{
if( !pURLObj )
@@ -3086,7 +3090,7 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR
{
// if the medium has no name, then this medium should represent a new document and can have no version info
if ( ( !_bNoReload || !pImp->m_bVersionsAlreadyLoaded ) && !pImp->aVersions.getLength() &&
- ( !aName.isEmpty() || aLogicName.Len() ) && GetStorage().is() )
+ ( !aName.isEmpty() || !aLogicName.isEmpty() ) && GetStorage().is() )
{
uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 68bfd6b8ba44..3ae76e6faeda 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1238,7 +1238,7 @@ uno::Sequence< security::DocumentSignatureInformation > SfxObjectShell::ImplAnal
uno::Sequence< security::DocumentSignatureInformation > aResult;
uno::Reference< security::XDocumentDigitalSignatures > xLocSigner = xSigner;
- if ( GetMedium() && GetMedium()->GetName().Len() && IsOwnStorageFormat_Impl( *GetMedium()) && GetMedium()->GetStorage().is() )
+ if ( GetMedium() && !GetMedium()->GetName().isEmpty() && IsOwnStorageFormat_Impl( *GetMedium()) && GetMedium()->GetStorage().is() )
{
try
{
@@ -1301,7 +1301,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
// Check if it is stored in OASIS format...
if ( GetMedium()
&& GetMedium()->GetFilter()
- && GetMedium()->GetName().Len()
+ && !GetMedium()->GetName().isEmpty()
&& ( !GetMedium()->GetFilter()->IsOwnFormat()
|| !GetMedium()->HasStorage_Impl()
)
@@ -1334,7 +1334,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
bool bNoSig = false;
- if ( IsModified() || !GetMedium() || !GetMedium()->GetName().Len()
+ if ( IsModified() || !GetMedium() || GetMedium()->GetName().isEmpty()
|| (!aODFVersion.equals( ODFVER_012_TEXT ) && !bHasSign) )
{
// the document might need saving ( new, modified or in ODF1.1 format without signature )
@@ -1346,7 +1346,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
|| (!bHasSign && QueryBox( NULL, SfxResId( RID_XMLSEC_QUERY_SAVEBEFORESIGN ) ).Execute() == RET_YES) )
{
sal_uInt16 nId = SID_SAVEDOC;
- if ( !GetMedium() || !GetMedium()->GetName().Len() )
+ if ( !GetMedium() || GetMedium()->GetName().isEmpty() )
nId = SID_SAVEASDOC;
SfxRequest aSaveRequest( nId, 0, GetPool() );
//ToDo: Review. We needed to call SetModified, otherwise the document would not be saved.
@@ -1378,7 +1378,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
return;
}
- if ( IsModified() || !GetMedium() || !GetMedium()->GetName().Len() )
+ if ( IsModified() || !GetMedium() || GetMedium()->GetName().isEmpty() )
return;
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0a0b54580463..c0c33fbf800d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -795,7 +795,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pAsTempItem, SfxBoolItem, SID_TEMPLATE, sal_False);
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPreviewItem, SfxBoolItem, SID_PREVIEW, sal_False);
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False);
- if( bOk && pMedium->GetOrigURL().Len()
+ if( bOk && !pMedium->GetOrigURL().isEmpty()
&& !( pAsTempItem && pAsTempItem->GetValue() )
&& !( pPreviewItem && pPreviewItem->GetValue() )
&& !( pHiddenItem && pHiddenItem->GetValue() ) )
@@ -1147,8 +1147,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// use UCB for case sensitive/insensitive file name comparison
if ( pMedium
- && pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
+ && !pMedium->GetName().equalsIgnoreAsciiCaseAscii("private:stream")
+ && !rMedium.GetName().equalsIgnoreAsciiCaseAscii("private:stream")
&& ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
{
bStoreToSameLocation = sal_True;
@@ -1643,7 +1643,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( bNeedsDisconnectionOnFail )
ConnectTmpStorage_Impl( pImp->m_xDocStorage, NULL );
}
- else if ( pMedium->GetName().Len()
+ else if (!pMedium->GetName().isEmpty()
|| ( pMedium->HasStorage_Impl() && pMedium->WillDisposeStorageOnClose_Impl() ) )
{
OSL_ENSURE( pMedium->GetName().Len(), "Fallback is used, the medium without name should not dispose the storage!\n" );
@@ -1934,7 +1934,7 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
{
if( bMedChanged )
{
- if( pNewMed->GetName().Len() )
+ if (!pNewMed->GetName().isEmpty())
bHasName = sal_True;
Broadcast( SfxSimpleHint(SFX_HINT_NAMECHANGED) );
getDocProperties()->setGenerator(
@@ -2039,7 +2039,7 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
pNewMed->SetCachedSignatureState_Impl( SIGNATURESTATE_NOSIGNATURES ); // set the default value back
// Set new title
- if ( pNewMed->GetName().Len() && SFX_CREATE_MODE_EMBEDDED != eCreateMode )
+ if (!pNewMed->GetName().isEmpty() && SFX_CREATE_MODE_EMBEDDED != eCreateMode)
InvalidateName();
SetModified(sal_False); // reset only by set medium
Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index c461d742ace0..8d2a58218553 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -405,7 +405,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc )
GetParentFrame();
const SfxMedium *pMed = pDoc->GetMedium();
- GetDescriptor()->SetActualURL( pMed->GetOrigURL() );
+ GetDescriptor()->SetActualURL( String(pMed->GetOrigURL()) );
SFX_ITEMSET_ARG( pMed->GetItemSet(), pItem, SfxBoolItem, SID_EDITDOC, sal_False );
sal_Bool bEditable = ( !pItem || pItem->GetValue() );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 97ef69958dc0..83c10ea3f0bb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -597,8 +597,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
SfxMedium *pMedium = xOldObj->GetMedium();
// Remove Frameset before the FramesetView may disappear
- String aURL = pURLItem ? pURLItem->GetValue() :
- pMedium->GetName();
+ String aURL;
+ if (pURLItem)
+ aURL = pURLItem->GetValue();
+ else
+ aURL = pMedium->GetName();
sal_Bool bHandsOff =
( pMedium->GetURLObject().GetProtocol() == INET_PROT_FILE && !xOldObj->IsDocShared() );
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index f5387eeffd6c..0c95d5b74ff8 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -61,7 +61,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
if( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() &&
// If this is our Doc, we can also have local jumps!
- sURL == pDoc->GetDocShell()->GetMedium()->GetName() )
+ pDoc->GetDocShell()->GetMedium()->GetName().equals(sURL) )
(sBkmk = pIURL->GetMark()).Insert( INET_MARK_TOKEN, 0 );
sal_Bool bAction = sal_False, bUnLockView = sal_False;
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index bcad2aee9471..12b06de03604 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -823,9 +823,11 @@ void SwSrcView::Load(SwDocShell* pDocShell)
SwWriter aWriter( aMedium, *pDocShell->GetDoc() );
WriterRef xWriter;
::GetHTMLWriter(aEmptyStr, aMedium.GetBaseURL( true ), xWriter);
- String sWriteName = pDocShell->HasName() ?
- pMedium->GetName() :
- (const String&) sFileURL;
+ String sWriteName;
+ if (pDocShell->HasName())
+ sWriteName = pMedium->GetName();
+ else
+ sWriteName = sFileURL;
sal_uLong nRes = aWriter.Write(xWriter, &sWriteName);
if(nRes)
{