summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-06-23 23:55:50 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-06-24 09:22:26 +0200
commit36d91a65ab2db0c4c81e09771f6b44e1905122a0 (patch)
tree53e8d6645737d25ac51d46bd63e430e401c7ed69
parent4493f983d511990684588fbd141ec4f6ff0b40b6 (diff)
tdf#40713: dBASE, don't lose dbt file
if aDbtFile corresponds exactly to aTmpFile, we just have to return Change-Id: I1dde8efbe01838dc94f6025d5b81f5aee01932ac Reviewed-on: https://gerrit.libreoffice.org/39189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--sc/source/ui/docshell/docsh.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 36ce03fdf3f2..fd4721744e27 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2379,6 +2379,12 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
const SfxStringItem* pNameItem = rMed.GetItemSet()->GetItem<SfxStringItem>( SID_FILE_NAME );
INetURLObject aDbtFile( pNameItem->GetValue(), INetProtocol::File );
aDbtFile.setExtension("dbt");
+
+ // tdf#40713: don't lose dbt file
+ // if aDbtFile corresponds exactly to aTmpFile, we just have to return
+ if (aDbtFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) == aTmpFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ))
+ return bRet;
+
if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) )
bRet = false;
if ( bRet && !MoveFile( aTmpFile, aDbtFile ) )