summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/bitmaps.hlst3
-rw-r--r--sfx2/inc/sorgitm.hxx1
-rw-r--r--sfx2/qa/cppunit/doc.cxx4
-rw-r--r--sfx2/source/appl/appcfg.cxx2
-rw-r--r--sfx2/source/appl/shutdownicon.cxx9
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm382
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx2
-rw-r--r--sfx2/source/control/minfitem.cxx2
-rw-r--r--sfx2/source/control/sorgitm.cxx2
-rw-r--r--sfx2/source/dialog/backingcomp.cxx10
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/dialog/passwd.cxx91
-rw-r--r--sfx2/source/dialog/tabdlg.cxx2
-rw-r--r--sfx2/source/dialog/templdlg.cxx7
-rw-r--r--sfx2/source/dialog/tplpitem.cxx2
-rw-r--r--sfx2/source/doc/objitem.cxx2
-rw-r--r--sfx2/source/doc/objserv.cxx74
-rw-r--r--sfx2/source/doc/objstor.cxx43
-rw-r--r--sfx2/source/doc/watermarkitem.cxx2
-rw-r--r--sfx2/source/doc/zoomitem.cxx2
-rw-r--r--sfx2/source/inc/shutdownicon.hxx (renamed from sfx2/source/appl/shutdownicon.hxx)7
-rw-r--r--sfx2/source/sidebar/ResourceManager.cxx8
-rw-r--r--sfx2/source/view/frame.cxx10
-rw-r--r--sfx2/source/view/lokhelper.cxx10
-rw-r--r--sfx2/uiconfig/ui/licensedialog.ui2
-rw-r--r--sfx2/uiconfig/ui/password.ui298
-rw-r--r--sfx2/uiconfig/ui/templatepanel.ui6
27 files changed, 807 insertions, 178 deletions
diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index 04169c38d2db..8d085bdb855b 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -97,4 +97,7 @@ inline constexpr OUString BMP_MENU_EXPORT = u"cmd/sc_exportto.png"_ustr;
inline constexpr OUString BMP_DONATE = u"res/donate.png"_ustr;
+inline constexpr OUString RID_SVXBMP_HIDEPASS = u"res/hidepass.png"_ustr;
+inline constexpr OUString RID_SVXBMP_SHOWPASS = u"res/showpass.png"_ustr;
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx
index 3dc6ea8193d6..571e9e1b9c32 100644
--- a/sfx2/inc/sorgitm.hxx
+++ b/sfx2/inc/sorgitm.hxx
@@ -31,6 +31,7 @@ private:
public:
static SfxPoolItem* CreateDefault();
+ DECLARE_ITEM_TYPE_FUNCTION(SfxScriptOrganizerItem)
SfxScriptOrganizerItem();
virtual SfxScriptOrganizerItem* Clone( SfxItemPool* pPool = nullptr ) const override;
diff --git a/sfx2/qa/cppunit/doc.cxx b/sfx2/qa/cppunit/doc.cxx
index b16c078ef412..87b9d13a1ed4 100644
--- a/sfx2/qa/cppunit/doc.cxx
+++ b/sfx2/qa/cppunit/doc.cxx
@@ -140,8 +140,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSetDocumentPropertiesUpdate)
// - Actual : foo
// i.e. ZOTERO_PREF_1 was not updated.
CPPUNIT_ASSERT_EQUAL(u"test"_ustr, it->second.get<OUString>());
- CPPUNIT_ASSERT(bool(aMap.find(u"ZOTERO_PREF_2"_ustr) == aMap.end()));
- CPPUNIT_ASSERT(aMap.find(u"OTHER"_ustr) != aMap.end());
+ CPPUNIT_ASSERT(!aMap.contains(u"ZOTERO_PREF_2"_ustr));
+ CPPUNIT_ASSERT(aMap.contains(u"OTHER"_ustr));
}
}
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 074ad93b6f74..ba200d4d5368 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -49,7 +49,7 @@
#include <sfx2/objsh.hxx>
#include <comphelper/lok.hxx>
#include <objshimp.hxx>
-#include "shutdownicon.hxx"
+#include <shutdownicon.hxx>
using namespace ::com::sun::star::uno;
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index b16be15bcf70..ca15df227465 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -20,7 +20,7 @@
#include <sal/config.h>
#include <sal/log.hxx>
-#include "shutdownicon.hxx"
+#include <shutdownicon.hxx>
#include <sfx2/strings.hrc>
#include <sfx2/app.hxx>
#include <svtools/imagemgr.hxx>
@@ -204,6 +204,11 @@ void ShutdownIcon::FileOpen()
void ShutdownIcon::FromTemplate()
{
+ ShutdownIcon::FromCommand( ".uno:NewDoc" );
+}
+
+void ShutdownIcon::FromCommand( const OUString& rCommand )
+{
if ( !getInstance() || !getInstance()->m_xDesktop.is() )
return;
@@ -213,7 +218,7 @@ void ShutdownIcon::FromTemplate()
xFrame = xDesktop;
URL aTargetURL;
- aTargetURL.Complete = ".uno:NewDoc";
+ aTargetURL.Complete = rCommand;
css::uno::Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 6b519fcefbe9..9e037fe5726e 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -21,6 +21,7 @@
#include <unotools/moduleoptions.hxx>
#include <unotools/dynamicmenuoptions.hxx>
#include <unotools/historyoptions.hxx>
+#include <officecfg/Office/Common.hxx>
#include <rtl/ustring.hxx>
#include <tools/urlobj.hxx>
#include <osl/file.h>
@@ -31,7 +32,10 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/strings.hrc>
#include <vcl/svapp.hxx>
-#include "shutdownicon.hxx"
+#include <vcl/mnemonic.hxx>
+#include <vcl/image.hxx>
+#include <svtools/imagemgr.hxx>
+#include <shutdownicon.hxx>
#include <com/sun/star/util/XStringWidth.hpp>
@@ -55,6 +59,8 @@
#define MI_TEMPLATE 8
#define MI_STARTMODULE 9
+#define UNO_TOGGLECURRENTMODULE_COMMAND ".uno:ToggleCurrentModule"
+
@interface QSMenuExecute : NSObject
{
}
@@ -65,6 +71,8 @@
@implementation QSMenuExecute
-(void)executeMenuItem: (NSMenuItem*)pItem
{
+ SolarMutexGuard aGuard;
+
switch( [pItem tag] )
{
case MI_OPEN:
@@ -102,6 +110,9 @@
-(void)dockIconClicked: (NSObject*)pSender
{
(void)pSender;
+
+ SolarMutexGuard aGuard;
+
// start module
ShutdownIcon::OpenURL( STARTMODULE_URL, "_default" );
}
@@ -113,6 +124,7 @@ bool ShutdownIcon::IsQuickstarterInstalled()
return true;
}
+static NSArray<NSMenuItem*>* pPreferredMenus = nil;
static NSMenuItem* pDefMenu = nil, *pDockSubMenu = nil;
static QSMenuExecute* pExecute = nil;
@@ -147,6 +159,63 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin
}
+@interface QSCommandMenuItem : NSMenuItem
+{
+ OUString m_aCommand;
+}
+-(void)menuItemTriggered: (id)aSender;
+-(void)setCommand: (OUString)aCommand;
+@end
+
+@implementation QSCommandMenuItem
+
+-(void)menuItemTriggered: (id)aSender
+{
+ if ( m_aCommand.isEmpty() )
+ return;
+
+ SolarMutexGuard aGuard;
+
+ if ( m_aCommand == "vnd.org.libreoffice.recentdocs:ClearRecentFileList" )
+ {
+ // Clearing the recent file list requires an extra step
+ SvtHistoryOptions::Clear( EHistoryType::PickList, false );
+ }
+ else if ( m_aCommand == ".uno:Open" )
+ {
+ ShutdownIcon::FileOpen();
+ return;
+ }
+ else if ( m_aCommand == ".uno:ConfigureDialog" )
+ {
+ // Selecting some menu items will cause a crash if there are
+ // no visibile windows
+ ShutdownIcon::OpenURL( STARTMODULE_URL, "_default" );
+ }
+ else if ( m_aCommand == UNO_TOGGLECURRENTMODULE_COMMAND )
+ {
+ bool bIsExclusive = officecfg::Office::Common::History::ShowCurrentModuleOnly::get();
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::History::ShowCurrentModuleOnly::set(!bIsExclusive, batch);
+ batch->commit();
+ [self setState: bIsExclusive ? NSControlStateValueOff : NSControlStateValueOn];
+ return;
+ }
+
+ // "private:" commands are used for menu items in the File > New menu
+ if ( m_aCommand.startsWith( "private:" ) || m_aCommand == STARTMODULE_URL )
+ ShutdownIcon::OpenURL( m_aCommand, "_default" );
+ else
+ ShutdownIcon::FromCommand( m_aCommand );
+}
+
+-(void)setCommand: (OUString)aCommand
+{
+ m_aCommand = aCommand;
+}
+
+@end
+
@interface RecentMenuDelegate : NSObject <NSMenuDelegate>
{
std::vector< RecentMenuEntry >* m_pRecentFilesItems;
@@ -175,6 +244,8 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin
-(void)menuNeedsUpdate:(NSMenu *)menu
{
+ SolarMutexGuard aGuard;
+
// clear menu
int nItems = [menu numberOfItems];
while( nItems -- )
@@ -202,38 +273,114 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin
// insert new recent items
for ( std::vector<RecentMenuEntry>::size_type i = 0; i < m_pRecentFilesItems->size(); i++ )
{
+ OUStringBuffer aMenuShortCut;
+ if ( i <= 9 )
+ {
+ if ( i == 9 )
+ aMenuShortCut.append( "1~0. " );
+ else
+ {
+ aMenuShortCut.append( "~N. " );
+ aMenuShortCut[ 1 ] = sal_Unicode( i + '1' );
+ }
+ }
+ else
+ {
+ aMenuShortCut.append( OUString::number(sal_Int32( i + 1 ) ) + ". " );
+ }
+
OUString aMenuTitle;
INetURLObject aURL( (*m_pRecentFilesItems)[i].aURL );
+ NSImage *pImage = nil;
if ( aURL.GetProtocol() == INetProtocol::File )
{
- // Do handle file URL differently => convert it to a system
- // path and abbreviate it with a special function:
- OUString aSystemPath( aURL.getFSysPath( FSysStyle::Detect ) );
- OUString aCompactedSystemPath;
-
- oslFileError nError = osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, 46, nullptr );
- if ( !nError )
- aMenuTitle = aCompactedSystemPath;
- else
- aMenuTitle = aSystemPath;
+ // Do handle file URL differently: don't show the protocol,
+ // just the file name
+ aMenuTitle = aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
+
+ if ( [NSApp respondsToSelector: @selector(createNSImage:)] )
+ {
+ BitmapEx aThumbnail(SvFileInformationManager::GetFileImageId(aURL));
+ Size aBmpSize = aThumbnail.GetSizePixel();
+ if ( aBmpSize.Width() > 0 && aBmpSize.Height() > 0 )
+ {
+ Image aImage( aThumbnail );
+ NSValue *pImageValue = [NSValue valueWithPointer: &aImage];
+ pImage = [NSApp performSelector: @selector(createNSImage:) withObject: pImageValue];
+ }
+ }
}
else
{
- // Use INetURLObject to abbreviate all other URLs
- css::uno::Reference< css::util::XStringWidth > xStringLength( new RecentFilesStringLength() );
- aMenuTitle = aURL.getAbbreviated( xStringLength, 46, INetURLObject::DecodeMechanism::Unambiguous );
+ // In all other URLs show the protocol name before the file name
+ aMenuTitle = INetURLObject::GetSchemeName(aURL.GetProtocol()) + ": " + aURL.getName();
}
+ aMenuShortCut.append( aMenuTitle );
+ aMenuTitle = MnemonicGenerator::EraseAllMnemonicChars( aMenuShortCut.makeStringAndClear() );
+ if ( aMenuTitle.isEmpty() )
+ continue;
+
+ if ( aMenuTitle.endsWith( "...", &aMenuTitle ) )
+ aMenuTitle += u"\u2026";
+
NSMenuItem* pNewItem = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( aMenuTitle )
action: @selector(executeRecentEntry:)
keyEquivalent: @""];
[pNewItem setTag: i];
[pNewItem setTarget: self];
[pNewItem setEnabled: YES];
+ if ( pImage )
+ {
+ [pNewItem setImage: pImage];
+ [pImage release];
+ }
[menu addItem: pNewItem];
[pNewItem autorelease];
}
+
+ if ( [menu numberOfItems] )
+ {
+ TranslateId aId( "STR_CLEAR_RECENT_FILES", "Clear List" );
+ OUString aClearList = Translate::get( aId, Translate::Create("fwk") );
+ if ( !aClearList.isEmpty() )
+ {
+ [menu addItem: [NSMenuItem separatorItem]];
+
+ QSCommandMenuItem* pNewItem = [[QSCommandMenuItem alloc] initWithTitle: getAutoreleasedString( aClearList ) action: @selector(menuItemTriggered:) keyEquivalent: @""];
+ [pNewItem setCommand: "vnd.org.libreoffice.recentdocs:ClearRecentFileList"];
+ [pNewItem setTarget: pNewItem];
+ [pNewItem setEnabled: YES];
+ [menu addItem: pNewItem];
+ [pNewItem autorelease];
+
+ aId = TranslateId( "STR_TOGGLECURRENTMODULE", "Current Module Only" );
+ OUString aToggleCurrentMode = Translate::get( aId, Translate::Create("fwk") );
+ if ( !aToggleCurrentMode.isEmpty() )
+ {
+ pNewItem = [[QSCommandMenuItem alloc] initWithTitle: getAutoreleasedString( aToggleCurrentMode ) action: @selector(menuItemTriggered:) keyEquivalent: @""];
+ [pNewItem setCommand: UNO_TOGGLECURRENTMODULE_COMMAND];
+ [pNewItem setTarget: pNewItem];
+ [pNewItem setState: officecfg::Office::Common::History::ShowCurrentModuleOnly::get() ? NSControlStateValueOn : NSControlStateValueOff];
+ [pNewItem setEnabled: YES];
+ [menu addItem: pNewItem];
+ [pNewItem autorelease];
+ }
+ }
+ }
+ else
+ {
+ TranslateId aId( "STR_NODOCUMENT", "No Documents" );
+ OUString aNoDocuments = Translate::get( aId, Translate::Create("fwk") );
+ if ( !aNoDocuments.isEmpty() )
+ {
+ NSMenuItem* pNewItem = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( aNoDocuments ) action: nil keyEquivalent: @""];
+ [pNewItem setEnabled: YES];
+ [menu addItem: pNewItem];
+ [pNewItem autorelease];
+ }
+ }
}
-(void)executeRecentEntry: (NSMenuItem*)item
@@ -311,6 +458,7 @@ static void appendMenuItem( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUString
[pItem setTarget: pExecute];
[pItem setEnabled: YES];
[i_pMenu addItem: pItem];
+ [pItem autorelease];
if( i_pDockMenu )
{
@@ -323,6 +471,7 @@ static void appendMenuItem( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUString
[pItem setTarget: pExecute];
[pItem setEnabled: YES];
[i_pDockMenu addItem: pItem];
+ [pItem autorelease];
}
}
@@ -344,6 +493,206 @@ static void appendRecentMenu( NSMenu* i_pMenu, const OUString& i_rTitle )
[pItem setSubmenu: pRecentMenu];
}
+void setKeyEquivalent( const vcl::KeyCode &rKeyCode, NSMenuItem *pNSMenuItem )
+{
+ if ( !pNSMenuItem )
+ return;
+
+ sal_uInt16 nKeyCode = rKeyCode.GetCode();
+ if ( !nKeyCode )
+ return;
+
+ sal_Unicode nCommandKey = 0;
+ if ((nKeyCode>=KEY_A) && (nKeyCode<=KEY_Z)) // letter A..Z
+ nCommandKey = nKeyCode - KEY_A + 'a';
+ else if ((nKeyCode>=KEY_0) && (nKeyCode<=KEY_9)) // numbers 0..9
+ nCommandKey = nKeyCode - KEY_0 + '0';
+ else if ((nKeyCode>=KEY_F1) && (nKeyCode<=KEY_F26)) // function keys F1..F26
+ nCommandKey = nKeyCode - KEY_F1 + NSF1FunctionKey;
+
+ if ( !nCommandKey )
+ return;
+
+ sal_uInt16 nModifier = rKeyCode.GetModifier();
+ int nItemModifier = 0;
+
+ if ( nModifier & KEY_SHIFT )
+ {
+ nItemModifier |= NSEventModifierFlagShift; // actually useful only for function keys
+ if ( nKeyCode >= KEY_A && nKeyCode <= KEY_Z )
+ nCommandKey = nKeyCode - KEY_A + 'A';
+ }
+
+ if ( nModifier & KEY_MOD1 )
+ nItemModifier |= NSEventModifierFlagCommand;
+
+ if ( nModifier & KEY_MOD2 )
+ nItemModifier |= NSEventModifierFlagOption;
+
+ if ( nModifier & KEY_MOD3 )
+ nItemModifier |= NSEventModifierFlagControl;
+
+ OUString aCommandKey( &nCommandKey, 1 );
+ NSString *pCommandKey = [NSString stringWithCharacters: reinterpret_cast< unichar const* >(aCommandKey.getStr()) length: aCommandKey.getLength()];
+ [pNSMenuItem setKeyEquivalent: pCommandKey];
+ [pNSMenuItem setKeyEquivalentModifierMask: nItemModifier];
+}
+
+static NSMenu *getNSMenuForVCLMenu( Menu *pMenu )
+{
+ NSMenu *pRet = nil;
+
+ if ( !pMenu )
+ return pRet;
+
+ pMenu->Activate();
+
+ sal_uInt16 nItemCount = pMenu->GetItemCount();
+ if ( nItemCount )
+ {
+ pRet = [[[NSMenu alloc] initWithTitle: @""] autorelease];
+ [pRet setAutoenablesItems: NO];
+ for ( sal_uInt16 i = 0; i < nItemCount; i++ )
+ {
+ sal_uInt16 nId = pMenu->GetItemId( i );
+ if ( nId && pMenu->IsItemEnabled( nId ) )
+ {
+ OUString aText = MnemonicGenerator::EraseAllMnemonicChars( pMenu->GetItemText( nId ) );
+ if ( aText.isEmpty() )
+ continue;
+
+ if ( aText.endsWith( "...", &aText ) )
+ aText += u"\u2026";
+
+ // Use a custom menu in place of the Start Center's recent
+ // documents menu so that the list can be dynamically updated
+ OUString aCommand = pMenu->GetItemCommand( nId );
+ if ( aCommand == ".uno:RecentFileList" )
+ {
+ appendRecentMenu( pRet, aText );
+ continue;
+ }
+
+ NSString *pText = getAutoreleasedString( aText );
+ // TODO: use the QSMenuExecute class to connect the command
+ // string to one of the existing handler functions
+ QSCommandMenuItem *pNSMenuItem = [[QSCommandMenuItem alloc] initWithTitle: pText action: @selector(menuItemTriggered:) keyEquivalent: @""];
+ NSMenu *pNSSubmenu = getNSMenuForVCLMenu( pMenu->GetPopupMenu( nId ) );
+ if ( pNSSubmenu && [pNSSubmenu numberOfItems] )
+ {
+ [pNSSubmenu setTitle: pText];
+ [pNSMenuItem setSubmenu: pNSSubmenu];
+
+ if ( aCommand == ".uno:AddDirect" )
+ {
+ SvtModuleOptions aModuleOptions;
+ if ( aModuleOptions.IsModuleInstalled( SvtModuleOptions::EModule::STARTMODULE ) )
+ {
+ QSCommandMenuItem *pStartModuleMenuItem = [[QSCommandMenuItem alloc] initWithTitle: getAutoreleasedString( SfxResId( STR_QUICKSTART_STARTCENTER ) ) action: @selector(menuItemTriggered:) keyEquivalent: @"n"];
+ [pStartModuleMenuItem setTarget: pStartModuleMenuItem];
+ [pStartModuleMenuItem setCommand: STARTMODULE_URL];
+ [pNSSubmenu insertItem: pStartModuleMenuItem atIndex: 0];
+ [pStartModuleMenuItem autorelease];
+ }
+ }
+ }
+ else if ( !aCommand.isEmpty() )
+ {
+ [pNSMenuItem setTarget: pNSMenuItem];
+ [pNSMenuItem setCommand: aCommand];
+
+ // Use the default menu's special "open new file" shortcuts
+ if ( aCommand == WRITER_URL )
+ [pNSMenuItem setKeyEquivalent: @"t"];
+ else if ( aCommand == CALC_URL )
+ [pNSMenuItem setKeyEquivalent: @"s"];
+ else if ( aCommand == IMPRESS_WIZARD_URL )
+ [pNSMenuItem setKeyEquivalent: @"p"];
+ else if ( aCommand == DRAW_URL )
+ [pNSMenuItem setKeyEquivalent: @"d"];
+ else if ( aCommand == MATH_URL )
+ [pNSMenuItem setKeyEquivalent: @"f"];
+ else if ( aCommand == BASE_URL )
+ [pNSMenuItem setKeyEquivalent: @"a"];
+ else
+ setKeyEquivalent( pMenu->GetAccelKey( nId ), pNSMenuItem );
+ }
+
+ [pRet addItem: pNSMenuItem];
+ [pNSMenuItem autorelease];
+ }
+ else if ( pMenu->GetItemType( i ) == MenuItemType::SEPARATOR )
+ {
+ [pRet addItem: [NSMenuItem separatorItem]];
+ }
+ }
+ }
+
+ pMenu->Deactivate();
+
+ return pRet;
+}
+
+static void clearDefaultMenuBar()
+{
+ if( ![NSApp respondsToSelector: @selector(removeFallbackMenuItem:)] )
+ return;
+
+ // Remove previous default menu
+ if ( pDefMenu )
+ [NSApp performSelector:@selector(removeFallbackMenuItem:) withObject: pDefMenu];
+
+ // Remove previous preferred menu
+ if ( pPreferredMenus && [pPreferredMenus count] )
+ {
+ for ( NSMenuItem *pNSMenuItem in pPreferredMenus )
+ [NSApp performSelector:@selector(removeFallbackMenuItem:) withObject: pNSMenuItem];
+ }
+}
+
+static void resetMenuBar()
+{
+ if( ![NSApp respondsToSelector: @selector(addFallbackMenuItem:)] )
+ return;
+
+ clearDefaultMenuBar();
+
+ if ( pPreferredMenus && [pPreferredMenus count] )
+ {
+ for ( NSMenuItem *pNSMenuItem in pPreferredMenus )
+ [NSApp performSelector:@selector(addFallbackMenuItem:) withObject: pNSMenuItem];
+ }
+ else if ( pDefMenu )
+ {
+ [NSApp performSelector:@selector(addFallbackMenuItem:) withObject: pDefMenu];
+ }
+}
+
+void ShutdownIcon::SetDefaultMenuBar( MenuBar *pMenuBar )
+{
+ if ( !pMenuBar )
+ return;
+
+ SolarMutexGuard aGuard;
+
+ clearDefaultMenuBar();
+ if ( pPreferredMenus )
+ {
+ [pPreferredMenus release];
+ pPreferredMenus = nil;
+ }
+
+ NSMenu *pNSMenu = getNSMenuForVCLMenu( pMenuBar );
+ if ( pNSMenu && [pNSMenu numberOfItems] )
+ {
+ pPreferredMenus = [NSMutableArray arrayWithArray: [pNSMenu itemArray]];
+ [pNSMenu removeAllItems];
+ [pPreferredMenus retain];
+ }
+
+ resetMenuBar();
+}
+
extern "C"
{
@@ -444,7 +793,7 @@ void aqua_init_systray()
appendMenuItem( pMenu, pDockMenu, aTitle, MI_OPEN, aKeyEquiv );
[pDefMenu setSubmenu: pMenu];
- [NSApp performSelector:@selector(addFallbackMenuItem:) withObject: pDefMenu];
+ resetMenuBar();
if( [NSApp respondsToSelector: @selector(addDockMenuItem:)] )
{
@@ -454,6 +803,9 @@ void aqua_init_systray()
}
else
OSL_FAIL( "addDockMenuItem selector failed on NSApp" );
+
+ [pMenu autorelease];
+ [pDockMenu autorelease];
}
else
OSL_FAIL( "addFallbackMenuItem selector failed on NSApp" );
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index 5d4c89307baf..409ba80bbf2c 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -25,7 +25,7 @@
#undef WB_LEFT
#undef WB_RIGHT
-#include "shutdownicon.hxx"
+#include <shutdownicon.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/strings.hrc>
#include <shlobj.h>
diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx
index 765eada62029..b0bd034e20b5 100644
--- a/sfx2/source/control/minfitem.cxx
+++ b/sfx2/source/control/minfitem.cxx
@@ -35,7 +35,7 @@ SfxMacroInfoItem::SfxMacroInfoItem(
OUString _aMethodName,
OUString _aComment,
OUString _aLocationName) :
- SfxPoolItem(nWhichId, SfxItemType::SfxMacroInfoItemType),
+ SfxPoolItem(nWhichId),
pBasicManager(pMgr),
aLibName(std::move(_aLibName)),
aModuleName(std::move(_aModuleName)),
diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx
index 39280e71dfb8..d4e385ea0cf2 100644
--- a/sfx2/source/control/sorgitm.cxx
+++ b/sfx2/source/control/sorgitm.cxx
@@ -26,7 +26,7 @@
SfxPoolItem* SfxScriptOrganizerItem::CreateDefault() { return new SfxScriptOrganizerItem; }
-SfxScriptOrganizerItem::SfxScriptOrganizerItem() : SfxPoolItem(0, SfxItemType::SfxScriptOrganizerItemType)
+SfxScriptOrganizerItem::SfxScriptOrganizerItem() : SfxPoolItem(0)
{
}
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index 668b4e00934f..2992cb3890e5 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -45,6 +45,10 @@
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
+#ifdef MACOSX
+#include <shutdownicon.hxx>
+#endif
+
namespace {
/**
@@ -396,6 +400,12 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
pBack->get_width_request(),
pBack->get_height_request() + nMenuHeight));
+#ifdef MACOSX
+ SystemWindow *pSysWin = static_cast<SystemWindow*>(pParent.get());
+ if (pSysWin)
+ ShutdownIcon::SetDefaultMenuBar(pSysWin->GetMenuBar());
+#endif
+
/* } SAFE */
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 598593e0888c..7dd0e642a34d 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -192,7 +192,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& rFile,
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
const uno::Sequence<document::CmisProperty>& i_cmisProps,
bool bIs, bool _bIs, sal_Int64 _nFileSize )
- : SfxStringItem( SID_DOCINFO, rFile, SfxItemType::SfxDocumentInfoItemType )
+ : SfxStringItem( SID_DOCINFO, rFile )
, m_AutoloadDelay( i_xDocProps->getAutoloadSecs() )
, m_AutoloadURL( i_xDocProps->getAutoloadURL() )
, m_isAutoloadEnabled( (m_AutoloadDelay > 0) || !m_AutoloadURL.isEmpty() )
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 79bb50a51276..6222885f7bb5 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -25,6 +25,7 @@
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
+#include <bitmaps.hlst>
IMPL_LINK_NOARG(SfxPasswordDialog, EditModifyHdl, weld::Entry&, void)
{
@@ -96,6 +97,12 @@ IMPL_LINK(SfxPasswordDialog, InsertTextHdl, OUString&, rTest, bool)
// discarded
m_xOnlyAsciiFT->set_label_type(weld::LabelType::Warning);
}
+ else
+ {
+ // tdf#161412: downgrade from "Warning" to "Normal" if a valid
+ // letter was discarded after an invalid letter.
+ m_xOnlyAsciiFT->set_label_type(weld::LabelType::Normal);
+ }
return true;
}
@@ -138,6 +145,74 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, weld::Button&, void)
m_xDialog->response(RET_OK);
}
+IMPL_LINK(SfxPasswordDialog, ShowHdl, weld::Toggleable&, rToggleable, void)
+{
+ bool bChecked = rToggleable.get_active();
+ if (&rToggleable == m_xPass[0].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[0]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xPassword1ED->set_visibility(true);
+ m_xPassword1ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[0]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xPassword1ED->set_visibility(false);
+ m_xPassword1ED->grab_focus();
+ }
+ }
+ else if (&rToggleable == m_xPass[1].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[1]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xConfirm1ED->set_visibility(true);
+ m_xConfirm1ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[1]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xConfirm1ED->set_visibility(false);
+ m_xConfirm1ED->grab_focus();
+ }
+ }
+ else if (&rToggleable == m_xPass[2].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[2]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xPassword2ED->set_visibility(true);
+ m_xPassword2ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[2]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xPassword2ED->set_visibility(false);
+ m_xPassword2ED->grab_focus();
+ }
+ }
+ else if (&rToggleable == m_xPass[3].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[3]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xConfirm2ED->set_visibility(true);
+ m_xConfirm2ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[3]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xConfirm2ED->set_visibility(false);
+ m_xConfirm2ED->grab_focus();
+ }
+ }
+ else {
+ // should not reach it
+ }
+}
+
// CTOR / DTOR -----------------------------------------------------------
SfxPasswordDialog::SfxPasswordDialog(weld::Widget* pParent, const OUString* pGroupText)
@@ -179,6 +254,22 @@ SfxPasswordDialog::SfxPasswordDialog(weld::Widget* pParent, const OUString* pGro
m_xConfirm2ED->connect_insert_text(aLink2);
m_xOKBtn->connect_clicked(LINK(this, SfxPasswordDialog, OKHdl));
+ m_xPass[0] = m_xBuilder->weld_toggle_button(u"togglebt1"_ustr);
+ m_xPass[1] = m_xBuilder->weld_toggle_button(u"togglebt2"_ustr);
+ m_xPass[2] = m_xBuilder->weld_toggle_button(u"togglebt3"_ustr);
+ m_xPass[3] = m_xBuilder->weld_toggle_button(u"togglebt4"_ustr);
+
+ Link<weld::Toggleable&, void> aToggleLink = LINK(this, SfxPasswordDialog, ShowHdl);
+
+ for (auto& aPass : m_xPass)
+ {
+ if (aPass->get_active())
+ aPass->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ else
+ aPass->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ aPass->connect_toggled(aToggleLink);
+ }
+
if(moPasswordPolicy)
{
m_xPassword1PolicyLabel->set_label(
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 331414c4c784..5e75ad64bc57 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -81,7 +81,7 @@ SfxTabDialogItem::SfxTabDialogItem( const SfxTabDialogItem& rAttr, SfxItemPool*
}
SfxTabDialogItem::SfxTabDialogItem( sal_uInt16 nId, const SfxItemSet& rItemSet )
- : SfxSetItem( nId, rItemSet, SfxItemType::SfxTabDialogItemType )
+ : SfxSetItem( nId, rItemSet )
{
}
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 6acd68b51675..b26123129f88 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -34,6 +34,7 @@
#include <sal/log.hxx>
#include <osl/diagnose.h>
#include <comphelper/diagnose_ex.hxx>
+#include <comphelper/lok.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/bindings.hxx>
@@ -255,6 +256,8 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl(SfxBindings* pB, weld
{
mxFilterLb->set_help_id(HID_TEMPLATE_FILTER);
mxPreviewCheckbox->set_active(officecfg::Office::Common::StylesAndFormatting::Preview::get());
+ if (comphelper::LibreOfficeKit::isActive())
+ mxPreviewCheckbox->hide();
}
void SfxTemplateDialog_Impl::EnableEdit(bool bEnable, StyleList* rStyleList)
@@ -812,6 +815,10 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanel
m_xToolMenu->connect_activate(LINK(this, SfxTemplateDialog_Impl, ToolMenuSelectHdl));
m_xActionTbR->set_item_help_id(u"update"_ustr, HID_TEMPLDLG_UPDATEBYEXAMPLE);
+ // Features not working in LOK yet
+ if (comphelper::LibreOfficeKit::isActive())
+ m_xActionTbR->hide();
+
Initialize();
}
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
index b9748407f82e..a453323bbb80 100644
--- a/sfx2/source/dialog/tplpitem.cxx
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -33,7 +33,7 @@ SfxTemplateItem::SfxTemplateItem
sal_uInt16 nWhichId, // Slot-ID
OUString _aStyle, // Name of the current Styles
OUString _aStyleIdentifier // Prog Name of current Style
-) : SfxFlagItem( nWhichId, static_cast<sal_uInt16>(SfxStyleSearchBits::All), SfxItemType::SfxTemplateItemType ),
+) : SfxFlagItem( nWhichId, static_cast<sal_uInt16>(SfxStyleSearchBits::All) ),
aStyle(std::move( _aStyle )),
aStyleIdentifier(std::move( _aStyleIdentifier ))
{
diff --git a/sfx2/source/doc/objitem.cxx b/sfx2/source/doc/objitem.cxx
index 47c721046225..e776e6608788 100644
--- a/sfx2/source/doc/objitem.cxx
+++ b/sfx2/source/doc/objitem.cxx
@@ -69,7 +69,7 @@ bool SfxObjectShellItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMembe
}
SfxObjectItem::SfxObjectItem( sal_uInt16 nWhichId, SfxShell *pSh )
-: SfxPoolItem( nWhichId, SfxItemType::SfxObjectItemType ),
+: SfxPoolItem( nWhichId ),
_pSh( pSh )
{}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 25a541691921..674afcbad1d2 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -430,27 +430,30 @@ bool SfxObjectShell::IsSignPDF() const
return false;
}
-uno::Reference<security::XCertificate> SfxObjectShell::GetSignPDFCertificate() const
+namespace
+{
+uno::Reference<beans::XPropertySet> GetSelectedShapeOfModel(const uno::Reference<frame::XModel>& xModel)
{
- uno::Reference<frame::XModel> xModel = GetBaseModel();
if (!xModel.is())
{
- return uno::Reference<security::XCertificate>();
+ return uno::Reference<beans::XPropertySet>();
}
uno::Reference<drawing::XShapes> xShapes(xModel->getCurrentSelection(), uno::UNO_QUERY);
if (!xShapes.is() || xShapes->getCount() < 1)
{
- return uno::Reference<security::XCertificate>();
+ return uno::Reference<beans::XPropertySet>();
}
uno::Reference<beans::XPropertySet> xShapeProps(xShapes->getByIndex(0), uno::UNO_QUERY);
- if (!xShapeProps.is())
- {
- return uno::Reference<security::XCertificate>();
- }
+ return xShapeProps;
+}
+}
- if (!xShapeProps->getPropertySetInfo()->hasPropertyByName(u"InteropGrabBag"_ustr))
+uno::Reference<security::XCertificate> SfxObjectShell::GetSignPDFCertificate() const
+{
+ uno::Reference<beans::XPropertySet> xShapeProps = GetSelectedShapeOfModel(GetBaseModel());
+ if (!xShapeProps.is() || !xShapeProps->getPropertySetInfo()->hasPropertyByName(u"InteropGrabBag"_ustr))
{
return uno::Reference<security::XCertificate>();
}
@@ -465,6 +468,27 @@ uno::Reference<security::XCertificate> SfxObjectShell::GetSignPDFCertificate() c
return uno::Reference<security::XCertificate>(it->second, uno::UNO_QUERY);
}
+void SfxObjectShell::ResetSignPDFCertificate()
+{
+ uno::Reference<beans::XPropertySet> xShapeProps = GetSelectedShapeOfModel(GetBaseModel());
+ if (!xShapeProps->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
+ {
+ return;
+ }
+
+ comphelper::SequenceAsHashMap aMap(xShapeProps->getPropertyValue("InteropGrabBag"));
+ auto it = aMap.find("SignatureCertificate");
+ if (it == aMap.end())
+ {
+ return;
+ }
+
+ aMap.erase(it);
+ xShapeProps->setPropertyValue("InteropGrabBag", uno::Any(aMap.getAsConstPropertyValueList()));
+ // The shape's property is now reset, so the doc model is no longer modified.
+ SetModified(false);
+}
+
static void sendErrorToLOK(const ErrCodeMsg& error)
{
if (error.GetCode().GetClass() == ErrCodeClass::NONE)
@@ -585,26 +609,15 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
aSigningContext.m_xCertificate = std::move(xCertificate);
bHaveWeSigned |= SignDocumentContentUsingCertificate(aSigningContext);
- // Reload to show how the PDF actually looks like after signing. This also
- // changes "finish signing" on the infobar back to "sign document" as a side
- // effect.
+ // Reset the picked certificate for PDF signing, then recheck signatures to show how
+ // the PDF actually looks like after signing. Also change the "finish signing" on
+ // the infobar back to "sign document".
if (SfxViewFrame* pFrame = GetFrame())
{
- // Store current page before reload.
- SfxAllItemSet aSet(SfxGetpApp()->GetPool());
- uno::Reference<drawing::XDrawView> xController(
- GetBaseModel()->getCurrentController(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPage(xController->getCurrentPage(),
- uno::UNO_QUERY);
- sal_Int32 nPage{};
- xPage->getPropertyValue(u"Number"_ustr) >>= nPage;
- if (nPage > 0)
- {
- // nPage is 1-based.
- aSet.Put(SfxInt32Item(SID_PAGE_NUMBER, nPage - 1));
- }
- SfxRequest aReq(SID_RELOAD, SfxCallMode::SLOT, aSet);
- pFrame->ExecReload_Impl(aReq);
+ ResetSignPDFCertificate();
+ RecheckSignature(false);
+ pFrame->RemoveInfoBar(u"readonly");
+ pFrame->AppendReadOnlyInfobar();
}
}
else
@@ -2249,6 +2262,13 @@ bool SfxObjectShell::SignDocumentContentUsingCertificate(svl::crypto::SigningCon
// the document is not new and is not modified
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
+ if (IsModified() && IsSignPDF())
+ {
+ // When signing a PDF, then adding/resizing/moving the signature line would nominally modify
+ // the document, but ignore that for signing.
+ SetModified(false);
+ }
+
if (IsModified() || !GetMedium() || GetMedium()->GetName().isEmpty()
|| (GetMedium()->GetFilter()->IsOwnFormat() && aODFVersion.compareTo(ODFVER_012_TEXT) < 0 && !bHasSign))
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 3b7d1ea47a99..9e1861285ac8 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -132,6 +132,17 @@ using namespace ::com::sun::star::document;
using namespace ::cppu;
+static css::uno::Any getODFVersionAny(SvtSaveOptions::ODFSaneDefaultVersion v)
+{
+ if (v >= SvtSaveOptions::ODFSaneDefaultVersion::ODFSVER_014)
+ return css::uno::Any(ODFVER_014_TEXT);
+ else if (v >= SvtSaveOptions::ODFSaneDefaultVersion::ODFSVER_013)
+ return css::uno::Any(ODFVER_013_TEXT);
+ else
+ return css::uno::Any(ODFVER_012_TEXT);
+}
+
+
void impl_addToModelCollection(const css::uno::Reference< css::frame::XModel >& xModel)
{
if (!xModel.is())
@@ -346,22 +357,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
try
{
// older versions can not have this property set, it exists only starting from ODF1.2
- uno::Reference<frame::XModule> const xModule(GetModel(), uno::UNO_QUERY);
- bool const isBaseForm(xModule.is() &&
- xModule->getIdentifier() == "com.sun.star.sdb.FormDesign");
- SAL_INFO_IF(isBaseForm, "sfx.doc", "tdf#138209 force form export to ODF 1.2");
- if (!isBaseForm && SvtSaveOptions::ODFSVER_014 <= nDefVersion)
- {
- xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_014_TEXT));
- }
- else if (!isBaseForm && SvtSaveOptions::ODFSVER_013 <= nDefVersion)
- {
- xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_013_TEXT));
- }
- else
- {
- xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_012_TEXT));
- }
+ xProps->setPropertyValue(u"Version"_ustr, getODFVersionAny(nDefVersion));
}
catch( uno::Exception& )
{
@@ -736,7 +732,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( GetErrorIgnoreWarning() == ERRCODE_NONE )
{
// Experimental PDF importing using PDFium. This is currently enabled for LOK only and
- // we handle it not via XmlFilterAdaptor but a new SdPdfFiler.
+ // we handle it not via XmlFilterAdaptor but a new SdPdfFilter.
#if !HAVE_FEATURE_POPPLER
constexpr bool bUsePdfium = true;
#else
@@ -1330,18 +1326,7 @@ bool SfxObjectShell::DoSave()
{
try // tdf#134582 set Version on embedded objects as they
{ // could have been loaded with a different/old version
- uno::Reference<frame::XModule> const xModule(GetModel(), uno::UNO_QUERY);
- bool const isBaseForm(xModule.is() &&
- xModule->getIdentifier() == "com.sun.star.sdb.FormDesign");
- SAL_INFO_IF(isBaseForm, "sfx.doc", "tdf#138209 force form export to ODF 1.2");
- if (!isBaseForm && SvtSaveOptions::ODFSVER_013 <= nDefVersion)
- {
- xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_013_TEXT));
- }
- else
- {
- xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_012_TEXT));
- }
+ xProps->setPropertyValue(u"Version"_ustr, getODFVersionAny(nDefVersion));
}
catch (uno::Exception&)
{
diff --git a/sfx2/source/doc/watermarkitem.cxx b/sfx2/source/doc/watermarkitem.cxx
index 3e11ef6e569d..b5a2846cec36 100644
--- a/sfx2/source/doc/watermarkitem.cxx
+++ b/sfx2/source/doc/watermarkitem.cxx
@@ -12,7 +12,7 @@
#include <comphelper/propertysequence.hxx>
SfxWatermarkItem::SfxWatermarkItem()
-: SfxPoolItem( SID_WATERMARK, SfxItemType::SfxWatermarkItemType )
+: SfxPoolItem( SID_WATERMARK )
, m_aText( u""_ustr )
, m_aFont( u"Liberation Sans"_ustr )
, m_nAngle( 45 )
diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index d346363b3f92..049cfa39f951 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -41,7 +41,7 @@ SvxZoomItem::SvxZoomItem
sal_uInt16 nVal,
TypedWhichId<SvxZoomItem> _nWhich
)
-: SfxUInt16Item( _nWhich, nVal, SfxItemType::SfxZoomItemType ),
+: SfxUInt16Item( _nWhich, nVal ),
nValueSet( SvxZoomEnableFlags::ALL ),
eType( eZoomType )
{
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/inc/shutdownicon.hxx
index 535a24b4dff4..1127a9ca352c 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/inc/shutdownicon.hxx
@@ -32,6 +32,10 @@
#include <tools/link.hxx>
#include <memory>
+#ifdef MACOSX
+#include <vcl/menu.hxx>
+#endif
+
extern "C" {
void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray();
@@ -101,6 +105,7 @@ class ShutdownIcon : public ShutdownIconServiceBase
static void OpenURL( const OUString& aURL, const OUString& rTarget, const css::uno::Sequence< css::beans::PropertyValue >& =
css::uno::Sequence< css::beans::PropertyValue >( 0 ) );
static void FromTemplate();
+ static void FromCommand( const OUString& rCommand );
static void SetAutostart( bool bActivate );
static bool GetAutostart();
@@ -139,6 +144,8 @@ class ShutdownIcon : public ShutdownIconServiceBase
#ifdef _WIN32
static void EnableAutostartW32( const OUString &aShortcutName );
static OUString GetAutostartFolderNameW32();
+#elif defined MACOSX
+ static void SetDefaultMenuBar( MenuBar *pMenuBar );
#endif
};
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index cf333c1b0a8f..794e906f6a28 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -264,7 +264,7 @@ void ResourceManager::ReadDeckList()
if (comphelper::LibreOfficeKit::isActive())
{
// Hide these decks in LOK as they aren't fully functional.
- if (aDeckName == "GalleryDeck" || aDeckName == "StyleListDeck")
+ if (aDeckName == "GalleryDeck")
continue;
}
@@ -518,7 +518,7 @@ void ResourceManager::ReadContextList (
}
else
{
- OSL_FAIL("expecting three or four values per ContextList entry, separated by comma");
+ SAL_WARN("sfx.sidebar", "expecting three or four values per ContextList entry, separated by comma, entries: " << aValues);
continue;
}
}
@@ -526,7 +526,7 @@ void ResourceManager::ReadContextList (
const OUString sContextName(o3tl::trim(o3tl::getToken(sValue, 0, ',', nCharacterIndex)));
if (nCharacterIndex < 0)
{
- OSL_FAIL("expecting three or four values per ContextList entry, separated by comma");
+ SAL_WARN("sfx.sidebar", "expecting three or four values per ContextList entry, separated by comma");
continue;
}
@@ -617,7 +617,7 @@ void ResourceManager::ReadContextList (
bIsInitiallyVisible = false;
else
{
- OSL_FAIL("unrecognized state");
+ SAL_WARN("sfx.sidebar", "unrecognized state");
continue;
}
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 1e565338fc59..4717805fae3c 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -378,13 +378,13 @@ void SfxFrame::RemoveTopFrame_Impl( SfxFrame* pFrame )
}
SfxFrameItem::SfxFrameItem( sal_uInt16 nWhichId, SfxViewFrame const *p )
- : SfxPoolItem( nWhichId, SfxItemType::SfxFrameItemType ), pFrame( p ? &p->GetFrame() : nullptr )
+ : SfxPoolItem( nWhichId ), pFrame( p ? &p->GetFrame() : nullptr )
{
wFrame = pFrame;
}
SfxFrameItem::SfxFrameItem( sal_uInt16 nWhichId, SfxFrame *p ):
- SfxPoolItem( nWhichId, SfxItemType::SfxFrameItemType ),
+ SfxPoolItem( nWhichId ),
pFrame( p ), wFrame( p )
{
}
@@ -440,7 +440,7 @@ bool SfxFrameItem::PutValue( const css::uno::Any& rVal, sal_uInt8 )
SfxUnoAnyItem::SfxUnoAnyItem( sal_uInt16 nWhichId, const css::uno::Any& rAny )
- : SfxPoolItem( nWhichId, SfxItemType::SfxUnoAnyItemType )
+ : SfxPoolItem( nWhichId )
{
aValue = rAny;
}
@@ -469,12 +469,12 @@ bool SfxUnoAnyItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/
}
SfxUnoFrameItem::SfxUnoFrameItem()
- : SfxPoolItem( 0, SfxItemType::SfxUnoFrameItemType)
+ : SfxPoolItem( 0)
{
}
SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, css::uno::Reference< css::frame::XFrame > i_xFrame )
- : SfxPoolItem( nWhichId, SfxItemType::SfxUnoFrameItemType )
+ : SfxPoolItem( nWhichId )
, m_xFrame(std::move( i_xFrame ))
{
}
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 5eec80fba576..0ea04c16238f 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -1105,6 +1105,16 @@ void SfxLokHelper::notifyOtherViewsUpdatePerViewId(SfxViewShell const* pThisView
}
}
+void SfxLokHelper::registerViewCallbacks()
+{
+ comphelper::LibreOfficeKit::setViewSetter([](int nView) {
+ SfxLokHelper::setView(nView);
+ });
+ comphelper::LibreOfficeKit::setViewGetter([]() -> int {
+ return SfxLokHelper::getView();
+ });
+}
+
namespace
{
struct LOKAsyncEventData
diff --git a/sfx2/uiconfig/ui/licensedialog.ui b/sfx2/uiconfig/ui/licensedialog.ui
index 004f029b9132..cdeecb112028 100644
--- a/sfx2/uiconfig/ui/licensedialog.ui
+++ b/sfx2/uiconfig/ui/licensedialog.ui
@@ -71,7 +71,7 @@ Third Party Code Additional copyright notices and license terms applicable to po
All trademarks and registered trademarks mentioned herein are the property of their respective owners.
-Copyright © 2000–2024 LibreOffice contributors. All rights reserved.
+Copyright © 2000–2025 LibreOffice contributors. All rights reserved.
This product was created by %OOOVENDOR, based on OpenOffice.org, which is Copyright 2000, 2011 Oracle and/or its affiliates. %OOOVENDOR acknowledges all community members, please see http://www.libreoffice.org/ for more details.</property>
<property name="wrap">True</property>
diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui
index f376fdcc7c0b..377d6f306e2e 100644
--- a/sfx2/uiconfig/ui/password.ui
+++ b/sfx2/uiconfig/ui/password.ui
@@ -2,6 +2,26 @@
<!-- Generated with glade 3.38.2 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.20"/>
+ <object class="GtkImage" id="passimg1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
+ <object class="GtkImage" id="passimg2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
+ <object class="GtkImage" id="passimg3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
+ <object class="GtkImage" id="passimg4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
<object class="GtkDialog" id="PasswordDialog">
<property name="can-focus">False</property>
<property name="border-width">6</property>
@@ -115,7 +135,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|pass1ft">Password:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">pass1ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -129,7 +148,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|confirm1ft">Confirm:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">confirm1ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -151,67 +169,128 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="pass1ed">
+ <object class="GtkLevelBar" id="pass1bar">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="pass1ed-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes" context="password|pass1ed-atkobject">Password</property>
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass1ed">Type a password. A password is case sensitive.</property>
- </object>
- </child>
+ <property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">2</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="confirm1ed">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="confirm1ed-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm1ed">Re-enter the password.</property>
- </object>
- </child>
+ <object class="GtkLabel" id="pass1policylabel">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">end</property>
+ <property name="hexpand">False</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">4</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLevelBar" id="pass1bar">
+ <object class="GtkBox" id="passwbox1">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="pass1ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="pass1ed-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="password|pass1ed-atkobject">Password</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass1ed">Type a password. A password is case sensitive.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt1">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg1</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt1-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="password|togglebt1-atkobject">Show characters</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt1">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">3</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="pass1policylabel">
+ <object class="GtkBox" id="passwbox2">
+ <property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="no-show-all">True</property>
- <property name="halign">end</property>
- <property name="hexpand">False</property>
- <property name="wrap">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="confirm1ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="confirm1ed-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm1ed">Re-enter the password.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt2">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg2</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt2-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt2">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">1</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
@@ -260,7 +339,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|pass2ft">Password:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">pass2ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -274,7 +352,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|confirm2ft">Confirm:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">confirm2ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -283,66 +360,126 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="pass2ed">
+ <object class="GtkLevelBar" id="pass2bar">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="pass2ed-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass2ed">Type a password. A password is case sensitive.</property>
- </object>
- </child>
+ <property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="confirm2ed">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="confirm2ed-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm2ed">Re-enter the password.</property>
- </object>
- </child>
+ <object class="GtkLabel" id="pass2policylabel">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">end</property>
+ <property name="hexpand">False</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">3</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
- <object class="GtkLevelBar" id="pass2bar">
+ <object class="GtkBox" id="passwbox3">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="pass2ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="pass2ed-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass2ed">Type a password. A password is case sensitive.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt3">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg3</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt3-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt3">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">2</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="pass2policylabel">
+ <object class="GtkBox" id="passwbox4">
+ <property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="no-show-all">True</property>
- <property name="halign">end</property>
- <property name="hexpand">False</property>
- <property name="wrap">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="confirm2ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="confirm2ed-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm2ed">Re-enter the password.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt4">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg4</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt4-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt4">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
@@ -377,11 +514,11 @@
<property name="margin-start">6</property>
<property name="xalign">0</property>
<attributes>
- <attribute name="scale" value="0.9"/>
+ <attribute name="scale" value="0.90000000000000002"/>
</attributes>
<child internal-child="accessible">
<object class="AtkObject" id="minlenft-atkobject">
- <property name="AtkObject::accessible-role" translatable="no">static</property>
+ <property name="AtkObject::accessible-role">static</property>
</object>
</child>
</object>
@@ -395,15 +532,16 @@
<object class="GtkLabel" id="onlyascii">
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
+ <property name="tooltip-text" translatable="yes" context="password|onlyascii|tooltip_text">Characters in the Unicode 'Basic Latin' block (also known as ASCII) including the letters A-Z, a-z, numbers 0-9 and the most common punctuation marks.</property>
<property name="margin-start">6</property>
- <property name="label" translatable="yes" context="password|onlyascii">Only Basic Latin characters can be entered</property>
+ <property name="label" translatable="yes" context="password|onlyascii">Only Unicode 'Basic Latin' characters can be entered</property>
<property name="xalign">0</property>
<attributes>
- <attribute name="scale" value="0.9"/>
+ <attribute name="scale" value="0.90000000000000002"/>
</attributes>
<child internal-child="accessible">
<object class="AtkObject" id="onlyascii-atkobject">
- <property name="AtkObject::accessible-role" translatable="no">static</property>
+ <property name="AtkObject::accessible-role">static</property>
</object>
</child>
</object>
diff --git a/sfx2/uiconfig/ui/templatepanel.ui b/sfx2/uiconfig/ui/templatepanel.ui
index fca889705756..60b8b574ca04 100644
--- a/sfx2/uiconfig/ui/templatepanel.ui
+++ b/sfx2/uiconfig/ui/templatepanel.ui
@@ -301,7 +301,7 @@
</packing>
</child>
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="settings">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
@@ -347,7 +347,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
@@ -363,7 +363,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">4</property>
</packing>
</child>
</object>