Files
libreoffice/svtools/source/misc/acceleratorexecute.cxx

480 lines
17 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patch contributed by: Jurgen Schmidt remove onlineregistration with dependencies http://svn.apache.org/viewvc?view=revision&revision=1240245 imported patch package_eventlistener.patch http://svn.apache.org/viewvc?view=revision&revision=1172103 Patch contributed by Pedro Giffuni Accept Google Chrome OS fonts as equivalent to MS fonts. http://svn.apache.org/viewvc?view=revision&revision=1233155 http://svn.apache.org/viewvc?view=revision&revision=1233408 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i114600#: remove forbidden characters from list of unencoded characters http://svn.apache.org/viewvc?view=revision&revision=1172370 Patches contributed by Oliver Rainer-Wittman some clean up in JPEGReader due to memory constraints http://svn.apache.org/viewvc?view=revision&revision=1299729 119114 - method <UpdateDialog::addSpecificError(..)> - create entry with correct type http://svn.apache.org/viewvc?view=revision&revision=1305265 Patches contributed by Ariel Constenla-Haile i118707 - make toolbar control's popup window grab focus http://svn.apache.org/viewvc?view=revision&revision=1225846 Patches contributed by Herbert Duerr #i118662# remove usage of BerkeleyDB in desktop module http://svn.apache.org/viewvc?view=revision&revision=1213171 minor cleanups in dp_persmap.* http://svn.apache.org/viewvc?view=revision&revision=1215064 flush early to prevent problem with extension manager not cleaning up its objects http://svn.apache.org/viewvc?view=revision&revision=1228147 i118726 do not flush *pmap file while reading it http://svn.apache.org/viewvc?view=revision&revision=1230614 #i119048# migrate BDB extension entries using a simple heuristic http://svn.apache.org/viewvc?view=revision&revision=1300972 #i119048# handle edge cases when importing BDB hash files http://svn.apache.org/viewvc?view=revision&revision=1301428 #i119113# fix of-by-one when importing BDB files http://svn.apache.org/viewvc?view=revision&revision=1305420 restore our encryption settings, icon themes, and dictionaries. removed wrapper hacks, kill obsolete bundled extension blob / pre-registration handling, remove duplicated quickstart code. remove OS/2 conditionals.
2012-11-15 17:28:16 +00:00
/*
* 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 .
*/
#include <memory>
#include <svtools/acceleratorexecute.hxx>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
namespace svt
{
class AsyncAccelExec : public cppu::WeakImplHelper<css::lang::XEventListener>
{
private:
css::uno::Reference<css::lang::XComponent> m_xFrame;
css::uno::Reference< css::frame::XDispatch > m_xDispatch;
css::util::URL m_aURL;
vcl::EventPoster m_aAsyncCallback;
public:
/** creates a new instance of this class, which can be used
one times only!
This instance can be forced to execute it's internal set request
asynchronous. After that it deletes itself !
*/
static AsyncAccelExec* createOnShotInstance(const css::uno::Reference<css::lang::XComponent>& xFrame,
const css::uno::Reference<css::frame::XDispatch>& xDispatch,
const css::util::URL& rURL);
void execAsync();
private:
virtual void SAL_CALL disposing(const css::lang::EventObject&) override
{
m_xFrame->removeEventListener(this);
m_xFrame.clear();
m_xDispatch.clear();
}
/** @short allow creation of instances of this class
by using our factory only!
*/
AsyncAccelExec(const css::uno::Reference<css::lang::XComponent>& xFrame,
const css::uno::Reference< css::frame::XDispatch >& xDispatch,
const css::util::URL& rURL);
DECL_LINK(impl_ts_asyncCallback, LinkParamNone*, void);
};
AcceleratorExecute::AcceleratorExecute()
: TMutexInit()
{
}
AcceleratorExecute::~AcceleratorExecute()
{
// does nothing real
}
std::unique_ptr<AcceleratorExecute> AcceleratorExecute::createAcceleratorHelper()
{
return std::unique_ptr<AcceleratorExecute>(new AcceleratorExecute);
}
void AcceleratorExecute::init(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& xEnv )
{
// SAFE -> ----------------------------------
::osl::ResettableMutexGuard aLock(m_aLock);
// take over the uno service manager
m_xContext = rxContext;
// specify our internal dispatch provider
// frame or desktop?! => document or global config.
bool bDesktopIsUsed = false;
m_xDispatcher.set(xEnv, css::uno::UNO_QUERY);
if (!m_xDispatcher.is())
{
aLock.clear();
// <- SAFE ------------------------------
css::uno::Reference< css::frame::XDispatchProvider > xDispatcher(css::frame::Desktop::create(rxContext), css::uno::UNO_QUERY_THROW);
// SAFE -> ------------------------------
aLock.reset();
m_xDispatcher = xDispatcher;
bDesktopIsUsed = true;
}
aLock.clear();
// <- SAFE ----------------------------------
// open all needed configuration objects
css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg;
css::uno::Reference< css::ui::XAcceleratorConfiguration > xModuleCfg;
css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg ;
// global cfg
xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create(rxContext);
if (!bDesktopIsUsed)
{
// module cfg
xModuleCfg = AcceleratorExecute::st_openModuleConfig(rxContext, xEnv);
// doc cfg
css::uno::Reference< css::frame::XController > xController;
css::uno::Reference< css::frame::XModel > xModel;
xController = xEnv->getController();
if (xController.is())
xModel = xController->getModel();
if (xModel.is())
xDocCfg = AcceleratorExecute::st_openDocConfig(xModel);
}
// SAFE -> ------------------------------
aLock.reset();
m_xGlobalCfg = xGlobalCfg;
m_xModuleCfg = xModuleCfg;
m_xDocCfg = xDocCfg ;
aLock.clear();
// <- SAFE ----------------------------------
}
bool AcceleratorExecute::execute(const vcl::KeyCode& aVCLKey)
{
css::awt::KeyEvent aAWTKey = AcceleratorExecute::st_VCLKey2AWTKey(aVCLKey);
return execute(aAWTKey);
}
bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey)
{
OUString sCommand = impl_ts_findCommand(aAWTKey);
// No Command found? Do nothing! User is not interested on any error handling .-)
// or for some reason m_xContext is NULL (which would crash impl_ts_getURLParser()
if (sCommand.isEmpty() || !m_xContext.is())
{
return false;
}
// SAFE -> ----------------------------------
::osl::ResettableMutexGuard aLock(m_aLock);
css::uno::Reference< css::frame::XDispatchProvider > xProvider = m_xDispatcher;
aLock.clear();
// <- SAFE ----------------------------------
// convert command in URL structure
css::uno::Reference< css::util::XURLTransformer > xParser = impl_ts_getURLParser();
css::util::URL aURL;
aURL.Complete = sCommand;
xParser->parseStrict(aURL);
// ask for dispatch object
css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aURL, OUString(), 0);
bool bRet = xDispatch.is();
if ( bRet )
{
// Note: Such instance can be used one times only and destroy itself afterwards .-)
css::uno::Reference<css::lang::XComponent> xFrame(xProvider, css::uno::UNO_QUERY);
AsyncAccelExec* pExec = AsyncAccelExec::createOnShotInstance(xFrame, xDispatch, aURL);
pExec->execAsync();
}
return bRet;
}
css::awt::KeyEvent AcceleratorExecute::st_VCLKey2AWTKey(const vcl::KeyCode& aVCLKey)
{
css::awt::KeyEvent aAWTKey;
aAWTKey.Modifiers = 0;
aAWTKey.KeyCode = (sal_Int16)aVCLKey.GetCode();
if (aVCLKey.IsShift())
aAWTKey.Modifiers |= css::awt::KeyModifier::SHIFT;
if (aVCLKey.IsMod1())
aAWTKey.Modifiers |= css::awt::KeyModifier::MOD1;
if (aVCLKey.IsMod2())
aAWTKey.Modifiers |= css::awt::KeyModifier::MOD2;
if (aVCLKey.IsMod3())
CWS-TOOLING: integrate CWS macshortcuts01 2009-04-02 18:13:38 +0200 pl r270430 : CWS-TOOLING: rebase CWS macshortcuts01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 13:02:01 +0100 pl r268816 : make compile with oldish gtk headers 2009-03-04 11:23:41 +0100 rvojta r268799 : Remove #ifndef MACOSX as Mac OS X X11 port is obsolote, no need to check for non Mac OS X 2009-03-03 16:33:34 +0100 rvojta r268764 : Meta/Super to MOD3 on all Unix platforms except Mac OS X 2009-03-03 16:08:46 +0100 rvojta r268744 : Map GDK_Meta_L/R and GDK_Super_L/R keys to KEY_MOD3 on Unix systems except Mac OS X 2009-03-03 16:04:23 +0100 rvojta r268742 : IsMod3(), IsLeftMod3(), IsRightMod3() added 2009-03-03 16:03:48 +0100 rvojta r268741 : MODKEY_LMOD3, MODKEY_RMOD3, MODKEY_MOD3 support 2009-02-28 00:09:26 +0100 rvojta r268620 : New KeyCode constructors support, by default MOD3 is not used here (probably temporary solution) 2009-02-25 22:53:02 +0100 rvojta r268469 : MOD3 support (META_DOWN_MASK) 2009-02-25 13:22:13 +0100 rvojta r268435 : Cmd-M to minimize window, Cmd-Option-M to minimize all windows 2009-02-25 11:09:20 +0100 rvojta r268417 : Add back F11 for non Mac OS X platforms (removed by accident in r268405) 2009-02-24 18:32:31 +0100 rvojta r268405 : F11 replaced by Cmd-T on Mac OS X 2009-02-23 15:21:53 +0100 sb r268358 : #i99296# support values with both xml:lang and install:module (which are moved into the spool tree, not the res tree) 2009-02-16 22:45:34 +0100 rvojta r267839 : Multiplatform shortcuts support 2009-02-16 22:41:03 +0100 rvojta r267838 : Use install:module instead of separate xcu file 2009-02-16 18:35:36 +0100 rvojta r267833 : Removed accelerators target 2009-02-16 09:27:42 +0100 rvojta r267776 : MOD3 added 2009-02-16 09:18:32 +0100 rvojta r267775 : MOD3 support 2009-02-16 09:17:11 +0100 rvojta r267774 : MOD3 support 2009-02-15 22:11:37 +0100 rvojta r267773 : Check for MOD3 too 2009-02-15 22:11:15 +0100 rvojta r267772 : Check for MOD3 too 2009-02-15 22:10:37 +0100 rvojta r267771 : Check for MOD3 too 2009-02-15 22:10:15 +0100 rvojta r267770 : Check for MOD3 during mouse event too 2009-02-15 22:09:54 +0100 rvojta r267769 : IsMod3() added 2009-02-15 19:34:59 +0100 rvojta r267768 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:33:43 +0100 rvojta r267767 : Cmd-M -> Ctrl-M for default format 2009-02-15 19:32:19 +0100 rvojta r267766 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:30 +0100 rvojta r267765 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:04 +0100 rvojta r267764 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:33 +0100 rvojta r267763 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:09 +0100 rvojta r267762 : MOD3 added (Ctrl on Mac OS X) 2009-02-13 22:11:22 +0100 rvojta r267751 : Cmd-Shift-Z for .uno:Redo 2009-02-13 22:04:19 +0100 rvojta r267748 : F11 -> Cmd-T for .uno:DesignerDialog 2009-02-13 21:09:11 +0100 rvojta r267743 : F11 -> Cmd-T (all occurences) 2009-02-13 19:47:21 +0100 rvojta r267741 : accelerators target added for Mac OS X shortcuts 2009-02-13 19:46:58 +0100 rvojta r267740 : Spreadsheet - replace F11 with Cmd-T 2009-02-13 19:24:19 +0100 rvojta r267739 : Remove Accelerators-Mac.xcs 2009-02-13 18:50:01 +0100 rvojta r267738 : Accelerators-Mac.xcs test 2009-02-13 18:48:10 +0100 rvojta r267737 : Accelerators-Mac.xcu added 2009-02-13 18:46:48 +0100 rvojta r267736 : F11 -> Cmd-T for stylist in Spreadsheet
2009-04-12 04:24:43 +00:00
aAWTKey.Modifiers |= css::awt::KeyModifier::MOD3;
return aAWTKey;
}
vcl::KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey)
{
bool bShift = ((aAWTKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT );
bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 );
bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 );
bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 );
sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode;
return vcl::KeyCode(nKey, bShift, bMod1, bMod2, bMod3);
}
OUString AcceleratorExecute::findCommand(const css::awt::KeyEvent& aKey)
{
return impl_ts_findCommand(aKey);
}
OUString AcceleratorExecute::impl_ts_findCommand(const css::awt::KeyEvent& aKey)
{
// SAFE -> ----------------------------------
::osl::ResettableMutexGuard aLock(m_aLock);
css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = m_xGlobalCfg;
css::uno::Reference< css::ui::XAcceleratorConfiguration > xModuleCfg = m_xModuleCfg;
css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg = m_xDocCfg ;
aLock.clear();
// <- SAFE ----------------------------------
OUString sCommand;
try
{
if (xDocCfg.is())
sCommand = xDocCfg->getCommandByKeyEvent(aKey);
if (!sCommand.isEmpty())
return sCommand;
}
catch(const css::container::NoSuchElementException&)
{}
try
{
if (xModuleCfg.is())
sCommand = xModuleCfg->getCommandByKeyEvent(aKey);
if (!sCommand.isEmpty())
return sCommand;
}
catch(const css::container::NoSuchElementException&)
{}
try
{
if (xGlobalCfg.is())
sCommand = xGlobalCfg->getCommandByKeyEvent(aKey);
if (!sCommand.isEmpty())
return sCommand;
}
catch(const css::container::NoSuchElementException&)
{}
// fall back to functional key codes
if( aKey.Modifiers == 0 )
{
switch( aKey.KeyCode )
{
case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
return OUString( ".uno:DelToStartOfLine" );
case css::awt::Key::DELETE_TO_END_OF_LINE:
return OUString( ".uno:DelToEndOfLine" );
case css::awt::Key::DELETE_TO_BEGIN_OF_PARAGRAPH:
return OUString( ".uno:DelToStartOfPara" );
case css::awt::Key::DELETE_TO_END_OF_PARAGRAPH:
return OUString( ".uno:DelToEndOfPara" );
case css::awt::Key::DELETE_WORD_BACKWARD:
return OUString( ".uno:DelToStartOfWord" );
case css::awt::Key::DELETE_WORD_FORWARD:
return OUString( ".uno:DelToEndOfWord" );
case css::awt::Key::INSERT_LINEBREAK:
return OUString( ".uno:InsertLinebreak" );
case css::awt::Key::INSERT_PARAGRAPH:
return OUString( ".uno:InsertPara" );
case css::awt::Key::MOVE_WORD_BACKWARD:
return OUString( ".uno:GoToPrevWord" );
case css::awt::Key::MOVE_WORD_FORWARD:
return OUString( ".uno:GoToNextWord" );
case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
return OUString( ".uno:GoToStartOfLine" );
case css::awt::Key::MOVE_TO_END_OF_LINE:
return OUString( ".uno:GoToEndOfLine" );
case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
return OUString( ".uno:GoToStartOfPara" );
case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
return OUString( ".uno:GoToEndOfPara" );
case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
return OUString( ".uno:GoToStartOfDoc" );
case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
return OUString( ".uno:GoToEndOfDoc" );
case css::awt::Key::SELECT_BACKWARD:
return OUString( ".uno:CharLeftSel" );
case css::awt::Key::SELECT_FORWARD:
return OUString( ".uno:CharRightSel" );
case css::awt::Key::SELECT_WORD_BACKWARD:
return OUString( ".uno:WordLeftSel" );
case css::awt::Key::SELECT_WORD_FORWARD:
return OUString( ".uno:WordRightSel" );
case css::awt::Key::SELECT_WORD:
return OUString( ".uno:SelectWord" );
case css::awt::Key::SELECT_LINE:
return OUString();
case css::awt::Key::SELECT_PARAGRAPH:
return OUString( ".uno:SelectText" );
case css::awt::Key::SELECT_TO_BEGIN_OF_LINE:
return OUString( ".uno:StartOfLineSel" );
case css::awt::Key::SELECT_TO_END_OF_LINE:
return OUString( ".uno:EndOfLineSel" );
case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
return OUString( ".uno:StartOfParaSel" );
case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
return OUString( ".uno:EndOfParaSel" );
case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
return OUString( ".uno:StartOfDocumentSel" );
case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
return OUString( ".uno:EndOfDocumentSel" );
case css::awt::Key::SELECT_ALL:
return OUString( ".uno:SelectAll" );
default:
break;
}
}
return OUString();
}
css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& xFrame)
{
css::uno::Reference< css::frame::XModuleManager2 > xModuleDetection(
css::frame::ModuleManager::create(rxContext));
OUString sModule;
try
{
sModule = xModuleDetection->identify(xFrame);
}
catch(const css::uno::RuntimeException&)
{ throw; }
catch(const css::uno::Exception&)
{ return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); }
css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier(
css::ui::theModuleUIConfigurationManagerSupplier::get(rxContext) );
CWS-TOOLING: integrate CWS fwk103 2009-05-26 12:44:25 +0200 mst r272292 : #i100727# - svtools/inc/svtools/parhtml.hxx, svtools/source/svhtml/parhtml.cxx: + fix warning: rename method to prevent overloading 2009-05-19 13:42:31 +0200 mav r272075 : #i101356# add comment 2009-05-19 10:56:24 +0200 mav r272062 : #i101356# register the singleton correctly 2009-05-19 10:25:42 +0200 mav r272060 : #i101356# register the singleton correctly 2009-05-18 12:48:48 +0200 mav r272013 : #i91306# fix the typo 2009-05-14 08:50:06 +0200 mav r271871 : #i101356# reduce the amount of macros 2009-05-13 13:26:08 +0200 mav r271858 : #i101356# reduce the amount of macros 2009-05-13 11:29:16 +0200 mav r271849 : #i101356# reduce the amount of macros 2009-05-12 12:09:42 +0200 mav r271815 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 12:03:20 +0200 mav r271814 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:58:48 +0200 mav r271813 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:53:05 +0200 mav r271812 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:48:36 +0200 mav r271810 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:43:45 +0200 mav r271809 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:39:38 +0200 mav r271808 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:37:38 +0200 mav r271806 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:33:58 +0200 mav r271805 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:30:01 +0200 mav r271804 : #i101356# allow to generate a small log if a document can not be stored 2009-05-06 17:43:38 +0200 mst r271607 : #i100727# - svtools/source/svhtml/parhtml.cxx: + adapt code to renaming of HTML constants (sb107) 2009-05-05 11:14:18 +0200 mav r271507 : #i101222# avoid warning 2009-05-05 10:27:23 +0200 mav r271505 : #i101426# send the modified() notification only when the document can be modified 2009-05-05 10:25:07 +0200 mav r271504 : #i101426# send the modified() notification only when the document is modified 2009-05-05 08:42:48 +0200 mav r271497 : CWS-TOOLING: rebase CWS fwk103 to trunk@271427 (milestone: DEV300:m47) 2009-04-30 13:32:11 +0200 mav r271412 : #i100518# check the template folders quietly 2009-04-29 20:04:25 +0200 mst r271393 : - sw/source/filter/html/swhtml.cxx: + fix wrong initialization order in constructor 2009-04-28 12:28:46 +0200 mav r271319 : #i99142# set the error correctly 2009-04-28 08:44:48 +0200 mav r271305 : #i99050# clear hidden flag if necessary 2009-04-28 08:40:10 +0200 mav r271304 : #i99050# avoid crash 2009-04-22 07:40:11 +0200 mav r271056 : #i101093# lets not affect the performance 2009-04-15 09:30:47 +0200 cd r270820 : #i99771# Fix warnings for gcc 4.4 2009-04-15 09:19:52 +0200 cd r270819 : #i99771# Fix warnings for gcc 4.4 2009-04-15 08:42:34 +0200 cd r270817 : #i99771# Fix warnings for gcc 4.4 2009-04-14 14:31:01 +0200 mav r270768 : #i99493# fix typo 2009-04-01 12:45:43 +0200 mst r270317 : fix #i100727# - svtools/inc/svtools/svparser.hxx, svtools/source/svrtf/svparser.cxx, sfx2/inc/sfx2/docfile.hxx, sfx2/source/doc/{objmisc.cxx,docfile.cxx}: + move SvKeyValue stuff from sfx2 to svtools - svtools/inc/svtools/parhtml.hxx, svtools/source/svhtml/parhtml.cxx, sfx2/inc/sfx2/sfxhtml.hxx, sfx2/source/bastyp/sfxhtml.cxx: + move ParseMetaOptions() and GetEncodingByMIME() from SfxHTMLParser (sfx2) to HTMLParser (svtools) + make HTMLParser::ParseMetaOptions() a virtual function + HTMLParser::ParseMetaOptions() calls GetExtendedCompatibilityTextEncoding() + new template method HTMLParser::AddMetaUserDefined() - svtools/source/svhtml/makefile.mk: + enable exceptions for parhtml.cxx - dbaccess/source/ui/misc/HtmlReader.cxx, sc/source/filter/html/htmlpars.cxx: + remove encoding related code duplication - sw/source/filter/html/{swhtml{.hxx,.cxx},htmlfld.cxx}: + new SwHTMLParser::AddMetaUserDefined() for import of DOCINFO field subtypes INFO[1-4] + do not use DocumentInfo for import of DOCINFO field subtypes INFO[1-4] 2009-03-31 17:01:35 +0200 mav r270288 : #i91214# fix typo 2009-03-31 15:19:41 +0200 mav r270285 : #i100123# allow to turn OOo locking mechanics off 2009-03-31 15:00:36 +0200 mav r270284 : #i100123# allow to turn OOo locking mechanics off 2009-03-31 12:19:13 +0200 mav r270270 : #i100123# taking the lock file over throws no exception 2009-03-30 13:57:21 +0200 mav r270227 : #i100351# fix the typo 2009-03-30 13:47:26 +0200 mav r270225 : #i99885# let OK be default button 2009-03-29 19:38:55 +0200 mav r270190 : CWS-TOOLING: rebase CWS fwk103 to trunk@270033 (milestone: DEV300:m45) 2009-03-16 16:39:48 +0100 mav r269558 : #i93558# convert the attributes as well 2009-03-13 15:35:55 +0100 mav r269488 : #i93558# improve manifest.xml parsing 2009-03-13 08:47:00 +0100 mav r269454 : #i96205# allow to remove password on SaveAs 2009-03-12 13:36:07 +0100 mav r269398 : #i91306# show special error in case of shared document 2009-03-12 13:33:35 +0100 mav r269397 : #i91306# introduce the new error-message 2009-03-12 11:40:42 +0100 mst r269378 : fix #i90877# - svtools/source/uno/unoevent.cxx: + use proper operator delete[] 2009-02-26 15:23:10 +0100 mav r268526 : #i91214# do not use ATL 2009-02-26 14:19:06 +0100 mav r268516 : #i98909# integrate the patch 2009-02-10 17:29:52 +0100 cd r267568 : #i98649# Make sure that we catch the NoSuchElementException when a module is not installed.
2009-06-16 16:15:54 +00:00
css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg;
try
{
css::uno::Reference< css::ui::XUIConfigurationManager > xUIManager = xUISupplier->getUIConfigurationManager(sModule);
xAccCfg = xUIManager->getShortCutManager();
CWS-TOOLING: integrate CWS fwk103 2009-05-26 12:44:25 +0200 mst r272292 : #i100727# - svtools/inc/svtools/parhtml.hxx, svtools/source/svhtml/parhtml.cxx: + fix warning: rename method to prevent overloading 2009-05-19 13:42:31 +0200 mav r272075 : #i101356# add comment 2009-05-19 10:56:24 +0200 mav r272062 : #i101356# register the singleton correctly 2009-05-19 10:25:42 +0200 mav r272060 : #i101356# register the singleton correctly 2009-05-18 12:48:48 +0200 mav r272013 : #i91306# fix the typo 2009-05-14 08:50:06 +0200 mav r271871 : #i101356# reduce the amount of macros 2009-05-13 13:26:08 +0200 mav r271858 : #i101356# reduce the amount of macros 2009-05-13 11:29:16 +0200 mav r271849 : #i101356# reduce the amount of macros 2009-05-12 12:09:42 +0200 mav r271815 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 12:03:20 +0200 mav r271814 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:58:48 +0200 mav r271813 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:53:05 +0200 mav r271812 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:48:36 +0200 mav r271810 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:43:45 +0200 mav r271809 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:39:38 +0200 mav r271808 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:37:38 +0200 mav r271806 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:33:58 +0200 mav r271805 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:30:01 +0200 mav r271804 : #i101356# allow to generate a small log if a document can not be stored 2009-05-06 17:43:38 +0200 mst r271607 : #i100727# - svtools/source/svhtml/parhtml.cxx: + adapt code to renaming of HTML constants (sb107) 2009-05-05 11:14:18 +0200 mav r271507 : #i101222# avoid warning 2009-05-05 10:27:23 +0200 mav r271505 : #i101426# send the modified() notification only when the document can be modified 2009-05-05 10:25:07 +0200 mav r271504 : #i101426# send the modified() notification only when the document is modified 2009-05-05 08:42:48 +0200 mav r271497 : CWS-TOOLING: rebase CWS fwk103 to trunk@271427 (milestone: DEV300:m47) 2009-04-30 13:32:11 +0200 mav r271412 : #i100518# check the template folders quietly 2009-04-29 20:04:25 +0200 mst r271393 : - sw/source/filter/html/swhtml.cxx: + fix wrong initialization order in constructor 2009-04-28 12:28:46 +0200 mav r271319 : #i99142# set the error correctly 2009-04-28 08:44:48 +0200 mav r271305 : #i99050# clear hidden flag if necessary 2009-04-28 08:40:10 +0200 mav r271304 : #i99050# avoid crash 2009-04-22 07:40:11 +0200 mav r271056 : #i101093# lets not affect the performance 2009-04-15 09:30:47 +0200 cd r270820 : #i99771# Fix warnings for gcc 4.4 2009-04-15 09:19:52 +0200 cd r270819 : #i99771# Fix warnings for gcc 4.4 2009-04-15 08:42:34 +0200 cd r270817 : #i99771# Fix warnings for gcc 4.4 2009-04-14 14:31:01 +0200 mav r270768 : #i99493# fix typo 2009-04-01 12:45:43 +0200 mst r270317 : fix #i100727# - svtools/inc/svtools/svparser.hxx, svtools/source/svrtf/svparser.cxx, sfx2/inc/sfx2/docfile.hxx, sfx2/source/doc/{objmisc.cxx,docfile.cxx}: + move SvKeyValue stuff from sfx2 to svtools - svtools/inc/svtools/parhtml.hxx, svtools/source/svhtml/parhtml.cxx, sfx2/inc/sfx2/sfxhtml.hxx, sfx2/source/bastyp/sfxhtml.cxx: + move ParseMetaOptions() and GetEncodingByMIME() from SfxHTMLParser (sfx2) to HTMLParser (svtools) + make HTMLParser::ParseMetaOptions() a virtual function + HTMLParser::ParseMetaOptions() calls GetExtendedCompatibilityTextEncoding() + new template method HTMLParser::AddMetaUserDefined() - svtools/source/svhtml/makefile.mk: + enable exceptions for parhtml.cxx - dbaccess/source/ui/misc/HtmlReader.cxx, sc/source/filter/html/htmlpars.cxx: + remove encoding related code duplication - sw/source/filter/html/{swhtml{.hxx,.cxx},htmlfld.cxx}: + new SwHTMLParser::AddMetaUserDefined() for import of DOCINFO field subtypes INFO[1-4] + do not use DocumentInfo for import of DOCINFO field subtypes INFO[1-4] 2009-03-31 17:01:35 +0200 mav r270288 : #i91214# fix typo 2009-03-31 15:19:41 +0200 mav r270285 : #i100123# allow to turn OOo locking mechanics off 2009-03-31 15:00:36 +0200 mav r270284 : #i100123# allow to turn OOo locking mechanics off 2009-03-31 12:19:13 +0200 mav r270270 : #i100123# taking the lock file over throws no exception 2009-03-30 13:57:21 +0200 mav r270227 : #i100351# fix the typo 2009-03-30 13:47:26 +0200 mav r270225 : #i99885# let OK be default button 2009-03-29 19:38:55 +0200 mav r270190 : CWS-TOOLING: rebase CWS fwk103 to trunk@270033 (milestone: DEV300:m45) 2009-03-16 16:39:48 +0100 mav r269558 : #i93558# convert the attributes as well 2009-03-13 15:35:55 +0100 mav r269488 : #i93558# improve manifest.xml parsing 2009-03-13 08:47:00 +0100 mav r269454 : #i96205# allow to remove password on SaveAs 2009-03-12 13:36:07 +0100 mav r269398 : #i91306# show special error in case of shared document 2009-03-12 13:33:35 +0100 mav r269397 : #i91306# introduce the new error-message 2009-03-12 11:40:42 +0100 mst r269378 : fix #i90877# - svtools/source/uno/unoevent.cxx: + use proper operator delete[] 2009-02-26 15:23:10 +0100 mav r268526 : #i91214# do not use ATL 2009-02-26 14:19:06 +0100 mav r268516 : #i98909# integrate the patch 2009-02-10 17:29:52 +0100 cd r267568 : #i98649# Make sure that we catch the NoSuchElementException when a module is not installed.
2009-06-16 16:15:54 +00:00
}
catch(const css::container::NoSuchElementException&)
{}
return xAccCfg;
}
css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel)
{
css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg;
css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xUISupplier(xModel, css::uno::UNO_QUERY);
if (xUISupplier.is())
{
css::uno::Reference< css::ui::XUIConfigurationManager > xUIManager = xUISupplier->getUIConfigurationManager();
xAccCfg = xUIManager->getShortCutManager();
}
return xAccCfg;
}
css::uno::Reference< css::util::XURLTransformer > AcceleratorExecute::impl_ts_getURLParser()
{
// SAFE -> ----------------------------------
::osl::ResettableMutexGuard aLock(m_aLock);
if (m_xURLParser.is())
return m_xURLParser;
css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aLock.clear();
// <- SAFE ----------------------------------
css::uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create( xContext );
// SAFE -> ----------------------------------
aLock.reset();
m_xURLParser = xParser;
aLock.clear();
// <- SAFE ----------------------------------
return xParser;
}
AsyncAccelExec::AsyncAccelExec(const css::uno::Reference<css::lang::XComponent>& xFrame,
const css::uno::Reference<css::frame::XDispatch>& xDispatch,
const css::util::URL& rURL)
: m_xFrame(xFrame)
, m_xDispatch(xDispatch)
, m_aURL(rURL)
, m_aAsyncCallback(LINK(this, AsyncAccelExec, impl_ts_asyncCallback))
{
}
AsyncAccelExec* AsyncAccelExec::createOnShotInstance(const css::uno::Reference<css::lang::XComponent> &xFrame,
const css::uno::Reference< css::frame::XDispatch >& xDispatch,
const css::util::URL& rURL)
{
AsyncAccelExec* pExec = new AsyncAccelExec(xFrame, xDispatch, rURL);
return pExec;
}
void AsyncAccelExec::execAsync()
{
acquire();
if (m_xFrame.is())
m_xFrame->addEventListener(this);
m_aAsyncCallback.Post();
}
IMPL_LINK_NOARG(AsyncAccelExec, impl_ts_asyncCallback, LinkParamNone*, void)
{
if (m_xDispatch.is())
{
try
{
if (m_xFrame.is())
m_xFrame->removeEventListener(this);
m_xDispatch->dispatch(m_aURL, css::uno::Sequence< css::beans::PropertyValue >());
}
catch(const css::uno::Exception&)
{
}
}
release();
}
} // namespace svt
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */