summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/Library_fps.mk2
-rw-r--r--fpicker/Library_fps_aqua.mk2
-rw-r--r--fpicker/Library_fps_office.mk2
-rw-r--r--fpicker/inc/bitmaps.hlst7
-rw-r--r--fpicker/inc/fpsofficeResMgr.hxx15
-rw-r--r--fpicker/inc/strings.hrc2
-rw-r--r--fpicker/source/aqua/ControlHelper.hxx1
-rw-r--r--fpicker/source/aqua/ControlHelper.mm17
-rw-r--r--fpicker/source/aqua/FilterHelper.hxx11
-rw-r--r--fpicker/source/aqua/FilterHelper.mm51
-rw-r--r--fpicker/source/aqua/NSString_OOoAdditions.mm10
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.mm3
-rw-r--r--fpicker/source/aqua/SalAquaFolderPicker.mm4
-rw-r--r--fpicker/source/aqua/resourceprovider.mm3
-rw-r--r--fpicker/source/office/OfficeControlAccess.cxx59
-rw-r--r--fpicker/source/office/OfficeControlAccess.hxx5
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx41
-rw-r--r--fpicker/source/office/OfficeFolderPicker.cxx1
-rw-r--r--fpicker/source/office/PlacesListBox.cxx47
-rw-r--r--fpicker/source/office/PlacesListBox.hxx3
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx61
-rw-r--r--fpicker/source/office/RemoteFilesDialog.hxx4
-rw-r--r--fpicker/source/office/autocmpledit.cxx25
-rw-r--r--fpicker/source/office/autocmpledit.hxx2
-rw-r--r--fpicker/source/office/commonpicker.cxx2
-rw-r--r--fpicker/source/office/contentenumeration.cxx52
-rw-r--r--fpicker/source/office/contentenumeration.hxx10
-rw-r--r--fpicker/source/office/fileview.cxx110
-rw-r--r--fpicker/source/office/fileview.hxx11
-rw-r--r--fpicker/source/office/foldertree.cxx2
-rw-r--r--fpicker/source/office/foldertree.hxx2
-rw-r--r--fpicker/source/office/fpdialogbase.hxx4
-rw-r--r--fpicker/source/office/fpinteraction.cxx5
-rw-r--r--fpicker/source/office/fpinteraction.hxx2
-rw-r--r--fpicker/source/office/fpsmartcontent.cxx26
-rw-r--r--fpicker/source/office/fpsmartcontent.hxx5
-rw-r--r--fpicker/source/office/iodlg.cxx129
-rw-r--r--fpicker/source/office/iodlg.hxx4
-rw-r--r--fpicker/source/office/iodlgimp.cxx15
-rw-r--r--fpicker/source/office/iodlgimp.hxx10
-rw-r--r--fpicker/source/win32/VistaFilePicker.cxx1
-rw-r--r--fpicker/source/win32/VistaFilePickerEventHandler.cxx4
-rw-r--r--fpicker/source/win32/VistaFilePickerImpl.cxx70
-rw-r--r--fpicker/source/win32/VistaFilePickerImpl.hxx40
-rw-r--r--fpicker/source/win32/WinImplHelper.cxx6
-rw-r--r--fpicker/source/win32/resourceprovider.cxx2
-rw-r--r--fpicker/source/win32/shared.hxx29
-rw-r--r--fpicker/source/win32/workbench/Test_fps.cxx2
-rw-r--r--fpicker/uiconfig/ui/explorerfiledialog.ui19
49 files changed, 458 insertions, 482 deletions
diff --git a/fpicker/Library_fps.mk b/fpicker/Library_fps.mk
index 047e888e3954..3e14f03b7ec2 100644
--- a/fpicker/Library_fps.mk
+++ b/fpicker/Library_fps.mk
@@ -14,7 +14,7 @@ $(eval $(call gb_Library_use_custom_headers,fps,\
officecfg/registry \
))
-$(eval $(call gb_Library_set_componentfile,fps,fpicker/source/win32/fps))
+$(eval $(call gb_Library_set_componentfile,fps,fpicker/source/win32/fps,services))
$(eval $(call gb_Library_set_include,fps,\
$$(INCLUDE) \
diff --git a/fpicker/Library_fps_aqua.mk b/fpicker/Library_fps_aqua.mk
index 4c033a838bc5..0b8db2e37729 100644
--- a/fpicker/Library_fps_aqua.mk
+++ b/fpicker/Library_fps_aqua.mk
@@ -10,7 +10,7 @@
$(eval $(call gb_Library_Library,fps_aqua))
-$(eval $(call gb_Library_set_componentfile,fps_aqua,fpicker/source/aqua/fps_aqua))
+$(eval $(call gb_Library_set_componentfile,fps_aqua,fpicker/source/aqua/fps_aqua,services))
$(eval $(call gb_Library_set_include,fps_aqua,\
$$(INCLUDE) \
diff --git a/fpicker/Library_fps_office.mk b/fpicker/Library_fps_office.mk
index 147dceb34da2..d7e41e66eb17 100644
--- a/fpicker/Library_fps_office.mk
+++ b/fpicker/Library_fps_office.mk
@@ -10,7 +10,7 @@
$(eval $(call gb_Library_Library,fps_office))
-$(eval $(call gb_Library_set_componentfile,fps_office,fpicker/source/office/fps_office))
+$(eval $(call gb_Library_set_componentfile,fps_office,fpicker/source/office/fps_office,services))
$(eval $(call gb_Library_set_include,fps_office,\
$$(INCLUDE) \
diff --git a/fpicker/inc/bitmaps.hlst b/fpicker/inc/bitmaps.hlst
index b7841db8813e..201eb0580063 100644
--- a/fpicker/inc/bitmaps.hlst
+++ b/fpicker/inc/bitmaps.hlst
@@ -9,9 +9,8 @@
#pragma once
-#define RID_BMP_FOLDER_OPEN "res/folderop.png"
-#define BMP_FILEDLG_PLACE_LOCAL "fpicker/res/fp015.png"
-#define BMP_FILEDLG_PLACE_REMOTE "fpicker/res/fp016.png"
-#define RID_BMP_FOLDER "svtools/res/folder.png"
+inline constexpr OUString BMP_FILEDLG_PLACE_LOCAL = u"fpicker/res/fp015.png"_ustr;
+inline constexpr OUString BMP_FILEDLG_PLACE_REMOTE = u"fpicker/res/fp016.png"_ustr;
+inline constexpr OUString RID_BMP_FOLDER = u"svtools/res/folder.png"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/fpicker/inc/fpsofficeResMgr.hxx b/fpicker/inc/fpsofficeResMgr.hxx
deleted file mode 100644
index a86a91509c38..000000000000
--- a/fpicker/inc/fpsofficeResMgr.hxx
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-#pragma once
-
-#include <unotools/resmgr.hxx>
-
-inline OUString FpsResId(TranslateId aId) { return Translate::get(aId, Translate::Create("fps")); };
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/inc/strings.hrc b/fpicker/inc/strings.hrc
index 042ea35c44ce..bb5f553f5067 100644
--- a/fpicker/inc/strings.hrc
+++ b/fpicker/inc/strings.hrc
@@ -19,7 +19,7 @@
#pragma once
-#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+#define NC_(Context, String) TranslateId(Context, u8##String)
#define STR_EXPLORERFILE_OPEN NC_("STR_EXPLORERFILE_OPEN", "Open")
#define STR_EXPLORERFILE_SAVE NC_("STR_EXPLORERFILE_SAVE", "Save as")
diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx
index 5da540df61ec..ede5d0b0d574 100644
--- a/fpicker/source/aqua/ControlHelper.hxx
+++ b/fpicker/source/aqua/ControlHelper.hxx
@@ -69,6 +69,7 @@ public:
enum ToggleType {
AUTOEXTENSION, //but autoextension is handled differently on MacOSX
PASSWORD,
+ GPGENCRYPTION,
FILTEROPTIONS,
READONLY,
LINK,
diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm
index 1feb6d9458a2..46c8c549035f 100644
--- a/fpicker/source/aqua/ControlHelper.mm
+++ b/fpicker/source/aqua/ControlHelper.mm
@@ -66,12 +66,13 @@ uno::Any HandleGetListValue(const NSControl* pControl, const sal_Int16 nControlA
int nItems = [rMenu numberOfItems];
if (nItems > 0) {
aItemList.realloc(nItems);
- }
- for (int i = 0; i < nItems; i++) {
- NSString* sCFItem = [pButton itemTitleAtIndex:i];
- if (nil != sCFItem) {
- aItemList[i] = [sCFItem OUString];
- SAL_INFO("fpicker.aqua","Return value[" << (i - 1) << "]: " << aItemList[i - 1]);
+ OUString* pItemList = aItemList.getArray();
+ for (int i = 0; i < nItems; i++) {
+ NSString* sCFItem = [pButton itemTitleAtIndex:i];
+ if (nil != sCFItem) {
+ pItemList[i] = [sCFItem OUString];
+ SAL_INFO("fpicker.aqua","Return value[" << (i - 1) << "]: " << aItemList[i - 1]);
+ }
}
}
@@ -183,10 +184,12 @@ void ControlHelper::initialize( sal_Int16 nTemplateId )
case FILESAVE_AUTOEXTENSION_PASSWORD:
m_bToggleVisibility[AUTOEXTENSION] = true;
m_bToggleVisibility[PASSWORD] = true;
+ m_bToggleVisibility[GPGENCRYPTION] = true;
break;
case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
m_bToggleVisibility[AUTOEXTENSION] = true;
m_bToggleVisibility[PASSWORD] = true;
+ m_bToggleVisibility[GPGENCRYPTION] = true;
m_bToggleVisibility[FILTEROPTIONS] = true;
break;
case FILESAVE_AUTOEXTENSION_SELECTION:
@@ -601,6 +604,7 @@ int ControlHelper::getControlElementName(const Class aClazz, const int nControlI
switch (nControlId) {
TOGGLE_ELEMENT( AUTOEXTENSION );
TOGGLE_ELEMENT( PASSWORD );
+ TOGGLE_ELEMENT( GPGENCRYPTION );
TOGGLE_ELEMENT( FILTEROPTIONS );
TOGGLE_ELEMENT( READONLY );
TOGGLE_ELEMENT( LINK );
@@ -724,6 +728,7 @@ case ExtendedFilePickerElementIds::LISTBOX_##elem##_LABEL: \
{
MAP_TOGGLE( AUTOEXTENSION );
MAP_TOGGLE( PASSWORD );
+ MAP_TOGGLE( GPGENCRYPTION );
MAP_TOGGLE( FILTEROPTIONS );
MAP_TOGGLE( READONLY );
MAP_TOGGLE( LINK );
diff --git a/fpicker/source/aqua/FilterHelper.hxx b/fpicker/source/aqua/FilterHelper.hxx
index 6cf4aec5996e..56463126c945 100644
--- a/fpicker/source/aqua/FilterHelper.hxx
+++ b/fpicker/source/aqua/FilterHelper.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <list>
+#include <string_view>
#include <vector>
#include <premac.h>
@@ -38,7 +39,7 @@ typedef css::uno::Sequence< UnoFilterEntry > UnoFilterList; // can be transpo
typedef ::std::list<NSString *> NSStringList;
typedef ::std::list<OUString> OUStringList;
-struct FilterEntry
+struct AquaFilterEntry
{
protected:
OUString m_sTitle;
@@ -46,13 +47,13 @@ protected:
UnoFilterList m_aSubFilters;
public:
- FilterEntry( const OUString& _rTitle, const OUStringList _rFilter )
+ AquaFilterEntry( const OUString& _rTitle, const OUStringList _rFilter )
: m_sTitle( _rTitle )
, m_sFilterSuffixList( _rFilter )
{
}
- FilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFilters );
+ AquaFilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFilters );
OUString const & getTitle() const { return m_sTitle; }
OUStringList const & getFilterSuffixList() const { return m_sFilterSuffixList; }
@@ -71,7 +72,7 @@ public:
const UnoFilterEntry* endSubFilters() const { return m_aSubFilters.getConstArray() + m_aSubFilters.getLength(); }
};
-typedef ::std::vector < FilterEntry > FilterList;
+typedef ::std::vector < AquaFilterEntry > FilterList;
class FilterHelper {
@@ -82,7 +83,7 @@ public:
//XFilterManager delegates
/// @throws css::lang::IllegalArgumentException
/// @throws css::uno::RuntimeException
- void appendFilter( const OUString& aTitle, const OUString& aFilter );
+ void appendFilter( const OUString& aTitle, std::u16string_view aFilter );
/// @throws css::lang::IllegalArgumentException
/// @throws css::uno::RuntimeException
diff --git a/fpicker/source/aqua/FilterHelper.mm b/fpicker/source/aqua/FilterHelper.mm
index 58508c434191..98c27b720728 100644
--- a/fpicker/source/aqua/FilterHelper.mm
+++ b/fpicker/source/aqua/FilterHelper.mm
@@ -21,6 +21,9 @@
#include <sal/log.hxx>
#include <algorithm>
+#include <cstddef>
+#include <string_view>
+#include <o3tl/string_view.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -31,12 +34,12 @@
namespace {
-void fillSuffixList(OUStringList& aSuffixList, const OUString& suffixString) {
- sal_Int32 nIndex = 0;
+void fillSuffixList(OUStringList& aSuffixList, std::u16string_view suffixString) {
+ std::size_t nIndex = 0;
do {
- OUString aToken = suffixString.getToken( 0, ';', nIndex );
- aSuffixList.push_back(aToken.copy(1));
- } while ( nIndex >= 0 );
+ std::u16string_view aToken = o3tl::getToken( suffixString, u';', nIndex );
+ aSuffixList.push_back(OUString(aToken.substr(1)));
+ } while ( nIndex != std::u16string_view::npos );
}
}
@@ -45,14 +48,14 @@ void fillSuffixList(OUStringList& aSuffixList, const OUString& suffixString) {
#pragma mark FilterEntry
-FilterEntry::FilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFilters )
+AquaFilterEntry::AquaFilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFilters )
:m_sTitle( _rTitle )
,m_aSubFilters( _rSubFilters )
{
}
-bool FilterEntry::hasSubFilters() const
+bool AquaFilterEntry::hasSubFilters() const
{
bool bReturn = ( 0 < m_aSubFilters.getLength() );
@@ -60,7 +63,7 @@ bool FilterEntry::hasSubFilters() const
}
-sal_Int32 FilterEntry::getSubFilters( UnoFilterList& _rSubFilterList )
+sal_Int32 AquaFilterEntry::getSubFilters( UnoFilterList& _rSubFilterList )
{
_rSubFilterList = m_aSubFilters;
sal_Int32 nReturn = m_aSubFilters.getLength();
@@ -70,24 +73,22 @@ sal_Int32 FilterEntry::getSubFilters( UnoFilterList& _rSubFilterList )
#pragma mark statics
static bool
-isFilterString( const OUString& rFilterString, const char *pMatch )
+isFilterString( std::u16string_view rFilterString, std::u16string_view pMatch )
{
- sal_Int32 nIndex = 0;
- OUString aToken;
+ std::size_t nIndex = 0;
+ std::u16string_view aToken;
bool bIsFilter = true;
- OUString aMatch(OUString::createFromAscii(pMatch));
-
do
{
- aToken = rFilterString.getToken( 0, ';', nIndex );
- if( !aToken.match( aMatch ) )
+ aToken = o3tl::getToken( rFilterString, u';', nIndex );
+ if( !o3tl::starts_with( aToken, pMatch ) )
{
bIsFilter = false;
break;
}
}
- while( nIndex >= 0 );
+ while( nIndex != std::u16string_view::npos );
return bIsFilter;
}
@@ -109,12 +110,12 @@ shrinkFilterName( const OUString& aFilterName, bool bAllowNoStar = false )
sal_Int32 nBracketLen = nBracketEnd - i;
if( nBracketEnd <= 0 )
continue;
- if( isFilterString( aFilterName.copy( i + 1, nBracketLen - 1 ), "*." ) )
- aRealName = aRealName.replaceAt( i, nBracketLen + 1, OUString() );
+ if( isFilterString( aFilterName.subView( i + 1, nBracketLen - 1 ), u"*." ) )
+ aRealName = aRealName.replaceAt( i, nBracketLen + 1, u"" );
else if (bAllowNoStar)
{
- if( isFilterString( aFilterName.copy( i + 1, nBracketLen - 1 ), ".") )
- aRealName = aRealName.replaceAt( i, nBracketLen + 1, OUString() );
+ if( isFilterString( aFilterName.subView( i + 1, nBracketLen - 1 ), u".") )
+ aRealName = aRealName.replaceAt( i, nBracketLen + 1, u"" );
}
}
}
@@ -134,7 +135,7 @@ public:
FilterTitleMatch( const OUString& _rTitle ) : rTitle( _rTitle ) { }
- bool operator () ( const FilterEntry& _rEntry )
+ bool operator () ( const AquaFilterEntry& _rEntry )
{
bool bMatch;
if( !_rEntry.hasSubFilters() ) {
@@ -259,7 +260,7 @@ void FilterHelper::SetFilters()
}
}
-void FilterHelper::appendFilter(const OUString& aTitle, const OUString& aFilterString)
+void FilterHelper::appendFilter(const OUString& aTitle, std::u16string_view aFilterString)
{
SolarMutexGuard aGuard;
@@ -273,7 +274,7 @@ void FilterHelper::appendFilter(const OUString& aTitle, const OUString& aFilterS
// append the filter
OUStringList suffixList;
fillSuffixList(suffixList, aFilterString);
- m_pFilterList->push_back(FilterEntry( aTitle, suffixList ) );
+ m_pFilterList->push_back(AquaFilterEntry( aTitle, suffixList ) );
}
void FilterHelper::setCurrentFilter( const OUString& aTitle )
@@ -304,7 +305,7 @@ void FilterHelper::appendFilterGroup( const css::uno::Sequence< css::beans::Stri
// append the filter
if (bPrependSeparator) {
OUStringList emptyList;
- m_pFilterList->push_back(FilterEntry("-", emptyList));
+ m_pFilterList->push_back(AquaFilterEntry("-", emptyList));
}
const css::beans::StringPair* pSubFilters = aFilters.getConstArray();
@@ -390,7 +391,7 @@ void FilterHelper::SetFilterAtIndex(unsigned index)
if (m_pFilterList->size() <= index) {
index = 0;
}
- FilterEntry entry = m_pFilterList->at(index);
+ AquaFilterEntry entry = m_pFilterList->at(index);
SetCurFilter(entry.getTitle());
}
diff --git a/fpicker/source/aqua/NSString_OOoAdditions.mm b/fpicker/source/aqua/NSString_OOoAdditions.mm
index 23ae6bc5c853..5721674f8121 100644
--- a/fpicker/source/aqua/NSString_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSString_OOoAdditions.mm
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <memory>
+
#include "NSString_OOoAdditions.hxx"
@implementation NSString (OOoAdditions)
@@ -32,14 +36,14 @@
{
unsigned int nFileNameLength = [self length];
- UniChar unichars[nFileNameLength+1];
+ auto const unichars = std::make_unique<UniChar[]>(nFileNameLength+1);
//'close' the string buffer correctly
unichars[nFileNameLength] = '\0';
- [self getCharacters:unichars];
+ [self getCharacters:unichars.get()];
- return OUString(reinterpret_cast<sal_Unicode *>(unichars));
+ return OUString(reinterpret_cast<sal_Unicode *>(unichars.get()));
}
@end
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index fa2ec600c2ec..01e6f80e92b5 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -250,6 +250,7 @@ uno::Sequence<OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles()
SAL_INFO("fpicker.aqua", "# of items: " << nFiles);
uno::Sequence< OUString > aSelectedFiles(nFiles);
+ OUString* pSelectedFiles = aSelectedFiles.getArray();
for(NSUInteger nIndex = 0; nIndex < nFiles; nIndex += 1)
{
@@ -279,7 +280,7 @@ uno::Sequence<OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles()
OUString sFileOrDirURL = [url OUString];
- aSelectedFiles[nIndex] = sFileOrDirURL;
+ pSelectedFiles[nIndex] = sFileOrDirURL;
}
return aSelectedFiles;
diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm
index 3dabf488a365..00021a487398 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.mm
+++ b/fpicker/source/aqua/SalAquaFolderPicker.mm
@@ -79,7 +79,7 @@ sal_Int16 SAL_CALL SalAquaFolderPicker::execute()
break;
default:
- throw uno::RuntimeException("The dialog returned with an unknown result!", static_cast< cppu::OWeakObject * >( this ));
+ throw uno::RuntimeException("The dialog returned with an unknown result!", getXWeak());
break;
}
@@ -117,7 +117,7 @@ OUString SAL_CALL SalAquaFolderPicker::getDirectory()
SAL_INFO("fpicker.aqua", "# of items: " << nFiles);
if (nFiles < 1) {
- throw uno::RuntimeException("no directory selected", static_cast< cppu::OWeakObject * >( this ));
+ throw uno::RuntimeException("no directory selected", getXWeak());
}
OUString aDirectory;
diff --git a/fpicker/source/aqua/resourceprovider.mm b/fpicker/source/aqua/resourceprovider.mm
index 34b0359a231d..e3aa23a6f64e 100644
--- a/fpicker/source/aqua/resourceprovider.mm
+++ b/fpicker/source/aqua/resourceprovider.mm
@@ -29,7 +29,7 @@
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include "NSString_OOoAdditions.hxx"
-#include <fpsofficeResMgr.hxx>
+#include <fpicker/fpsofficeResMgr.hxx>
#include "resourceprovider.hxx"
using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
@@ -50,6 +50,7 @@ struct Entry
Entry const CtrlIdToResIdTable[] = {
{ CHECKBOX_AUTOEXTENSION, STR_SVT_FILEPICKER_AUTO_EXTENSION },
{ CHECKBOX_PASSWORD, STR_SVT_FILEPICKER_PASSWORD },
+ { CHECKBOX_GPGENCRYPTION, STR_SVT_FILEPICKER_GPGENCRYPT },
{ CHECKBOX_FILTEROPTIONS, STR_SVT_FILEPICKER_FILTER_OPTIONS },
{ CHECKBOX_READONLY, STR_SVT_FILEPICKER_READONLY },
{ CHECKBOX_LINK, STR_SVT_FILEPICKER_INSERT_AS_LINK },
diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx
index 2096ccc0f178..6cde40fb48cd 100644
--- a/fpicker/source/office/OfficeControlAccess.cxx
+++ b/fpicker/source/office/OfficeControlAccess.cxx
@@ -31,6 +31,7 @@
#include <tools/debug.hxx>
#include <algorithm>
+#include <utility>
namespace svt
@@ -71,7 +72,6 @@ namespace svt
{ "AutoExtensionBox", CHECKBOX_AUTOEXTENSION, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX },
{ "CancelButton", PUSHBUTTON_CANCEL, PROPERTY_FLAGS_COMMON | PropFlags::Text },
{ "CurrentFolderText", FIXEDTEXT_CURRENTFOLDER, PROPERTY_FLAGS_COMMON | PropFlags::Text },
- { "DefaultLocationButton", TOOLBOXBUTOON_DEFAULT_LOCATION, PROPERTY_FLAGS_COMMON },
{ "FileURLEdit", EDIT_FILEURL, PROPERTY_FLAGS_COMMON | PropFlags::Text },
{ "FileURLEditLabel", EDIT_FILEURL_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text },
{ "FileView", CONTROL_FILEVIEW, PROPERTY_FLAGS_COMMON },
@@ -84,9 +84,9 @@ namespace svt
{ "ImageAnchorListLabel", LISTBOX_IMAGE_ANCHOR_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text },
{ "ImageTemplateList", LISTBOX_IMAGE_TEMPLATE, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_LISTBOX },
{ "ImageTemplateListLabel", LISTBOX_IMAGE_TEMPLATE_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text },
- { "LevelUpButton", TOOLBOXBUTOON_LEVEL_UP, PROPERTY_FLAGS_COMMON },
+ { "LevelUpButton", TOOLBOXBUTTON_LEVEL_UP, PROPERTY_FLAGS_COMMON },
{ "LinkBox", CHECKBOX_LINK, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX },
- { "NewFolderButton", TOOLBOXBUTOON_NEW_FOLDER, PROPERTY_FLAGS_COMMON },
+ { "NewFolderButton", TOOLBOXBUTTON_NEW_FOLDER, PROPERTY_FLAGS_COMMON },
{ "OkButton", PUSHBUTTON_OK , PROPERTY_FLAGS_COMMON | PropFlags::Text },
{ "PasswordBox", CHECKBOX_PASSWORD, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX },
{ "PlayButton", PUSHBUTTON_PLAY, PROPERTY_FLAGS_COMMON | PropFlags::Text },
@@ -140,8 +140,8 @@ namespace svt
struct ControlPropertyLookup
{
OUString m_sLookup;
- explicit ControlPropertyLookup(const OUString& rLookup)
- : m_sLookup(rLookup)
+ explicit ControlPropertyLookup(OUString aLookup)
+ : m_sLookup(std::move(aLookup))
{
}
@@ -150,13 +150,6 @@ namespace svt
return m_sLookup.equalsAscii(rProp.pPropertyName);
}
};
-
-
- void lcl_throwIllegalArgumentException( )
- {
- throw IllegalArgumentException();
- // TODO: error message in the exception
- }
}
OControlAccess::OControlAccess(IFilePickerController* pController, SvtFileView* pFileView)
@@ -182,20 +175,19 @@ namespace svt
if (aHID.GetProtocol() == INetProtocol::Hid)
sHelpID = aHID.GetURLPath();
- // URLs should always be UTF8 encoded and escaped
- OString sID( OUStringToOString( sHelpID, RTL_TEXTENCODING_UTF8 ) );
+ // URLs should always be escaped
if (IsFileViewWidget(pControl))
{
// the file view "overrides" the SetHelpId
- m_pFileView->set_help_id(sID);
+ m_pFileView->set_help_id(sHelpID);
}
else
- pControl->set_help_id(sID);
+ pControl->set_help_id(sHelpID);
}
OUString OControlAccess::getHelpURL(weld::Widget const * pControl) const
{
- OString aHelpId = pControl->get_help_id();
+ OUString aHelpId = pControl->get_help_id();
if (IsFileViewWidget(pControl))
{
// the file view "overrides" the SetHelpId
@@ -203,11 +195,10 @@ namespace svt
}
OUString sHelpURL;
- OUString aTmp( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) );
- INetURLObject aHID( aTmp );
+ INetURLObject aHID(aHelpId);
if ( aHID.GetProtocol() == INetProtocol::NotValid )
sHelpURL = INET_HID_SCHEME;
- sHelpURL += aTmp;
+ sHelpURL += aHelpId;
return sHelpURL;
}
@@ -223,11 +214,11 @@ namespace svt
ControlPropertyIterator aPropDesc = ::std::find_if( s_pProperties, s_pPropertiesEnd, ControlPropertyLookup( rControlProperty ) );
if ( aPropDesc == s_pPropertiesEnd )
// it's a completely unknown property
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
if ( !( nPropertyMask & aPropDesc->nPropertyId ) )
// it's a property which is known, but not allowed for this control
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
return implGetControlProperty( pControl, aPropDesc->nPropertyId );
}
@@ -249,7 +240,7 @@ namespace svt
// if not found 'til here, the name is invalid, or we do not have the control in the current mode
if ( !pControl )
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
// out parameters and outta here
if ( _pId )
@@ -270,7 +261,7 @@ namespace svt
// look up the property
ControlPropertyIterator aPropDesc = ::std::find_if( s_pProperties, s_pPropertiesEnd, ControlPropertyLookup( rControlProperty ) );
if ( aPropDesc == s_pPropertiesEnd )
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
// set the property
implSetControlProperty( nControlId, pControl, aPropDesc->nPropertyId, rValue, false );
@@ -509,7 +500,7 @@ namespace svt
if ( aTemplateList.hasElements() )
{
- for ( const OUString& s : std::as_const(aTemplateList) )
+ for (const OUString& s : aTemplateList)
pListbox->append_text( s );
}
}
@@ -556,7 +547,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -570,7 +561,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -584,7 +575,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -598,7 +589,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -615,7 +606,7 @@ namespace svt
pComboBox->clear();
// add the new ones
- for (auto const & item : std::as_const(aItems))
+ for (auto const& item : aItems)
{
pComboBox->append_text(item);
}
@@ -623,7 +614,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -640,7 +631,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -657,7 +648,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
@@ -674,7 +665,7 @@ namespace svt
}
else if ( !_bIgnoreIllegalArgument )
{
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
}
break;
diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx
index 89e527be2f21..859ff15f270e 100644
--- a/fpicker/source/office/OfficeControlAccess.hxx
+++ b/fpicker/source/office/OfficeControlAccess.hxx
@@ -51,9 +51,8 @@ namespace svt
namespace InternalFilePickerElementIds
{
const sal_Int16 PUSHBUTTON_HELP = sal_Int16(0x1000);
- const sal_Int16 TOOLBOXBUTOON_DEFAULT_LOCATION = sal_Int16(0x1001);
- const sal_Int16 TOOLBOXBUTOON_LEVEL_UP = sal_Int16(0x1002);
- const sal_Int16 TOOLBOXBUTOON_NEW_FOLDER = sal_Int16(0x1003);
+ const sal_Int16 TOOLBOXBUTTON_LEVEL_UP = sal_Int16(0x1002);
+ const sal_Int16 TOOLBOXBUTTON_NEW_FOLDER = sal_Int16(0x1003);
const sal_Int16 FIXEDTEXT_CURRENTFOLDER = sal_Int16(0x1004);
}
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index 3386979e4714..c0ba40632a0c 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -23,6 +23,7 @@
#include "iodlg.hxx"
#include "RemoteFilesDialog.hxx"
+#include <utility>
#include <vector>
#include <algorithm>
#include <sal/log.hxx>
@@ -44,7 +45,6 @@ using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::awt;
-using namespace ::utl;
struct FilterEntry
@@ -56,13 +56,13 @@ protected:
UnoFilterList m_aSubFilters;
public:
- FilterEntry( const OUString& _rTitle, const OUString& _rFilter )
- :m_sTitle( _rTitle )
- ,m_sFilter( _rFilter )
+ FilterEntry( OUString _aTitle, OUString _aFilter )
+ :m_sTitle(std::move( _aTitle ))
+ ,m_sFilter(std::move( _aFilter ))
{
}
- FilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFilters );
+ FilterEntry( OUString _aTitle, const UnoFilterList& _rSubFilters );
const OUString& getTitle() const { return m_sTitle; }
const OUString& getFilter() const { return m_sFilter; }
@@ -80,8 +80,8 @@ public:
};
-FilterEntry::FilterEntry( const OUString& _rTitle, const UnoFilterList& _rSubFilters )
- :m_sTitle( _rTitle )
+FilterEntry::FilterEntry( OUString _aTitle, const UnoFilterList& _rSubFilters )
+ :m_sTitle(std::move( _aTitle ))
,m_aSubFilters( _rSubFilters )
{
}
@@ -424,7 +424,7 @@ sal_Int16 SvtFilePicker::implExecutePicker( )
// now we are ready to execute the dialog
sal_Int16 nRet = m_xDlg->run();
- // the execution of the dialog yields, so it is possible the at this point the window or the dialog is closed
+ // coverity[check_after_deref] - the execution of the dialog yields, so it is possible the at this point the window or the dialog is closed
if (m_xDlg)
m_xDlg->SetFileCallback( nullptr );
@@ -463,7 +463,15 @@ IMPLEMENT_FORWARD_XINTERFACE3( SvtRemoteFilePicker, SvtFilePicker, OCommonPicker
// disambiguate XTypeProvider
-IMPLEMENT_FORWARD_XTYPEPROVIDER3( SvtRemoteFilePicker, SvtFilePicker, OCommonPicker, SvtFilePicker_Base )
+css::uno::Sequence< css::uno::Type > SAL_CALL SvtRemoteFilePicker::getTypes( )
+{
+ return ::comphelper::concatSequences(
+ SvtFilePicker::getTypes(),
+ OCommonPicker::getTypes(),
+ SvtFilePicker_Base::getTypes()
+ );
+}
+IMPLEMENT_GET_IMPLEMENTATION_ID( SvtRemoteFilePicker )
// XExecutableDialog functions
@@ -773,12 +781,7 @@ Sequence< sal_Int16 > SAL_CALL SvtFilePicker::getSupportedImageFormats()
{
checkAlive();
- SolarMutexGuard aGuard;
- Sequence< sal_Int16 > aFormats( 1 );
-
- aFormats[0] = FilePreviewImageFormats::BITMAP;
-
- return aFormats;
+ return { FilePreviewImageFormats::BITMAP };
}
sal_Int32 SAL_CALL SvtFilePicker::getTargetColorDepth()
@@ -877,7 +880,7 @@ void SAL_CALL SvtFilePicker::appendFilterGroup( const OUString& sGroupTitle,
if ( FilterNameExists( aFilters ) )
throw IllegalArgumentException(
"filter name exists",
- static_cast< OWeakObject * >(this), 1);
+ getXWeak(), 1);
// ensure that we have a filter list
OUString sInitialCurrentFilter;
@@ -953,19 +956,19 @@ void SAL_CALL SvtFilePicker::initialize( const Sequence< Any >& _rArguments )
{
// compatibility: one argument, type sal_Int16 , specifies the service type
int index = 0;
-
+ auto pArguments = aArguments.getArray();
if (_rArguments[0] >>= m_nServiceType)
{
// skip the first entry if it was the ServiceType, because it's not needed in OCommonPicker::initialize and it's not a NamedValue
NamedValue emptyNamedValue;
- aArguments[0] <<= emptyNamedValue;
+ pArguments[0] <<= emptyNamedValue;
index = 1;
}
for ( int i = index; i < _rArguments.getLength(); i++)
{
NamedValue namedValue;
- aArguments[i] = _rArguments[i];
+ pArguments[i] = _rArguments[i];
if (aArguments[i] >>= namedValue )
{
diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx
index c941d6cb63c3..779bbffda7ad 100644
--- a/fpicker/source/office/OfficeFolderPicker.cxx
+++ b/fpicker/source/office/OfficeFolderPicker.cxx
@@ -30,7 +30,6 @@
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
SvtFolderPicker::SvtFolderPicker()
{
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index a7a90281bb11..86bd505179a3 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -29,6 +29,7 @@ PlacesListBox::PlacesListBox(std::unique_ptr<weld::TreeView> xControl,
mxImpl->connect_changed( LINK( this, PlacesListBox, Selection ) );
mxImpl->connect_row_activated( LINK( this, PlacesListBox, DoubleClick ) ) ;
+ mxImpl->connect_query_tooltip(LINK(this, PlacesListBox, QueryTooltipHdl));
}
PlacesListBox::~PlacesListBox( )
@@ -112,31 +113,41 @@ IMPL_LINK_NOARG( PlacesListBox, DoubleClick, weld::TreeView&, bool )
{
sal_uInt16 nSelected = mxImpl->get_cursor_index();
PlacePtr pPlace = maPlaces[nSelected];
- if ( pPlace->IsEditable() && !pPlace->IsLocal( ) )
+ if ( !pPlace->IsEditable() || pPlace->IsLocal( ) )
+ return true;
+ PlaceEditDialog aDlg(mpDlg->getDialog(), pPlace);
+ short aRetCode = aDlg.run();
+ switch (aRetCode)
{
- PlaceEditDialog aDlg(mpDlg->getDialog(), pPlace);
- short aRetCode = aDlg.run();
- switch (aRetCode)
+ case RET_OK :
{
- case RET_OK :
- {
- pPlace->SetName ( aDlg.GetServerName() );
- pPlace->SetUrl( aDlg.GetServerUrl() );
- mbUpdated = true;
- break;
- }
- case RET_NO :
- {
- RemovePlace(nSelected);
- break;
- }
- default:
- break;
+ pPlace->SetName ( aDlg.GetServerName() );
+ pPlace->SetUrl( aDlg.GetServerUrl() );
+ mbUpdated = true;
+ break;
}
+ case RET_NO :
+ {
+ RemovePlace(nSelected);
+ break;
+ }
+ default:
+ break;
}
return true;
}
+IMPL_LINK(PlacesListBox, QueryTooltipHdl, const weld::TreeIter&, rIter, OUString)
+{
+ const OUString sText = mxImpl->get_text(rIter);
+ for (const auto& pPlace : maPlaces)
+ {
+ if (pPlace->GetName() == sText)
+ return pPlace->GetUrlObject().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
+ }
+ return OUString();
+}
+
void PlacesListBox::updateView( )
{
sal_uInt32 nSelected = mxImpl->get_cursor_index();
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index ca507e06ae3a..934126072d53 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -52,7 +52,7 @@ public:
void SetDelEnabled( bool enabled );
void updateView( );
- void set_help_id(const OString& rHelpId) { mxImpl->set_help_id(rHelpId); }
+ void set_help_id(const OUString& rHelpId) { mxImpl->set_help_id(rHelpId); }
private:
@@ -60,6 +60,7 @@ private:
DECL_LINK( Selection, weld::TreeView&, void );
DECL_LINK( DoubleClick, weld::TreeView&, bool );
+ DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 2e7ac67ead37..ad23cc0dd888 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -12,17 +12,15 @@
#include "fpsmartcontent.hxx"
#include "QueryFolderName.hxx"
#include "RemoteFilesDialog.hxx"
-#include <fpsofficeResMgr.hxx>
+#include <fpicker/fpsofficeResMgr.hxx>
#include <fpicker/strings.hrc>
#include <strings.hrc>
#include <comphelper/docpasswordrequest.hxx>
-#include <comphelper/stillreadwriteinteraction.hxx>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/task/PasswordContainer.hpp>
#include <svtools/PlaceEditDialog.hxx>
#include <tools/debug.hxx>
-#include <ucbhelper/commandenvironment.hxx>
-#include <svl/fstathelper.hxx>
+#include <unotools/ucbhelper.hxx>
#include <vcl/errinf.hxx>
#include <officecfg/Office/Common.hxx>
@@ -126,7 +124,7 @@ RemoteFilesDialog::~RemoteFilesDialog()
if( !m_sIniKey.isEmpty() )
{
SvtViewOptions aDlgOpt( EViewType::Dialog, m_sIniKey );
- aDlgOpt.SetWindowState(OStringToOUString(m_xDialog->get_window_state(WindowStateMask::All), RTL_TEXTENCODING_UTF8));
+ aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::All));
Size aSize(m_xDialog->get_size());
@@ -135,24 +133,26 @@ RemoteFilesDialog::~RemoteFilesDialog()
OUString sUserData = m_xFileView->GetConfigString();
aDlgOpt.SetUserItem( "UserData",
- makeAny( sSize + sUserData ) );
+ Any( sSize + sUserData ) );
}
// save services
- std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_xContext ) );
+ std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
officecfg::Office::Common::Misc::FilePickerLastService::set( m_sLastServiceUrl, batch );
if( m_bIsUpdated )
{
Sequence< OUString > placesUrlsList( m_aServices.size() );
+ auto placesUrlsListRange = asNonConstRange(placesUrlsList);
Sequence< OUString > placesNamesList( m_aServices.size() );
+ auto placesNamesListRange = asNonConstRange(placesNamesList);
int i = 0;
for (auto const& service : m_aServices)
{
- placesUrlsList[i] = service->GetUrl();
- placesNamesList[i] = service->GetName();
+ placesUrlsListRange[i] = service->GetUrl();
+ placesNamesListRange[i] = service->GetName();
++i;
}
@@ -195,8 +195,6 @@ static OUString lcl_GetServiceType( const ServicePtr& pService )
INetProtocol aProtocol = pService->GetUrlObject().GetProtocol();
switch( aProtocol )
{
- case INetProtocol::Ftp:
- return "FTP";
case INetProtocol::Cmis:
{
OUString sHost = pService->GetUrlObject().GetHost( INetURLObject::DecodeMechanism::WithCharset );
@@ -236,7 +234,7 @@ void RemoteFilesDialog::InitSize()
if( !aDlgOpt.Exists() )
return;
- m_xDialog->set_window_state(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_UTF8));
+ m_xDialog->set_window_state(aDlgOpt.GetWindowState());
Any aUserData = aDlgOpt.GetUserItem( "UserData" );
OUString sCfgStr;
@@ -248,7 +246,7 @@ void RemoteFilesDialog::InitSize()
sal_Int32 nPos2{ sCfgStr.indexOf('|', nPos1+1 ) };
if (nPos2<0)
return;
- m_xFileView->SetConfigString( sCfgStr.copy(nPos2+1) );
+ m_xFileView->SetConfigString( sCfgStr.subView(nPos2+1) );
}
}
@@ -258,13 +256,13 @@ void RemoteFilesDialog::FillServicesListbox()
m_aServices.clear();
// Load from user settings
- Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_xContext ) );
- Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_xContext ) );
+ Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get() );
+ Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get() );
unsigned int nPos = 0;
unsigned int i = 0;
- m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_xContext );
+ m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get();
for( sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace )
{
@@ -566,9 +564,9 @@ IMPL_LINK_NOARG( RemoteFilesDialog, SelectServiceHdl, weld::ComboBox&, void )
}
}
-IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, const OString&, rIdent, void )
+IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, const OUString&, rIdent, void )
{
- OString sIdent(rIdent);
+ OUString sIdent(rIdent);
if( sIdent == "edit_service" && m_xServices_lb->get_count() > 0 )
{
int nSelected = m_xServices_lb->get_active();
@@ -686,8 +684,7 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, const OString&, rIdent, void
if ( pPasswordRequest->isPassword() )
{
- OUString aNewPass = pPasswordRequest->getPassword();
- Sequence<OUString> aPasswd { aNewPass };
+ Sequence<OUString> aPasswd { pPasswordRequest->getPassword() };
m_xMasterPasswd->addPersistent(
sUrl, sUserName, aPasswd, xInteractionHandler );
@@ -1138,12 +1135,32 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const
bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL )
{
- return FStatHelper::IsFolder(rURL);
+ try
+ {
+ ::ucbhelper::Content content(rURL,
+ ::utl::UCBContentHelper::getDefaultCommandEnvironment(),
+ m_xContext);
+ return content.isFolder();
+ }
+ catch (css::uno::Exception const&)
+ {
+ return false;
+ }
}
bool RemoteFilesDialog::ContentIsDocument( const OUString& rURL )
{
- return FStatHelper::IsDocument(rURL);
+ try
+ {
+ ::ucbhelper::Content content(rURL,
+ ::utl::UCBContentHelper::getDefaultCommandEnvironment(),
+ m_xContext);
+ return content.isDocument();
+ }
+ catch (css::uno::Exception const&)
+ {
+ return false;
+ }
}
sal_Int32 RemoteFilesDialog::getAvailableWidth()
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index 93a8e363f5b4..8c4fa0a4cbb3 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -68,7 +68,7 @@ public:
virtual const OUString& GetPath() override;
virtual std::vector<OUString> GetPathList() const override;
virtual bool ContentIsFolder( const OUString& rURL ) override;
- static bool ContentIsDocument(const OUString& rURL);
+ bool ContentIsDocument(const OUString& rURL);
virtual OUString getCurrentFileText() const override;
virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) override;
@@ -161,7 +161,7 @@ private:
void AddService();
DECL_LINK ( SelectServiceHdl, weld::ComboBox&, void );
- DECL_LINK ( EditServiceMenuHdl, const OString&, void );
+ DECL_LINK ( EditServiceMenuHdl, const OUString&, void );
DECL_LINK( DoubleClickHdl, SvtFileView*, bool );
DECL_LINK( SelectHdl, SvtFileView*, void );
diff --git a/fpicker/source/office/autocmpledit.cxx b/fpicker/source/office/autocmpledit.cxx
index 5a31c7bdc501..89a2d0b0c245 100644
--- a/fpicker/source/office/autocmpledit.cxx
+++ b/fpicker/source/office/autocmpledit.cxx
@@ -7,21 +7,44 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <vcl/event.hxx>
#include "autocmpledit.hxx"
AutocompleteEdit::AutocompleteEdit(std::unique_ptr<weld::Entry> xEntry)
: m_xEntry(std::move(xEntry))
, m_aChangedIdle("fpicker::AutocompleteEdit m_aChangedIdle")
+ , m_nLastCharCode(0)
{
m_xEntry->connect_changed(LINK(this, AutocompleteEdit, ChangedHdl));
+ m_xEntry->connect_key_press(LINK(this, AutocompleteEdit, KeyInputHdl));
m_aChangedIdle.SetInvokeHandler(LINK(this, AutocompleteEdit, TryAutoComplete));
}
+IMPL_LINK(AutocompleteEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
+{
+ m_nLastCharCode = rKEvt.GetKeyCode().GetCode();
+ return false;
+}
+
IMPL_LINK_NOARG(AutocompleteEdit, ChangedHdl, weld::Entry&, void)
{
m_aChangeHdl.Call(*m_xEntry);
- m_aChangedIdle.Start(); //launch this to happen on idle after cursor position will have been set
+
+ switch (m_nLastCharCode)
+ {
+ case css::awt::Key::DELETE_WORD_BACKWARD:
+ case css::awt::Key::DELETE_WORD_FORWARD:
+ case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
+ case css::awt::Key::DELETE_TO_END_OF_LINE:
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ m_aChangedIdle.Stop();
+ break;
+ default:
+ m_aChangedIdle.Start(); //launch this to happen on idle after cursor position will have been set
+ break;
+ }
}
void AutocompleteEdit::AddEntry( const OUString& rEntry )
diff --git a/fpicker/source/office/autocmpledit.hxx b/fpicker/source/office/autocmpledit.hxx
index bfb2ee096a63..3eb79eb14aa6 100644
--- a/fpicker/source/office/autocmpledit.hxx
+++ b/fpicker/source/office/autocmpledit.hxx
@@ -22,7 +22,9 @@ private:
std::vector<OUString> m_aMatching;
Idle m_aChangedIdle;
Link<weld::Entry&, void> m_aChangeHdl;
+ sal_uInt16 m_nLastCharCode;
+ DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
DECL_LINK(ChangedHdl, weld::Entry&, void);
DECL_LINK(TryAutoComplete, Timer*, void);
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index 29ae5d08b6c9..8b7f2827df4a 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -452,7 +452,7 @@ namespace svt
DBG_ASSERT( bKnownSetting,
OString(
"OCommonPicker::initialize: unknown argument \""
- + OString(sSettingName.getStr(), sSettingName.getLength(), osl_getThreadTextEncoding())
+ + OUStringToOString(sSettingName, osl_getThreadTextEncoding())
+ "\"!").getStr() );
}
}
diff --git a/fpicker/source/office/contentenumeration.cxx b/fpicker/source/office/contentenumeration.cxx
index b167fef3d190..2a5b0156480a 100644
--- a/fpicker/source/office/contentenumeration.cxx
+++ b/fpicker/source/office/contentenumeration.cxx
@@ -32,7 +32,7 @@
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/urlobj.hxx>
namespace svt
@@ -63,9 +63,6 @@ namespace svt
using ::com::sun::star::ucb::CommandAbortedException;
using ::com::sun::star::ucb::XContentAccess;
using ::com::sun::star::ucb::XCommandEnvironment;
- using ::com::sun::star::beans::PropertyValue;
- using ::com::sun::star::document::DocumentProperties;
- using ::ucbhelper::ResultSetInclude;
using ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
@@ -92,7 +89,7 @@ namespace svt
void FileViewContentEnumerator::cancel()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
m_bCancelled = true;
m_pResultHandler = nullptr;
m_aFolder.aContent = ::ucbhelper::Content();
@@ -105,7 +102,7 @@ namespace svt
const css::uno::Sequence< OUString >& rDenyList )
{
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
m_aFolder = _rFolder;
m_pResultHandler = nullptr;
m_rDenyList = rDenyList;
@@ -117,7 +114,7 @@ namespace svt
void FileViewContentEnumerator::enumerateFolderContent(
const FolderDescriptor& _rFolder, IEnumerationResultHandler* _pResultHandler )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
m_aFolder = _rFolder;
m_pResultHandler = _pResultHandler;
@@ -139,27 +136,25 @@ namespace svt
{
Reference< XResultSet > xResultSet;
- Sequence< OUString > aProps(12);
-
- aProps[0] = "Title";
- aProps[1] = "Size";
- aProps[2] = "DateModified";
- aProps[3] = "DateCreated";
- aProps[4] = "IsFolder";
- aProps[5] = "TargetURL";
- aProps[6] = "IsHidden";
- aProps[7] = "IsVolume";
- aProps[8] = "IsRemote";
- aProps[9] = "IsRemoveable";
- aProps[10] = "IsFloppy";
- aProps[11] = "IsCompactDisc";
+ Sequence< OUString > aProps{ "Title",
+ "Size",
+ "DateModified",
+ "DateCreated",
+ "IsFolder",
+ "TargetURL",
+ "IsHidden",
+ "IsVolume",
+ "IsRemote",
+ "IsRemoveable",
+ "IsFloppy",
+ "IsCompactDisc" };
Reference< XCommandEnvironment > xEnvironment;
try
{
FolderDescriptor aFolder;
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
aFolder = m_aFolder;
xEnvironment = m_xCommandEnv;
}
@@ -167,7 +162,7 @@ namespace svt
{
aFolder.aContent = ::ucbhelper::Content( aFolder.sURL, xEnvironment, comphelper::getProcessComponentContext() );
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
m_aFolder.aContent = aFolder.aContent;
}
}
@@ -217,7 +212,7 @@ namespace svt
// check for restrictions
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
if ( /* m_rDenyList.hasElements() && */ URLOnDenyList ( sRealURL ) )
continue;
}
@@ -253,7 +248,6 @@ namespace svt
if ( pData->mbIsFolder )
{
- SolarMutexGuard aGuard;
::svtools::VolumeInfo aVolInfo( pData->mbIsVolume, pData->mbIsRemote,
pData->mbIsRemoveable, pData->mbIsFloppy,
pData->mbIsCompactDisc );
@@ -270,7 +264,7 @@ namespace svt
}
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
bCancelled = m_bCancelled;
}
}
@@ -289,7 +283,7 @@ namespace svt
IEnumerationResultHandler* pHandler = nullptr;
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
pHandler = m_pResultHandler;
if ( m_bCancelled )
return EnumerationResult::ERROR;
@@ -308,9 +302,9 @@ namespace svt
}
- bool FileViewContentEnumerator::URLOnDenyList ( const OUString& sRealURL )
+ bool FileViewContentEnumerator::URLOnDenyList ( std::u16string_view sRealURL )
{
- OUString entryName = sRealURL.copy( sRealURL.lastIndexOf( '/' ) + 1 );
+ std::u16string_view entryName = sRealURL.substr( sRealURL.rfind( '/' ) + 1 );
return comphelper::findValue(m_rDenyList, entryName) != -1;
}
diff --git a/fpicker/source/office/contentenumeration.hxx b/fpicker/source/office/contentenumeration.hxx
index bc2180c53c47..d15db4d7a55f 100644
--- a/fpicker/source/office/contentenumeration.hxx
+++ b/fpicker/source/office/contentenumeration.hxx
@@ -22,12 +22,14 @@
#include <sal/config.h>
#include <memory>
+#include <mutex>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <salhelper/thread.hxx>
#include <ucbhelper/content.hxx>
#include <rtl/ustring.hxx>
#include <tools/datetime.hxx>
+#include <utility>
namespace svt
{
@@ -132,8 +134,8 @@ namespace svt
FolderDescriptor() { }
- explicit FolderDescriptor( const OUString& _rURL )
- :sURL( _rURL )
+ explicit FolderDescriptor( OUString _aURL )
+ :sURL(std::move( _aURL ))
{
}
};
@@ -162,7 +164,7 @@ namespace svt
ContentData& m_rContent;
::osl::Mutex& m_rContentMutex;
- mutable ::osl::Mutex m_aMutex;
+ mutable std::mutex m_aMutex;
FolderDescriptor m_aFolder;
css::uno::Reference< css::ucb::XCommandEnvironment >
@@ -172,7 +174,7 @@ namespace svt
css::uno::Sequence< OUString > m_rDenyList;
- bool URLOnDenyList ( const OUString& sRealURL );
+ bool URLOnDenyList ( std::u16string_view sRealURL );
public:
/** constructs an enumerator instance
diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx
index 203f1d1d27b3..6a77f9154ac8 100644
--- a/fpicker/source/office/fileview.cxx
+++ b/fpicker/source/office/fileview.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <algorithm>
+#include <string_view>
#include <vector>
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
@@ -46,6 +47,7 @@
#include <rtl/math.hxx>
#include <o3tl/safeint.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/mutex.hxx>
#include <osl/conditn.hxx>
#include <salhelper/timer.hxx>
@@ -62,7 +64,6 @@
#include <memory>
#include "fileview.hxx"
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::ucb;
@@ -191,8 +192,8 @@ public:
void grab_focus() { mxTreeView->grab_focus(); }
bool has_focus() const { return mxTreeView->has_focus(); }
- void set_help_id(const OString& rHelpId) { mxTreeView->set_help_id(rHelpId); }
- OString get_help_id() const { return mxTreeView->get_help_id(); }
+ void set_help_id(const OUString& rHelpId) { mxTreeView->set_help_id(rHelpId); }
+ OUString get_help_id() const { return mxTreeView->get_help_id(); }
bool IsEditingActive() const { return mbEditing; }
@@ -227,7 +228,7 @@ public:
DECL_LINK(EditedEntryHdl, const IterString&, bool);
DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
- void ExecuteContextMenuAction(std::string_view rSelectedPopentry);
+ void ExecuteContextMenuAction(std::u16string_view rSelectedPopentry);
};
}
@@ -285,7 +286,7 @@ public:
void Clear();
FileViewResult GetFolderContent_Impl(
- const OUString& rFolder,
+ std::u16string_view rFolder,
const FileViewAsyncAction* pAsyncDescriptor,
const css::uno::Sequence< OUString >& rDenyList );
@@ -293,7 +294,7 @@ public:
const FolderDescriptor& _rFolder,
const FileViewAsyncAction* pAsyncDescriptor,
const css::uno::Sequence< OUString >& rDenyList );
- void FilterFolderContent_Impl( const OUString &rFilter );
+ void FilterFolderContent_Impl( std::u16string_view rFilter );
void CancelRunningAsyncAction();
void OpenFolder_Impl();
@@ -407,10 +408,11 @@ namespace
nDec = 3;
}
- OUString aSizeStr( ::rtl::math::doubleToUString( fSize,
+ OUString aSizeStr =
+ ::rtl::math::doubleToUString( fSize,
rtl_math_StringFormat_F, nDec,
- SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) );
- aSizeStr += aUnitStr;
+ SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) +
+ aUnitStr;
return aSizeStr;
}
@@ -508,8 +510,8 @@ IMPL_LINK(ViewTabListBox_Impl, CommandHdl, const CommandEvent&, rCEvt, bool)
::ucbhelper::Content aCnt;
try
{
- OUString aURL(reinterpret_cast<SvtContentEntry*>(
- mxTreeView->get_id(rEntry).toInt64())->maURL);
+ OUString aURL(weld::fromId<SvtContentEntry*>(
+ mxTreeView->get_id(rEntry))->maURL);
aCnt = ::ucbhelper::Content( aURL, mxCmdEnv, comphelper::getProcessComponentContext() );
}
catch( Exception const & )
@@ -568,18 +570,18 @@ IMPL_LINK(ViewTabListBox_Impl, CommandHdl, const CommandEvent&, rCEvt, bool)
auto xContextMenu = xBuilder->weld_menu("menu");
xContextMenu->set_visible("delete", bEnableDelete);
xContextMenu->set_visible("rename", bEnableRename);
- OString sCommand(xContextMenu->popup_at_rect(mxTreeView.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))));
+ OUString sCommand(xContextMenu->popup_at_rect(mxTreeView.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))));
ExecuteContextMenuAction(sCommand);
}
return true;
}
-void ViewTabListBox_Impl::ExecuteContextMenuAction(std::string_view rSelectedPopupEntry)
+void ViewTabListBox_Impl::ExecuteContextMenuAction(std::u16string_view rSelectedPopupEntry)
{
- if (rSelectedPopupEntry == "delete")
+ if (rSelectedPopupEntry == u"delete")
DeleteEntries();
- else if (rSelectedPopupEntry == "rename")
+ else if (rSelectedPopupEntry == u"rename")
{
std::unique_ptr<weld::TreeIter> xEntry = mxTreeView->make_iterator();
if (mxTreeView->get_selected(xEntry.get()))
@@ -601,7 +603,7 @@ void ViewTabListBox_Impl::DeleteEntries()
mxTreeView->selected_foreach([this, &eResult](weld::TreeIter& rCurEntry){
OUString aURL;
if (!mxTreeView->get_id(rCurEntry).isEmpty())
- aURL = reinterpret_cast<SvtContentEntry*>(mxTreeView->get_id(rCurEntry).toInt64())->maURL;
+ aURL = weld::fromId<SvtContentEntry*>(mxTreeView->get_id(rCurEntry))->maURL;
if (aURL.isEmpty())
{
mxTreeView->unselect(rCurEntry);
@@ -641,16 +643,20 @@ void ViewTabListBox_Impl::DeleteEntries()
eResult = aDlg.run();
}
- if ( ( eResult == svtools::QUERYDELETE_ALL ) ||
- ( eResult == svtools::QUERYDELETE_YES ) )
+ bool bDeleted = false;
+
+ if (eResult == svtools::QUERYDELETE_ALL || eResult == svtools::QUERYDELETE_YES)
{
if ( Kill( aURL ) )
{
- delete reinterpret_cast<SvtContentEntry*>(mxTreeView->get_id(rCurEntry).toInt64());
mpParent->EntryRemoved( aURL );
+ bDeleted = true;
}
}
+ if (!bDeleted)
+ mxTreeView->unselect(rCurEntry);
+
return false;
});
@@ -672,7 +678,7 @@ IMPL_LINK(ViewTabListBox_Impl, EditedEntryHdl, const IterString&, rIterString, b
bool bRet = false;
OUString aURL;
- SvtContentEntry* pData = reinterpret_cast<SvtContentEntry*>(mxTreeView->get_id(rEntry).toInt64());
+ SvtContentEntry* pData = weld::fromId<SvtContentEntry*>(mxTreeView->get_id(rEntry));
if ( pData )
aURL = pData->maURL;
@@ -714,7 +720,7 @@ IMPL_LINK(ViewTabListBox_Impl, EditedEntryHdl, const IterString&, rIterString, b
if (pData)
pData->maURL = aURL;
- mxTreeView->set_id(rEntry, OUString::number(reinterpret_cast<sal_Int64>(pData)));
+ mxTreeView->set_id(rEntry, weld::toId(pData));
bRet = true;
}
@@ -765,7 +771,7 @@ bool ViewTabListBox_Impl::Kill( const OUString& rContent )
try
{
::ucbhelper::Content aCnt( rContent, mxCmdEnv, comphelper::getProcessComponentContext() );
- aCnt.executeCommand( "delete", makeAny( true ) );
+ aCnt.executeCommand( "delete", Any( true ) );
}
catch( css::ucb::CommandAbortedException const & )
{
@@ -826,9 +832,9 @@ OUString SvtFileView::GetURL(const weld::TreeIter& rEntry) const
{
SvtContentEntry* pEntry;
if (mpImpl->mxView->get_visible())
- pEntry = reinterpret_cast<SvtContentEntry*>(mpImpl->mxView->get_id(rEntry).toInt64());
+ pEntry = weld::fromId<SvtContentEntry*>(mpImpl->mxView->get_id(rEntry));
else
- pEntry = reinterpret_cast<SvtContentEntry*>(mpImpl->mxIconView->get_id(rEntry).toInt64());
+ pEntry = weld::fromId<SvtContentEntry*>(mpImpl->mxIconView->get_id(rEntry));
if (pEntry)
return pEntry->maURL;
return OUString();
@@ -842,13 +848,13 @@ OUString SvtFileView::GetCurrentURL() const
{
std::unique_ptr<weld::TreeIter> xEntry = mpImpl->mxView->make_iterator();
if (mpImpl->mxView->get_selected(xEntry.get()))
- pEntry = reinterpret_cast<SvtContentEntry*>(mpImpl->mxView->get_id(*xEntry).toInt64());
+ pEntry = weld::fromId<SvtContentEntry*>(mpImpl->mxView->get_id(*xEntry));
}
else
{
std::unique_ptr<weld::TreeIter> xEntry = mpImpl->mxIconView->make_iterator();
if (mpImpl->mxIconView->get_selected(xEntry.get()))
- pEntry = reinterpret_cast<SvtContentEntry*>(mpImpl->mxIconView->get_id(*xEntry).toInt64());
+ pEntry = weld::fromId<SvtContentEntry*>(mpImpl->mxIconView->get_id(*xEntry));
}
if (pEntry)
aURL = pEntry->maURL;
@@ -860,7 +866,7 @@ void SvtFileView::CreatedFolder( const OUString& rUrl, const OUString& rNewFolde
const SortingData_Impl& rEntry = mpImpl->FolderInserted( rUrl, rNewFolder );
mpImpl->maEntries.emplace_back(std::make_unique<SvtContentEntry>(rUrl, true));
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(mpImpl->maEntries.back().get())));
+ OUString sId(weld::toId(mpImpl->maEntries.back().get()));
std::unique_ptr<weld::TreeIter> xEntry = mpImpl->mxView->make_iterator();
mpImpl->mxView->insert(rEntry.maDisplayName, sId, mpImpl->maFolderImage, *xEntry);
@@ -908,12 +914,12 @@ bool SvtFileView::GetParentURL( OUString& rParentURL ) const
return bRet;
}
-OString SvtFileView::get_help_id() const
+OUString SvtFileView::get_help_id() const
{
return mpImpl->mxView->get_help_id();
}
-void SvtFileView::set_help_id(const OString& rHelpId)
+void SvtFileView::set_help_id(const OUString& rHelpId)
{
mpImpl->mxView->set_help_id(rHelpId);
}
@@ -1001,14 +1007,14 @@ SvtContentEntry* SvtFileView::FirstSelected() const
SvtContentEntry* pRet = nullptr;
std::unique_ptr<weld::TreeIter> xEntry = mpImpl->mxView->make_iterator();
if (mpImpl->mxView->get_selected(xEntry.get()))
- pRet = reinterpret_cast<SvtContentEntry*>(mpImpl->mxView->get_id(*xEntry).toInt64());
+ pRet = weld::fromId<SvtContentEntry*>(mpImpl->mxView->get_id(*xEntry));
return pRet;
}
SvtContentEntry* pRet = nullptr;
std::unique_ptr<weld::TreeIter> xEntry = mpImpl->mxIconView->make_iterator();
if (mpImpl->mxIconView->get_selected(xEntry.get()))
- pRet = reinterpret_cast<SvtContentEntry*>(mpImpl->mxIconView->get_id(*xEntry).toInt64());
+ pRet = weld::fromId<SvtContentEntry*>(mpImpl->mxIconView->get_id(*xEntry));
return pRet;
}
@@ -1060,7 +1066,7 @@ OUString SvtFileView::GetConfigString() const
OUString sRet = OUString::number( mpImpl->mnSortColumn ) + ";";
bool bUp = mpImpl->mbAscending;
- sRet += (bUp ? OUStringLiteral(u"1") : OUStringLiteral(u"0")) + ";";
+ sRet += OUString::Concat(bUp ? std::u16string_view(u"1") : std::u16string_view(u"0")) + ";";
weld::TreeView* pView = mpImpl->mxView->getWidget();
sal_uInt16 nCount = mpImpl->mxView->TypeColumnVisible() ? 4 : 3;
@@ -1093,19 +1099,19 @@ OUString SvtFileView::GetConfigString() const
return aContent;
}
-void SvtFileView::SetConfigString(const OUString& rCfgStr)
+void SvtFileView::SetConfigString(std::u16string_view rCfgStr)
{
sal_Int32 nIdx = 0;
- sal_uInt16 nSortColumn = static_cast<sal_uInt16>(rCfgStr.getToken( 0, ';', nIdx ).toInt32());
- bool bAscending = static_cast<bool>(static_cast<sal_uInt16>(rCfgStr.getToken( 0, ';', nIdx ).toInt32()));
+ sal_uInt16 nSortColumn = static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(rCfgStr, 0, ';', nIdx )));
+ bool bAscending = static_cast<bool>(static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(rCfgStr, 0, ';', nIdx ))));
std::vector<int> aWidths(mpImpl->mxView->TypeColumnVisible() ? 4 : 3, -1);
while ( nIdx != -1 )
{
- sal_uInt16 nItemId = static_cast<sal_uInt16>(rCfgStr.getToken( 0, ';', nIdx ).toInt32());
+ sal_uInt16 nItemId = static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(rCfgStr, 0, ';', nIdx )));
- int nWidth = rCfgStr.getToken( 0, ';', nIdx ).toInt32();
+ int nWidth = o3tl::toInt32(o3tl::getToken(rCfgStr, 0, ';', nIdx ));
// skip "TYPE"
if (!mpImpl->mxView->TypeColumnVisible() && nItemId != COLUMN_TITLE)
@@ -1146,7 +1152,7 @@ SvtFileView_Impl::SvtFileView_Impl(SvtFileView* pAntiImpl, weld::Window* pTopLev
{
weld::TreeView* pWidget = mxView->getWidget();
- // set the width to something small so its the parent that decides the final
+ // set the width to something small so it's the parent that decides the final
// width
Size aSize(42, pWidget->get_height_rows(7));
pWidget->set_size_request(aSize.Width(), aSize.Height());
@@ -1166,7 +1172,7 @@ void SvtFileView_Impl::Clear()
}
FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
- const OUString& rFolder,
+ std::u16string_view rFolder,
const FileViewAsyncAction* pAsyncDescriptor,
const css::uno::Sequence< OUString >& rDenyList )
{
@@ -1280,9 +1286,9 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
return eFailure;
}
-void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter )
+void SvtFileView_Impl::FilterFolderContent_Impl( std::u16string_view rFilter )
{
- if ( rFilter.isEmpty() || ( rFilter == ALL_FILES_FILTER ) )
+ if ( rFilter.empty() || ( rFilter == ALL_FILES_FILTER ) )
// when replacing names, there is always something to filter (no view of ".nametranslation.table")
return;
@@ -1297,7 +1303,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter )
// do the filtering
- maContent.erase(std::remove_if(maContent.begin(), maContent.end(),
+ std::erase_if(maContent,
[&aFilters](const std::unique_ptr<SortingData_Impl>& rxContent) {
if (rxContent->mbIsFolder)
return false;
@@ -1305,8 +1311,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter )
// 91872 - 11.09.2001 - frank.schoenheit@sun.com
OUString sCompareString = rxContent->GetFileName(); // filter works on file name, not on title!
return std::none_of(aFilters.begin(), aFilters.end(), FilterMatch(sCompareString));
- }),
- maContent.end());
+ });
}
IMPL_LINK_NOARG(SvtFileView_Impl, ChangedHdl, weld::TreeView&, void)
@@ -1364,7 +1369,7 @@ void SvtFileView_Impl::OpenFolder_Impl()
// insert entry and set user data
maEntries.emplace_back(std::make_unique<SvtContentEntry>(elem->maTargetURL, elem->mbIsFolder));
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(maEntries.back().get())));
+ OUString sId(weld::toId(maEntries.back().get()));
mxView->append(sId, elem->maDisplayName, elem->maType, elem->maDisplaySize, elem->maDisplayDate, elem->maImage);
mxIconView->append(sId, elem->maDisplayName, elem->maImage);
}
@@ -1485,22 +1490,13 @@ void SvtFileView_Impl::implEnumerationSuccess()
OUString SvtFileView_Impl::ReplaceTabWithString(const OUString& rValue)
{
- OUString const aTab( "\t" );
- OUString const aTabString( "%09" );
-
- sal_Int32 iPos;
- OUString aValue(rValue);
- while ( ( iPos = aValue.indexOf( aTab ) ) >= 0 )
- aValue = aValue.replaceAt( iPos, 1, aTabString );
- return aValue;
+ return rValue.replaceAll(u"\t", u"%09");
}
void SvtFileView_Impl::CreateDisplayText_Impl()
{
::osl::MutexGuard aGuard( maMutex );
- OUString const aDateSep( ", " );
-
for (auto const& elem : maContent)
{
// title, type, size, date
@@ -1514,7 +1510,7 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
SvtSysLocale aSysLocale;
const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
elem->maDisplayDate = rLocaleData.getDate( elem->maModDate )
- + aDateSep
+ + ", "
+ rLocaleData.getTime( elem->maModDate, false );
}
@@ -1548,7 +1544,7 @@ void SvtFileView_Impl::Resort_Impl( sal_Int16 nColumn, bool bAscending )
OUString aEntryURL;
if (bEntry && !mxView->get_id(*xEntry).isEmpty())
- aEntryURL = reinterpret_cast<SvtContentEntry*>(mxView->get_id(*xEntry).toInt64())->maURL;
+ aEntryURL = weld::fromId<SvtContentEntry*>(mxView->get_id(*xEntry))->maURL;
mnSortColumn = nColumn;
mbAscending = bAscending;
diff --git a/fpicker/source/office/fileview.hxx b/fpicker/source/office/fileview.hxx
index d86ee93900e1..a19c2095507f 100644
--- a/fpicker/source/office/fileview.hxx
+++ b/fpicker/source/office/fileview.hxx
@@ -20,6 +20,7 @@
#include <memory>
#include <com/sun/star/uno/Sequence.h>
+#include <utility>
#include <vcl/weld.hxx>
#include <rtl/ustring.hxx>
@@ -81,8 +82,8 @@ public:
bool GetParentURL( OUString& _rParentURL ) const;
void CreatedFolder( const OUString& rUrl, const OUString& rNewFolder );
- void set_help_id(const OString& rHelpId);
- OString get_help_id() const;
+ void set_help_id(const OUString& rHelpId);
+ OUString get_help_id() const;
void grab_focus();
bool has_focus() const;
@@ -162,7 +163,7 @@ public:
// save and load column size and sort order
OUString GetConfigString() const;
- void SetConfigString( const OUString& rCfgStr );
+ void SetConfigString( std::u16string_view rCfgStr );
void EndInplaceEditing();
@@ -176,8 +177,8 @@ struct SvtContentEntry
bool mbIsFolder;
OUString maURL;
- SvtContentEntry( const OUString& rURL, bool bIsFolder ) :
- mbIsFolder( bIsFolder ), maURL( rURL ) {}
+ SvtContentEntry( OUString aURL, bool bIsFolder ) :
+ mbIsFolder( bIsFolder ), maURL(std::move( aURL )) {}
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/foldertree.cxx b/fpicker/source/office/foldertree.cxx
index 2c37f25677f2..9b704d6c41d8 100644
--- a/fpicker/source/office/foldertree.cxx
+++ b/fpicker/source/office/foldertree.cxx
@@ -126,7 +126,7 @@ void FolderTree::FillTreeEntry( const OUString & rUrl, const ::std::vector< std:
m_xTreeView->expand_row(*xParent);
}
-void FolderTree::SetTreePath( OUString const & sUrl )
+void FolderTree::SetTreePath( std::u16string_view sUrl )
{
INetURLObject aUrl( sUrl );
aUrl.setFinalSlash();
diff --git a/fpicker/source/office/foldertree.hxx b/fpicker/source/office/foldertree.hxx
index 02381fc0bd58..e1ba25699c3b 100644
--- a/fpicker/source/office/foldertree.hxx
+++ b/fpicker/source/office/foldertree.hxx
@@ -41,7 +41,7 @@ public:
void InsertRootEntry(const OUString& rId, const OUString& rRootLabel);
void FillTreeEntry(const weld::TreeIter& rEntry);
void FillTreeEntry(const OUString & rUrl, const ::std::vector< std::pair< OUString, OUString > >& rFolders);
- void SetTreePath(OUString const & sUrl);
+ void SetTreePath(std::u16string_view sUrl);
void SetDenyList(const css::uno::Sequence< OUString >& rDenyList);
};
diff --git a/fpicker/source/office/fpdialogbase.hxx b/fpicker/source/office/fpdialogbase.hxx
index ec9dbb0d5f4a..60205695b719 100644
--- a/fpicker/source/office/fpdialogbase.hxx
+++ b/fpicker/source/office/fpdialogbase.hxx
@@ -52,14 +52,14 @@ namespace o3tl {
template<> struct typed_flags<PickerFlags> : is_typed_flags<PickerFlags, 0x00ffff> {};
}
-#define FILEDIALOG_FILTER_ALL "*.*"
+inline constexpr OUString FILEDIALOG_FILTER_ALL = u"*.*"_ustr;
// SvtFileDialog_Base
class SvtFileDialog_Base : public weld::GenericDialogController, public ::svt::IFilePickerController
{
public:
- SvtFileDialog_Base(weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID)
+ SvtFileDialog_Base(weld::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID)
: weld::GenericDialogController(pParent, rUIXMLDescription, rID)
{
}
diff --git a/fpicker/source/office/fpinteraction.cxx b/fpicker/source/office/fpinteraction.cxx
index 16ea3368ae08..9d3591d7586b 100644
--- a/fpicker/source/office/fpinteraction.cxx
+++ b/fpicker/source/office/fpinteraction.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/task/XInteractionRetry.hpp>
#include <sal/log.hxx>
+#include <utility>
namespace svt
@@ -34,8 +35,8 @@ namespace svt
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::ucb;
- OFilePickerInteractionHandler::OFilePickerInteractionHandler( const css::uno::Reference< css::task::XInteractionHandler >& _rxMaster )
- :m_xMaster( _rxMaster )
+ OFilePickerInteractionHandler::OFilePickerInteractionHandler( css::uno::Reference< css::task::XInteractionHandler > _xMaster )
+ :m_xMaster(std::move( _xMaster ))
,m_bUsed( false )
,m_eInterceptions( OFilePickerInteractionHandler::E_NOINTERCEPTION )
{
diff --git a/fpicker/source/office/fpinteraction.hxx b/fpicker/source/office/fpinteraction.hxx
index 6aac9c18dcb6..84f4a43d60a4 100644
--- a/fpicker/source/office/fpinteraction.hxx
+++ b/fpicker/source/office/fpinteraction.hxx
@@ -55,7 +55,7 @@ namespace svt
EInterceptedInteractions m_eInterceptions; // enable/disable interception of some special interactions
public:
- explicit OFilePickerInteractionHandler( const css::uno::Reference< css::task::XInteractionHandler >& _rxMaster );
+ explicit OFilePickerInteractionHandler( css::uno::Reference< css::task::XInteractionHandler > _xMaster );
// some generic functions
void enableInterceptions( EInterceptedInteractions eInterceptions );
diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index d77fcda0edc1..66f531ec5732 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -28,8 +28,7 @@
#include <comphelper/processfactory.hxx>
#include <ucbhelper/commandenvironment.hxx>
-#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace svt
@@ -39,7 +38,6 @@ namespace svt
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::ucb;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
@@ -130,7 +128,7 @@ namespace svt
// nothing to do, regardless of the state
return;
- m_pContent.reset();
+ m_oContent.reset();
m_eState = INVALID; // default to INVALID
m_sURL = _rURL;
@@ -138,7 +136,7 @@ namespace svt
{
try
{
- m_pContent.reset( new ::ucbhelper::Content( _rURL, m_xCmdEnv, comphelper::getProcessComponentContext() ) );
+ m_oContent.emplace( _rURL, m_xCmdEnv, comphelper::getProcessComponentContext() );
m_eState = UNKNOWN;
// from now on, the state is unknown -> we cannot know for sure if the content
// is really valid (some UCP's only tell this when asking for properties, not upon
@@ -178,7 +176,7 @@ namespace svt
if ( isInvalid() || !isBound() )
return false;
- assert( m_pContent && "SmartContent::implIs: inconsistence!" );
+ assert( m_oContent && "SmartContent::implIs: inconsistence!" );
// if, after a bindTo, we don't have a content, then we should be INVALID, or at least
// NOT_BOUND (the latter happens, for example, if somebody tries to ask for an empty URL)
@@ -186,9 +184,9 @@ namespace svt
try
{
if ( Folder == _eType )
- bIs = m_pContent->isFolder();
+ bIs = m_oContent->isFolder();
else
- bIs = m_pContent->isDocument();
+ bIs = m_oContent->isDocument();
// from here on, we definitely know that the content is valid
m_eState = VALID;
@@ -210,7 +208,7 @@ namespace svt
try
{
OUString sTitle;
- m_pContent->getPropertyValue("Title") >>= sTitle;
+ m_oContent->getPropertyValue("Title") >>= sTitle;
_rTitle = sTitle;
// from here on, we definitely know that the content is valid
@@ -232,14 +230,14 @@ namespace svt
bool bRet = false;
try
{
- Reference< XChild > xChild( m_pContent->get(), UNO_QUERY );
+ Reference< XChild > xChild( m_oContent->get(), UNO_QUERY );
if ( xChild.is() )
{
Reference< XContent > xParent( xChild->getParent(), UNO_QUERY );
if ( xParent.is() )
{
const OUString aParentURL( xParent->getIdentifier()->getContentIdentifier() );
- bRet = ( !aParentURL.isEmpty() && aParentURL != m_pContent->getURL() );
+ bRet = ( !aParentURL.isEmpty() && aParentURL != m_oContent->getURL() );
// now we're definitely valid
m_eState = VALID;
@@ -263,7 +261,7 @@ namespace svt
bool bRet = false;
try
{
- const css::uno::Sequence<css::ucb::ContentInfo> aContentsInfo = m_pContent->queryCreatableContentsInfo();
+ const css::uno::Sequence<css::ucb::ContentInfo> aContentsInfo = m_oContent->queryCreatableContentsInfo();
for ( auto const& rInfo : aContentsInfo )
{
// Simply look for the first KIND_FOLDER...
@@ -292,7 +290,7 @@ namespace svt
{
OUString sFolderType;
- const css::uno::Sequence<css::ucb::ContentInfo> aContentsInfo = m_pContent->queryCreatableContentsInfo();
+ const css::uno::Sequence<css::ucb::ContentInfo> aContentsInfo = m_oContent->queryCreatableContentsInfo();
for ( auto const& rInfo : aContentsInfo )
{
// Simply look for the first KIND_FOLDER...
@@ -308,7 +306,7 @@ namespace svt
ucbhelper::Content aCreated;
Sequence< OUString > aNames { "Title" };
Sequence< Any > aValues { Any(_rTitle) };
- m_pContent->insertNewContent( sFolderType, aNames, aValues, aCreated );
+ m_oContent->insertNewContent( sFolderType, aNames, aValues, aCreated );
aCreatedUrl = aCreated.getURL();
}
diff --git a/fpicker/source/office/fpsmartcontent.hxx b/fpicker/source/office/fpsmartcontent.hxx
index 5f9d4e32fa92..ef3329320b85 100644
--- a/fpicker/source/office/fpsmartcontent.hxx
+++ b/fpicker/source/office/fpsmartcontent.hxx
@@ -25,6 +25,7 @@
#include <ucbhelper/content.hxx>
#include <rtl/ref.hxx>
#include <memory>
+#include <optional>
namespace svt
@@ -49,7 +50,7 @@ namespace svt
private:
OUString m_sURL;
- std::unique_ptr<::ucbhelper::Content> m_pContent;
+ std::optional<::ucbhelper::Content> m_oContent;
State m_eState;
css::uno::Reference < css::ucb::XCommandEnvironment > m_xCmdEnv;
rtl::Reference<::svt::OFilePickerInteractionHandler> m_xOwnInteraction;
@@ -129,7 +130,7 @@ namespace svt
/** returns the URL of the content
*/
- OUString const & getURL() const { return m_pContent ? m_pContent->getURL() : m_sURL; }
+ OUString const & getURL() const { return m_oContent ? m_oContent->getURL() : m_sURL; }
/** (re)creates the content for the given URL
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 6d863e1d2f3f..801bf0080917 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -25,9 +25,9 @@
#include <svtools/PlaceEditDialog.hxx>
#include "OfficeControlAccess.hxx"
#include "PlacesListBox.hxx"
-#include <fpsofficeResMgr.hxx>
+#include <fpicker/fpsofficeResMgr.hxx>
#include <tools/debug.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
#include <vcl/errinf.hxx>
@@ -70,6 +70,7 @@
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include "fpinteraction.hxx"
#include <osl/process.h>
+#include <o3tl/string_view.hxx>
#include <officecfg/Office/Common.hxx>
@@ -80,7 +81,6 @@
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::task;
@@ -126,18 +126,18 @@ namespace
}
- OUString GetFsysExtension_Impl( const OUString& rFile, const OUString& rLastFilterExt )
+ OUString GetFsysExtension_Impl( std::u16string_view rFile, const OUString& rLastFilterExt )
{
- sal_Int32 nDotPos = rFile.lastIndexOf( '.' );
- if ( nDotPos != -1 )
+ size_t nDotPos = rFile.rfind( '.' );
+ if ( nDotPos != std::u16string_view::npos )
{
if ( !rLastFilterExt.isEmpty() )
{
- if ( rFile.copy( nDotPos + 1 ).equalsIgnoreAsciiCase( rLastFilterExt ) )
+ if ( o3tl::equalsIgnoreAsciiCase(rFile.substr( nDotPos + 1 ), rLastFilterExt ) )
return rLastFilterExt;
}
else
- return rFile.copy( nDotPos );
+ return OUString(rFile.substr( nDotPos ));
}
return OUString();
}
@@ -235,7 +235,7 @@ namespace
if ( xProviderProps.is() )
{
Reference< XPropertySetInfo > xPropInfo = xProviderProps->getPropertySetInfo();
- static const OUStringLiteral sHomeDirPropertyName( u"HomeDirectory" );
+ static constexpr OUString sHomeDirPropertyName( u"HomeDirectory"_ustr );
if ( !xPropInfo.is() || xPropInfo->hasPropertyByName( sHomeDirPropertyName ) )
{
OUString sHomeDirectory;
@@ -252,7 +252,7 @@ namespace
}
#endif
- OUString lcl_ensureFinalSlash( const OUString& _rDir )
+ OUString lcl_ensureFinalSlash( std::u16string_view _rDir )
{
INetURLObject aWorkPathObj( _rDir, INetProtocol::File );
aWorkPathObj.setFinalSlash();
@@ -288,7 +288,6 @@ SvtFileDialog::SvtFileDialog(weld::Window* pParent, PickerFlags nStyle)
, m_bIsInExecute(false)
, m_bInExecuteAsync(false)
, m_bHasFilename(false)
- , m_xContext(comphelper::getProcessComponentContext())
{
m_xImpl->m_xCbOptions = m_xBuilder->weld_check_button("options");
m_xImpl->m_xFtFileName = m_xBuilder->weld_label("file_name_label");
@@ -467,10 +466,10 @@ SvtFileDialog::~SvtFileDialog()
{
// save window state
SvtViewOptions aDlgOpt( EViewType::Dialog, m_xImpl->m_aIniKey );
- aDlgOpt.SetWindowState(OStringToOUString(m_xDialog->get_window_state(WindowStateMask::All), RTL_TEXTENCODING_UTF8));
+ aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::All));
OUString sUserData = m_xFileView->GetConfigString();
aDlgOpt.SetUserItem( "UserData",
- makeAny( sUserData ) );
+ Any( sUserData ) );
}
m_xFileView->SetSelectHdl(Link<SvtFileView*,void>());
@@ -481,18 +480,20 @@ SvtFileDialog::~SvtFileDialog()
const std::vector<PlacePtr> aPlaces = m_xImpl->m_xPlaces->GetPlaces();
Sequence< OUString > placesUrlsList(m_xImpl->m_xPlaces->GetNbEditablePlaces());
+ auto placesUrlsListRange = asNonConstRange(placesUrlsList);
Sequence< OUString > placesNamesList(m_xImpl->m_xPlaces->GetNbEditablePlaces());
+ auto placesNamesListRange = asNonConstRange(placesNamesList);
int i(0);
for (auto const& place : aPlaces)
{
if(place->IsEditable()) {
- placesUrlsList[i] = place->GetUrl();
- placesNamesList[i] = place->GetName();
+ placesUrlsListRange[i] = place->GetUrl();
+ placesNamesListRange[i] = place->GetName();
++i;
}
}
- std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_xContext));
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Misc::FilePickerPlacesUrls::set(placesUrlsList, batch);
officecfg::Office::Common::Misc::FilePickerPlacesNames::set(placesNamesList, batch);
batch->commit();
@@ -1268,7 +1269,7 @@ bool implIsInvalid( const OUString & rURL )
}
-OUString SvtFileDialog::implGetInitialURL( const OUString& _rPath, const OUString& _rFallback )
+OUString SvtFileDialog::implGetInitialURL( const OUString& _rPath, std::u16string_view _rFallback )
{
// a URL parser for the fallback
INetURLObject aURLParser;
@@ -1388,12 +1389,12 @@ void SvtFileDialog::displayIOException( const OUString& _rURL, IOErrorCode _eCod
// build an own exception which tells "access denied"
InteractiveAugmentedIOException aException;
- aException.Arguments.realloc( 2 );
- aException.Arguments[ 0 ] <<= sDisplayPath;
- aException.Arguments[ 1 ] <<= PropertyValue(
+ aException.Arguments =
+ { css::uno::Any(sDisplayPath),
+ css::uno::Any(PropertyValue(
"Uri",
-1, aException.Arguments[ 0 ], PropertyState_DIRECT_VALUE
- );
+ )) };
// (formerly, it was sufficient to put the URL first parameter. Nowadays,
// the services expects the URL in a PropertyValue named "Uri" ...)
aException.Code = _eCode;
@@ -1401,7 +1402,7 @@ void SvtFileDialog::displayIOException( const OUString& _rURL, IOErrorCode _eCod
// let and interaction handler handle this exception
rtl::Reference<::comphelper::OInteractionRequest> pRequest =
- new ::comphelper::OInteractionRequest( makeAny( aException ) );
+ new ::comphelper::OInteractionRequest( Any( aException ) );
pRequest->addContinuation( new ::comphelper::OInteractionAbort( ) );
Reference< XInteractionHandler2 > xHandler(
@@ -1781,7 +1782,7 @@ void SvtFileDialog::InitSize()
if ( aDlgOpt.Exists() )
{
- m_xDialog->set_window_state(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_UTF8));
+ m_xDialog->set_window_state(aDlgOpt.GetWindowState());
Any aUserData = aDlgOpt.GetUserItem( "UserData");
OUString sCfgStr;
@@ -1829,51 +1830,51 @@ bool SvtFileDialog::IsolateFilterFromPath_Impl( OUString& rPath, OUString& rFilt
rFilter.clear();
- if ( nWildCardPos != -1 )
- {
- sal_Int32 nPathTokenPos = aReversePath.indexOf( '/' );
+ if ( nWildCardPos == -1 )
+ return true;
- if ( nPathTokenPos == -1 )
- {
- OUString aDelim(
+ sal_Int32 nPathTokenPos = aReversePath.indexOf( '/' );
+
+ if ( nPathTokenPos == -1 )
+ {
+ OUString aDelim(
#if defined(_WIN32)
- '\\'
+ '\\'
#else
- '/'
+ '/'
#endif
- );
+ );
- nPathTokenPos = aReversePath.indexOf( aDelim );
+ nPathTokenPos = aReversePath.indexOf( aDelim );
#if !defined( UNX )
- if ( nPathTokenPos == -1 )
- {
- nPathTokenPos = aReversePath.indexOf( ':' );
- }
-#endif
+ if ( nPathTokenPos == -1 )
+ {
+ nPathTokenPos = aReversePath.indexOf( ':' );
}
+#endif
+ }
- // check syntax
- if ( nPathTokenPos != -1 )
+ // check syntax
+ if ( nPathTokenPos != -1 )
+ {
+ if ( nPathTokenPos < (rPath.getLength() - nWildCardPos - 1) )
{
- if ( nPathTokenPos < (rPath.getLength() - nWildCardPos - 1) )
- {
- ErrorHandler::HandleError( ERRCODE_SFX_INVALIDSYNTAX );
- return false;
- }
+ ErrorHandler::HandleError( ERRCODE_SFX_INVALIDSYNTAX );
+ return false;
+ }
- // cut off filter
- rFilter = aReversePath.copy( 0, nPathTokenPos );
- rFilter = comphelper::string::reverseString(rFilter);
+ // cut off filter
+ rFilter = aReversePath.copy( 0, nPathTokenPos );
+ rFilter = comphelper::string::reverseString(rFilter);
- // determine folder
- rPath = aReversePath.copy( nPathTokenPos );
- rPath = comphelper::string::reverseString(rPath);
- }
- else
- {
- rFilter = rPath;
- rPath.clear();
- }
+ // determine folder
+ rPath = aReversePath.copy( nPathTokenPos );
+ rPath = comphelper::string::reverseString(rPath);
+ }
+ else
+ {
+ rFilter = rPath;
+ rPath.clear();
}
return true;
@@ -2005,11 +2006,11 @@ weld::Widget* SvtFileDialog::getControl( sal_Int16 nControlId, bool bLabelContro
pReturn = m_xImpl->m_xBtnHelp.get();
break;
- case TOOLBOXBUTOON_LEVEL_UP:
+ case TOOLBOXBUTTON_LEVEL_UP:
pReturn = m_xImpl->m_xBtnUp->getWidget();
break;
- case TOOLBOXBUTOON_NEW_FOLDER:
+ case TOOLBOXBUTTON_NEW_FOLDER:
pReturn = m_xImpl->m_xBtnNewFolder.get();
break;
@@ -2265,10 +2266,10 @@ void SvtFileDialog::appendDefaultExtension(OUString& rFileName,
{
if (nPos+1<aType.getLength() && aType[nPos]=='*') // take care of a leading *
++nPos;
- const OUString aExt(aType.getToken( 0, FILEDIALOG_DEF_EXTSEP, nPos ));
- if (aExt.isEmpty())
+ const std::u16string_view aExt(o3tl::getToken(aType, 0, FILEDIALOG_DEF_EXTSEP, nPos ));
+ if (aExt.empty())
continue;
- if (aTemp.endsWith(aExt))
+ if (o3tl::ends_with(aTemp, aExt))
return;
}
while (nPos>=0);
@@ -2282,8 +2283,8 @@ void SvtFileDialog::initDefaultPlaces( )
m_xImpl->m_xPlaces->AppendPlace( pRootPlace );
// Load from user settings
- Sequence< OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get(m_xContext));
- Sequence< OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get(m_xContext));
+ Sequence< OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get());
+ Sequence< OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get());
for(sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace)
{
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 3578ae883de6..9de9261af2d7 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -77,8 +77,6 @@ private:
m_pCurrentAsyncAction;
bool m_bInExecuteAsync;
bool m_bHasFilename;
- css::uno::Reference < css::uno::XComponentContext >
- m_xContext;
DECL_LINK( FilterSelectHdl_Impl, weld::ComboBox&, void );
DECL_LINK( FilterSelectTimerHdl_Impl, Timer*, void );
@@ -232,7 +230,7 @@ private:
virtual void enableControl( sal_Int16 _nControlId, bool _bEnable ) override;
virtual OUString getCurFilter( ) const override;
- OUString implGetInitialURL( const OUString& _rPath, const OUString& _rFallback );
+ OUString implGetInitialURL( const OUString& _rPath, std::u16string_view _rFallback );
/// executes a certain FileView action asynchronously
void executeAsync(
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 1b651cbdd3fe..1802d9c8d65b 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -30,14 +30,13 @@
#include <svtools/imagemgr.hxx>
#include <svl/svlresid.hxx>
#include <svl/svl.hrc>
+#include <utility>
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::utl;
-SvtFileDialogFilter_Impl::SvtFileDialogFilter_Impl( const OUString& rName, const OUString& rType )
- : m_aName( rName )
- , m_aType( rType )
+SvtFileDialogFilter_Impl::SvtFileDialogFilter_Impl( OUString aName, OUString aType )
+ : m_aName(std::move( aName ))
+ , m_aType(std::move( aType ))
{
m_aType = m_aType.toAsciiLowerCase();
}
@@ -100,7 +99,7 @@ void SvtUpButton_Impl::FillURLMenu()
}
}
-IMPL_LINK(SvtUpButton_Impl, SelectHdl, const OString&, rId, void)
+IMPL_LINK(SvtUpButton_Impl, SelectHdl, const OUString&, rId, void)
{
sal_uInt32 nId = rId.toUInt32();
if (nId)
@@ -112,7 +111,7 @@ IMPL_LINK(SvtUpButton_Impl, SelectHdl, const OString&, rId, void)
}
}
-IMPL_LINK_NOARG(SvtUpButton_Impl, ClickHdl, const OString&, void)
+IMPL_LINK_NOARG(SvtUpButton_Impl, ClickHdl, const OUString&, void)
{
m_pDlg->PrevLevel_Impl();
}
@@ -161,7 +160,7 @@ void SvtExpFileDlg_Impl::SetCurFilter( SvtFileDialogFilter_Impl const * pFilter,
void SvtExpFileDlg_Impl::InsertFilterListEntry(const SvtFileDialogFilter_Impl* pFilterDesc)
{
// insert and set user data
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pFilterDesc)));
+ OUString sId(weld::toId(pFilterDesc));
OUString sName = pFilterDesc->GetName();
if (pFilterDesc->isGroupSeparator())
m_xLbFilter->append_separator(sId);
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 7300ab16e5e3..3a02dbbee641 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -48,7 +48,7 @@ private:
OUString m_aType; // filter wildcard - if empty, the entry marks a group
public:
- SvtFileDialogFilter_Impl( const OUString& rName, const OUString& rType );
+ SvtFileDialogFilter_Impl( OUString aName, OUString aType );
~SvtFileDialogFilter_Impl();
const OUString& GetName() const { return m_aName; }
@@ -86,7 +86,7 @@ public:
std::unique_ptr<weld::Menu> xMenu,
SvtFileDialog* pDlg);
- void set_help_id(const OString& rHelpId) { m_xToolbar->set_help_id(rHelpId); }
+ void set_help_id(const OUString& rHelpId) { m_xToolbar->set_help_id(rHelpId); }
void show() { m_xToolbar->show(); }
void FillURLMenu();
@@ -95,8 +95,8 @@ public:
private:
- DECL_LINK(SelectHdl, const OString&, void);
- DECL_LINK(ClickHdl, const OString&, void);
+ DECL_LINK(SelectHdl, const OUString&, void);
+ DECL_LINK(ClickHdl, const OUString&, void);
};
class SvtURLBox;
@@ -185,7 +185,7 @@ public:
SvtFileDialogFilter_Impl* GetSelectedFilterEntry( OUString& rDisplayName ) const
{
rDisplayName = m_xLbFilter->get_active_text();
- return reinterpret_cast<SvtFileDialogFilter_Impl*>(m_xLbFilter->get_active_id().toInt64());
+ return weld::fromId<SvtFileDialogFilter_Impl*>(m_xLbFilter->get_active_id());
}
// access to the current filter via methods only - need to care for consistency between m_pCurFilter and m_sCurrentFilterDisplayName
diff --git a/fpicker/source/win32/VistaFilePicker.cxx b/fpicker/source/win32/VistaFilePicker.cxx
index dbd50307391c..743dcda5d080 100644
--- a/fpicker/source/win32/VistaFilePicker.cxx
+++ b/fpicker/source/win32/VistaFilePicker.cxx
@@ -22,7 +22,6 @@
#include "VistaFilePicker.hxx"
#include "WinImplHelper.hxx"
-#include "shared.hxx"
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
diff --git a/fpicker/source/win32/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/VistaFilePickerEventHandler.cxx
index 97c0c9fbd41e..7c21dcde0392 100644
--- a/fpicker/source/win32/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/VistaFilePickerEventHandler.cxx
@@ -231,8 +231,8 @@ void VistaFilePickerEventHandler::stopListening()
}
}
-const OUStringLiteral PROP_CONTROL_ID = u"control_id";
-const OUStringLiteral PROP_PICKER_LISTENER = u"picker_listener";
+constexpr OUString PROP_CONTROL_ID = u"control_id"_ustr;
+constexpr OUString PROP_PICKER_LISTENER = u"picker_listener"_ustr;
namespace {
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx
index a38e237e2511..a3ee8c9ad3e2 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -32,10 +32,12 @@
#include <com/sun/star/lang/SystemDependent.hpp>
#include <comphelper/sequence.hxx>
#include <fpicker/strings.hrc>
-#include <fpsofficeResMgr.hxx>
+#include <fpicker/fpsofficeResMgr.hxx>
#include <osl/file.hxx>
#include <rtl/process.h>
#include <o3tl/char16_t2wchar_t.hxx>
+#include <o3tl/string_view.hxx>
+#include <vcl/svapp.hxx>
#include "WinImplHelper.hxx"
#include <shlguid.h>
@@ -134,7 +136,7 @@ template <class ComPtrDialog, REFCLSID CLSID> class TDialogImpl : public TDialog
{
public:
TDialogImpl()
- : TDialogImplBase(ComPtrDialog().CoCreateInstance(CLSID).get())
+ : TDialogImplBase(ComPtrDialog(CLSID).get())
{
}
};
@@ -167,55 +169,36 @@ using TFolderPickerDialogImpl = TDialogImpl<TFileOpenDialog, CLSID_FileOpenDialo
static OUString lcl_getURLFromShellItem (IShellItem* pItem)
{
- LPWSTR pStr = nullptr;
- OUString sURL;
- HRESULT hr;
-
- hr = pItem->GetDisplayName ( SIGDN_FILESYSPATH, &pStr );
- if (SUCCEEDED(hr))
- {
- ::osl::FileBase::getFileURLFromSystemPath( OUString(o3tl::toU(pStr)), sURL );
- goto cleanup;
- }
-
- hr = pItem->GetDisplayName ( SIGDN_URL, &pStr );
- if (SUCCEEDED(hr))
- {
- sURL = o3tl::toU(pStr);
- goto cleanup;
- }
-
- hr = pItem->GetDisplayName ( SIGDN_PARENTRELATIVEPARSING, &pStr );
- if (SUCCEEDED(hr))
+ sal::systools::CoTaskMemAllocated<wchar_t> pStr;
+ HRESULT hr = pItem->GetDisplayName(SIGDN_FILESYSPATH, &pStr);
+ if (FAILED(hr))
{
- GUID known_folder_id;
- std::wstring aStr = pStr;
- CoTaskMemFree (pStr);
+ // tdf#155176: One could think that querying SIGDN_URL would go first. But Windows uses
+ // current 8-bit codepage for the filenames, and URL-encodes those octets. So check it
+ // only after SIGDN_FILESYSPATH query failed (can it ever happen?)
+ if (SUCCEEDED(pItem->GetDisplayName(SIGDN_URL, &pStr)))
+ return OUString(o3tl::toU(pStr));
- if (0 == aStr.compare(0, 3, L"::{"))
- aStr = aStr.substr(2);
- hr = IIDFromString(aStr.c_str(), &known_folder_id);
+ hr = pItem->GetDisplayName(SIGDN_PARENTRELATIVEPARSING, &pStr);
if (SUCCEEDED(hr))
{
- hr = SHGetKnownFolderPath(known_folder_id, 0, nullptr, &pStr);
+ GUID known_folder_id;
+ wchar_t* pStr2 = pStr;
+ if (pStr2[0] == ':' && pStr2[1] == ':' && pStr2[2] == '{')
+ pStr2 += 2;
+ hr = IIDFromString(pStr2, &known_folder_id);
if (SUCCEEDED(hr))
- {
- ::osl::FileBase::getFileURLFromSystemPath(OUString(o3tl::toU(pStr)), sURL);
- goto cleanup;
- }
+ hr = SHGetKnownFolderPath(known_folder_id, 0, nullptr, &pStr);
}
}
// Default fallback
- hr = SHGetKnownFolderPath(FOLDERID_Documents, 0, nullptr, &pStr);
+ if (FAILED(hr))
+ hr = SHGetKnownFolderPath(FOLDERID_Documents, 0, nullptr, &pStr);
+
+ OUString sURL;
if (SUCCEEDED(hr))
::osl::FileBase::getFileURLFromSystemPath(OUString(o3tl::toU(pStr)), sURL);
- else // shouldn't happen...
- goto bailout;
-
-cleanup:
- CoTaskMemFree (pStr);
-bailout:
return sURL;
}
@@ -224,7 +207,7 @@ bailout:
static OUString lcl_AdjustFilterName(const OUString& sName)
{
const sal_Int32 idx = sName.indexOf("(.");
- return (idx > 0) ? sName.copy(0, idx).trim() : sName;
+ return (idx > 0) ? OUString(o3tl::trim(sName.subView(0, idx))) : sName;
}
// rvStrings holds the OUStrings, pointers to which data are stored in returned COMDLG_FILTERSPEC
@@ -961,6 +944,9 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(Request& rRequest)
HRESULT hResult = E_FAIL;
try
{
+ // tdf#146007: Make sure we don't hold solar mutex: COM may need to forward
+ // the execution to the main thread, and holding solar mutex could deadlock
+ SolarMutexReleaser r;
// show dialog and wait for user decision
hResult = iDialog->Show(m_hParentWindow ? m_hParentWindow
: choose_parent_window()); // parent window needed
@@ -1129,7 +1115,7 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(Request& rRequest)
if ( SUCCEEDED(hResult) )
{
const OUString& sItem = m_lItems[bValue];
- aValue <<= OUString(sItem.getStr());
+ aValue <<= sItem;
}
}
break;
diff --git a/fpicker/source/win32/VistaFilePickerImpl.hxx b/fpicker/source/win32/VistaFilePickerImpl.hxx
index 78941886e235..8ea9468076ea 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.hxx
@@ -57,26 +57,26 @@ const ::sal_Int32 FEATURE_VERSION = 1024;
const ::sal_Int32 FEATURE_GPGPASSWORD = 2048;
const ::sal_Int32 FEATURE_IMAGEANCHOR = 4096;
-constexpr OUStringLiteral PROP_PICKER_LISTENER(u"picker_listener" ); // [XFilePickerListenert]
-constexpr OUStringLiteral PROP_DIALOG_SHOW_RESULT(u"dialog_show_result" ); // [sal_Bool] true=OK, false=CANCEL
-constexpr OUStringLiteral PROP_SELECTED_FILES(u"selected_files" ); // [seq< OUString >] contains all user selected files (can be empty!)
-constexpr OUStringLiteral PROP_MULTISELECTION_MODE(u"multiselection_mode"); // [sal_Bool] true=ON, false=OFF
-constexpr OUStringLiteral PROP_TITLE(u"title" ); // [OUString]
-constexpr OUStringLiteral PROP_FILENAME(u"filename" ); // [OUString]
-constexpr OUStringLiteral PROP_DIRECTORY(u"directory" ); // [OUString]
-constexpr OUStringLiteral PROP_FEATURES(u"features" ); // [sal_Int32]
-constexpr OUStringLiteral PROP_TEMPLATE_DESCR(u"templatedescription"); // [sal_Int32]
-constexpr OUStringLiteral PROP_FILTER_TITLE(u"filter_title" ); // [OUString]
-constexpr OUStringLiteral PROP_FILTER_VALUE(u"filter_value" ); // [OUString]
-constexpr OUStringLiteral PROP_FILTER_GROUP(u"filter-group" ); // [seq< css:beans::StringPair >] contains a group of filters
-
-constexpr OUStringLiteral PROP_CONTROL_ID(u"control_id" ); // [sal_Int16]
-constexpr OUStringLiteral PROP_CONTROL_ACTION(u"control_action" ); // [sal_Int16]
-constexpr OUStringLiteral PROP_CONTROL_VALUE(u"control_value" ); // [Any]
-constexpr OUStringLiteral PROP_CONTROL_LABEL(u"control_label" ); // [OUString]
-constexpr OUStringLiteral PROP_CONTROL_ENABLE(u"control_enable" ); // [sal_Bool] true=ON, false=OFF
-constexpr OUStringLiteral PROP_PARENT_WINDOW(u"ParentWindow"); //[css::awt::XWindow] preferred parent window
-constexpr OUStringLiteral STRING_SEPARATOR(u"------------------------------------------" );
+inline constexpr OUString PROP_PICKER_LISTENER(u"picker_listener"_ustr ); // [XFilePickerListenert]
+inline constexpr OUString PROP_DIALOG_SHOW_RESULT(u"dialog_show_result"_ustr ); // [sal_Bool] true=OK, false=CANCEL
+inline constexpr OUString PROP_SELECTED_FILES(u"selected_files"_ustr ); // [seq< OUString >] contains all user selected files (can be empty!)
+inline constexpr OUString PROP_MULTISELECTION_MODE(u"multiselection_mode"_ustr); // [sal_Bool] true=ON, false=OFF
+inline constexpr OUString PROP_TITLE(u"title"_ustr ); // [OUString]
+inline constexpr OUString PROP_FILENAME(u"filename"_ustr ); // [OUString]
+inline constexpr OUString PROP_DIRECTORY(u"directory"_ustr ); // [OUString]
+inline constexpr OUString PROP_FEATURES(u"features"_ustr ); // [sal_Int32]
+inline constexpr OUString PROP_TEMPLATE_DESCR(u"templatedescription"_ustr); // [sal_Int32]
+inline constexpr OUString PROP_FILTER_TITLE(u"filter_title"_ustr ); // [OUString]
+inline constexpr OUString PROP_FILTER_VALUE(u"filter_value"_ustr ); // [OUString]
+inline constexpr OUString PROP_FILTER_GROUP(u"filter-group"_ustr ); // [seq< css:beans::StringPair >] contains a group of filters
+
+inline constexpr OUString PROP_CONTROL_ID(u"control_id"_ustr ); // [sal_Int16]
+inline constexpr OUString PROP_CONTROL_ACTION(u"control_action"_ustr ); // [sal_Int16]
+inline constexpr OUString PROP_CONTROL_VALUE(u"control_value"_ustr ); // [Any]
+inline constexpr OUString PROP_CONTROL_LABEL(u"control_label"_ustr ); // [OUString]
+inline constexpr OUString PROP_CONTROL_ENABLE(u"control_enable"_ustr ); // [sal_Bool] true=ON, false=OFF
+inline constexpr OUString PROP_PARENT_WINDOW(u"ParentWindow"_ustr); //[css::awt::XWindow] preferred parent window
+inline constexpr OUString STRING_SEPARATOR(u"------------------------------------------"_ustr );
class TDialogImplBase;
diff --git a/fpicker/source/win32/WinImplHelper.cxx b/fpicker/source/win32/WinImplHelper.cxx
index 5d6e20d92319..9f81f6b60ffc 100644
--- a/fpicker/source/win32/WinImplHelper.cxx
+++ b/fpicker/source/win32/WinImplHelper.cxx
@@ -24,12 +24,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Sequence;
-
const sal_Unicode TILDE_SIGN = L'~';
const sal_Unicode AMPERSAND_SIGN = L'&';
diff --git a/fpicker/source/win32/resourceprovider.cxx b/fpicker/source/win32/resourceprovider.cxx
index ff841b385b26..3515e9432146 100644
--- a/fpicker/source/win32/resourceprovider.cxx
+++ b/fpicker/source/win32/resourceprovider.cxx
@@ -31,7 +31,7 @@
#include <unotools/resmgr.hxx>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include <fpsofficeResMgr.hxx>
+#include <fpicker/fpsofficeResMgr.hxx>
using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
diff --git a/fpicker/source/win32/shared.hxx b/fpicker/source/win32/shared.hxx
deleted file mode 100644
index c47f6411e28b..000000000000
--- a/fpicker/source/win32/shared.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <rtl/ustring.hxx>
-
-const OUStringLiteral BACKSLASH(u"\\");
-const OUStringLiteral FILTER_SEPARATOR(u"------------------------------------------");
-const OUStringLiteral ALL_FILES_WILDCARD(u"*.*");
-const bool ALLOW_DUPLICATES = true;
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/workbench/Test_fps.cxx b/fpicker/source/win32/workbench/Test_fps.cxx
index 899f208f1f61..010a79c3aa55 100644
--- a/fpicker/source/win32/workbench/Test_fps.cxx
+++ b/fpicker/source/win32/workbench/Test_fps.cxx
@@ -78,7 +78,7 @@ void TestFilterManager( Reference< XFilePicker > xFilePicker );
Reference< XMultiServiceFactory > g_xFactory;
-static const OUStringLiteral BMP_EXTENSION( u"bmp" );
+static constexpr OUStringLiteral BMP_EXTENSION( u"bmp" );
// a test client
diff --git a/fpicker/uiconfig/ui/explorerfiledialog.ui b/fpicker/uiconfig/ui/explorerfiledialog.ui
index 28c73f198b16..238760f74d13 100644
--- a/fpicker/uiconfig/ui/explorerfiledialog.ui
+++ b/fpicker/uiconfig/ui/explorerfiledialog.ui
@@ -161,11 +161,10 @@
<child>
<object class="GtkToolbar" id="up_bar">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<child>
<object class="GtkMenuToolButton" id="up_btn">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="icon_name">res/fp010.png</property>
</object>
@@ -294,6 +293,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes" context="explorerfiledialog|add">Add current folder to Places</property>
<property name="image">image1</property>
<property name="always_show_image">True</property>
</object>
@@ -308,6 +308,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes" context="explorerfiledialog|del">Remove selected folder from Places</property>
<property name="image">image2</property>
<property name="always_show_image">True</property>
</object>
@@ -443,18 +444,8 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore2</property>
- <child>
- <object class="GtkCellRendererPixbuf" id="icon"/>
- <attributes>
- <attribute name="pixbuf">0</attribute>
- </attributes>
- </child>
- <child>
- <object class="GtkCellRendererText" id="text"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
+ <property name="pixbuf-column">0</property>
+ <property name="text-column">1</property>
</object>
</child>
</object>