summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-23 16:52:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-23 21:27:25 +0100
commit8c9a3195068bf00e00290f363d5028e9986bbba6 (patch)
treebd571c7e021526bcd098952ea380dc039b70ee04 /sfx2
parenta27f26228c8311b3b01ecca81d6cdcd3ceb644e1 (diff)
Resolves: tdf#113962 save detected filter outside file dialog
different file dialog impls work differently so store the detected filter outside the file dialog Change-Id: I144d8df06e5265fed8f11b284a2f40c17c3e09ef Reviewed-on: https://gerrit.libreoffice.org/45166 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/fileobj.cxx2
-rw-r--r--sfx2/source/appl/opengrf.cxx23
2 files changed, 18 insertions, 7 deletions
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index bb71b5ddc413..46c860e2fcbe 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -413,7 +413,7 @@ void SvFileObject::Edit(vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Lin
sFile = aDlg.GetPath()
+ OUStringLiteral1(sfx2::cTokenSeparator)
+ OUStringLiteral1(sfx2::cTokenSeparator)
- + aDlg.GetCurrentFilter();
+ + aDlg.GetDetectedFilter();
aEndEditLink.Call( sFile );
}
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 0bb827edd1fc..9407c88dd96c 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -73,6 +73,7 @@ struct SvxOpenGrf_Impl
SvxOpenGrf_Impl(const vcl::Window* pPreferredParent);
sfx2::FileDialogHelper aFileDlg;
+ OUString sDetectedFilter;
uno::Reference < XFilePickerControlAccess > xCtrlAcc;
};
@@ -153,11 +154,15 @@ ErrCode SvxOpenGraphicDialog::Execute()
}
else
{
- // setup appropriate filter (so next time, it will work)
if( rFilter.GetImportFormatCount() )
{
- OUString aFormatName(rFilter.GetImportFormatName(nFound));
- SetCurrentFilter(aFormatName);
+ // store detected appropriate filter
+ OUString aFormatName(rFilter.GetImportFormatName(nFound));
+ SetDetectedFilter(aFormatName);
+ }
+ else
+ {
+ SetDetectedFilter(mpImpl->aFileDlg.GetCurrentFilter());
}
return nImpRet;
@@ -234,28 +239,34 @@ bool SvxOpenGraphicDialog::IsAsLink() const
return false;
}
-
ErrCode SvxOpenGraphicDialog::GetGraphic(Graphic& rGraphic) const
{
return mpImpl->aFileDlg.GetGraphic(rGraphic);
}
-
OUString SvxOpenGraphicDialog::GetPath() const
{
return mpImpl->aFileDlg.GetPath();
}
-
OUString SvxOpenGraphicDialog::GetCurrentFilter() const
{
return mpImpl->aFileDlg.GetCurrentFilter();
}
+OUString SvxOpenGraphicDialog::GetDetectedFilter() const
+{
+ return mpImpl->sDetectedFilter;
+}
void SvxOpenGraphicDialog::SetCurrentFilter(const OUString& rStr)
{
mpImpl->aFileDlg.SetCurrentFilter(rStr);
}
+void SvxOpenGraphicDialog::SetDetectedFilter(const OUString& rStr)
+{
+ mpImpl->sDetectedFilter = rStr;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */