This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 8654bc524c Fix typos (asny, anwser), cleanup
8654bc524c is described below
commit 8654bc524cc28d58c3dede72fcde3b529303c125
Author: mseidel <[email protected]>
AuthorDate: Sat Feb 15 01:26:11 2025 +0100
Fix typos (asny, anwser), cleanup
(cherry picked from commit 2ca93d585f0ac53286f77594f2906584a34c01d2)
---
main/dbaccess/source/ui/inc/sbagrid.hxx | 50 +++++-----
main/svtools/source/uno/contextmenuhelper.cxx | 137 +++++++++++++-------------
2 files changed, 93 insertions(+), 94 deletions(-)
diff --git a/main/dbaccess/source/ui/inc/sbagrid.hxx
b/main/dbaccess/source/ui/inc/sbagrid.hxx
index 08b854fb48..096c886902 100644
--- a/main/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/main/dbaccess/source/ui/inc/sbagrid.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* 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
@@ -7,24 +7,22 @@
* 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
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
#ifndef _SBA_GRID_HXX
#define _SBA_GRID_HXX
-// #include <sdb/tools.hxx>
+//#include <sdb/tools.hxx>
#ifndef _SVX_FMGRIDCL_HXX
#include <svx/fmgridcl.hxx>
@@ -168,7 +166,7 @@ namespace dbaui
#endif // # _MSC_VER>=1310
private:
- // for asny execution of XDispatch::dispatch
+ // for any execution of XDispatch::dispatch
struct DispatchArgs
{
::com::sun::star::util::URL
aURL;
@@ -219,8 +217,8 @@ namespace dbaui
sal_Bool ImplStartColumnDrag(sal_Int8 _nAction, const Point&
_rMousePos);
- private:
- using FmGridHeader::StartDrag;
+ private:
+ using FmGridHeader::StartDrag;
};
//
=========================================================================
@@ -256,7 +254,7 @@ namespace dbaui
sal_Int32 m_nAsyncDropEvent;
sal_uInt16 m_nCurrentActionColId;
- // ui actions (e.g. a context menu) may be performed on
columns which aren't the current one
+ // UI actions (e.g. a context menu) may be performed on
columns which aren't the current one
// and aren't selected, so we have to track this column
id
sal_Bool m_bActivatingForDrop;
@@ -285,18 +283,18 @@ namespace dbaui
@param eObjType
The type to ask for
@param _nPosition
- The position of a tablecell (index position),
header bar column/row cell
+ The position of a tablecell (index position),
header bar column/row cell
@return
The description of the specified object.
*/
virtual ::rtl::OUString GetAccessibleObjectDescription(
::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
virtual void DeleteSelectedRows();
- /** copies the currently selected rows to the clipboard
- @precond
- at least one row is selected
- */
- void CopySelectedRowsToClipboard();
+ /** copies the currently selected rows to the clipboard
+ @precond
+ at least one row is selected
+ */
+ void CopySelectedRowsToClipboard();
protected:
@@ -317,9 +315,9 @@ namespace dbaui
virtual void PreExecuteRowContextMenu(sal_uInt16 nRow,
PopupMenu& rMenu);
virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const
PopupMenu& rMenu, sal_uInt16 nExecutionResult);
- // DbGridControl overridables
- virtual void onRowChange();
- virtual void onColumnChange();
+ // DbGridControl overridables
+ virtual void onRowChange();
+ virtual void onColumnChange();
// my own overridables
virtual void BeforeDrop();
@@ -347,12 +345,14 @@ namespace dbaui
private:
sal_Bool IsReadOnlyDB() const;
- void implTransferSelectedRows( sal_Int16 nRowPos, bool
_bTrueIfClipboardFalseIfDrag );
+ void implTransferSelectedRows( sal_Int16 nRowPos, bool
_bTrueIfClipboardFalseIfDrag );
- private:
- using FmGridControl::AcceptDrop;
- using FmGridControl::ExecuteDrop;
- using FmGridControl::MouseButtonDown;
+ private:
+ using FmGridControl::AcceptDrop;
+ using FmGridControl::ExecuteDrop;
+ using FmGridControl::MouseButtonDown;
};
}
#endif // _SBA_GRID_HXX
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/svtools/source/uno/contextmenuhelper.cxx
b/main/svtools/source/uno/contextmenuhelper.cxx
index e5601eb90e..2b954dc012 100644
--- a/main/svtools/source/uno/contextmenuhelper.cxx
+++ b/main/svtools/source/uno/contextmenuhelper.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* 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
@@ -7,20 +7,18 @@
* 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
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
@@ -39,7 +37,7 @@
#include <com/sun/star/ui/ImageType.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <osl/conditn.hxx>
+#include <osl/conditn.hxx>
#include <cppuhelper/weak.hxx>
#include <comphelper/processfactory.hxx>
#include <vos/mutex.hxx>
@@ -48,7 +46,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxmenu.hxx>
-
+
using namespace ::com::sun::star;
namespace svt
@@ -70,13 +68,13 @@ class StateEventHelper : public
::com::sun::star::frame::XStatusListener,
virtual uno::Any SAL_CALL queryInterface( const uno::Type&
aType ) throw ( uno::RuntimeException);
virtual void SAL_CALL acquire() throw ();
virtual void SAL_CALL release() throw ();
-
+
// XEventListener
virtual void SAL_CALL disposing(const lang::EventObject& Source)
throw( uno::RuntimeException );
-
+
// XStatusListener
virtual void SAL_CALL statusChanged(const frame::FeatureStateEvent&
Event) throw( uno::RuntimeException );
-
+
private:
StateEventHelper();
StateEventHelper( const StateEventHelper& );
@@ -86,7 +84,7 @@ class StateEventHelper : public
::com::sun::star::frame::XStatusListener,
::rtl::OUString m_aCommandURL;
uno::Reference< frame::XDispatchProvider > m_xDispatchProvider;
uno::Reference< util::XURLTransformer > m_xURLTransformer;
- osl::Condition m_aCondition;
+ osl::Condition m_aCondition;
};
StateEventHelper::StateEventHelper(
@@ -108,13 +106,13 @@ uno::Any SAL_CALL StateEventHelper::queryInterface(
const uno::Type& aType )
throw ( uno::RuntimeException )
{
- uno::Any a = ::cppu::queryInterface(
+ uno::Any a = ::cppu::queryInterface(
aType,
SAL_STATIC_CAST( XStatusListener*, this ));
-
+
if( a.hasValue() )
return a;
-
+
return ::cppu::OWeakObject::queryInterface( aType );
}
@@ -130,7 +128,7 @@ throw ()
::cppu::OWeakObject::release();
}
-void SAL_CALL StateEventHelper::disposing(
+void SAL_CALL StateEventHelper::disposing(
const lang::EventObject& )
throw ( uno::RuntimeException )
{
@@ -140,7 +138,7 @@ throw ( uno::RuntimeException )
m_aCondition.set();
}
-void SAL_CALL StateEventHelper::statusChanged(
+void SAL_CALL StateEventHelper::statusChanged(
const frame::FeatureStateEvent& Event )
throw ( uno::RuntimeException )
{
@@ -152,9 +150,9 @@ throw ( uno::RuntimeException )
bool StateEventHelper::isCommandEnabled()
{
// Be sure that we cannot die during condition wait
- uno::Reference< frame::XStatusListener > xSelf(
+ uno::Reference< frame::XStatusListener > xSelf(
SAL_STATIC_CAST( frame::XStatusListener*, this ));
-
+
uno::Reference< frame::XDispatch > xDispatch;
util::URL aTargetURL;
{
@@ -162,7 +160,7 @@ bool StateEventHelper::isCommandEnabled()
if ( m_xDispatchProvider.is() && m_xURLTransformer.is() )
{
::rtl::OUString aSelf( RTL_CONSTASCII_USTRINGPARAM( "_self" ));
-
+
aTargetURL.Complete = m_aCommandURL;
m_xURLTransformer->parseStrict( aTargetURL );
@@ -188,8 +186,8 @@ bool StateEventHelper::isCommandEnabled()
// add/remove ourself to retrieve status by callback
xDispatch->addStatusListener( xSelf, aTargetURL );
xDispatch->removeStatusListener( xSelf, aTargetURL );
-
- // wait for anwser
+
+ // wait for answer
m_aCondition.wait();
}
catch ( uno::RuntimeException& )
@@ -203,19 +201,19 @@ bool StateEventHelper::isCommandEnabled()
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
bResult = m_bCurrentCommandEnabled;
}
-
+
return bResult;
}
/*************************************************************************/
-
+
struct ExecuteInfo
{
uno::Reference< frame::XDispatch > xDispatch;
util::URL aTargetURL;
uno::Sequence< beans::PropertyValue > aArgs;
};
-
+
static const PopupMenu* lcl_FindPopupFromItemId( const PopupMenu* pPopupMenu,
sal_uInt16 nItemId )
{
if ( pPopupMenu )
@@ -229,7 +227,7 @@ static const PopupMenu* lcl_FindPopupFromItemId( const
PopupMenu* pPopupMenu, sa
else
{
const PopupMenu* pResult( 0 );
-
+
const PopupMenu* pSubPopup = pPopupMenu->GetPopupMenu( i );
if ( pPopupMenu )
pResult = lcl_FindPopupFromItemId( pSubPopup, nItemId );
@@ -254,7 +252,7 @@ static ::rtl::OUString lcl_GetItemCommandRecursive( const
PopupMenu* pPopupMenu,
/*************************************************************************/
ContextMenuHelper::ContextMenuHelper(
- const uno::Reference< frame::XFrame >& xFrame,
+ const uno::Reference< frame::XFrame >& xFrame,
bool bAutoRefresh ) :
m_xWeakFrame( xFrame ),
m_aSelf( RTL_CONSTASCII_USTRINGPARAM( "_self" )),
@@ -267,22 +265,22 @@ ContextMenuHelper::~ContextMenuHelper()
{
}
-void
-ContextMenuHelper::completeAndExecute(
- const Point& aPos,
+void
+ContextMenuHelper::completeAndExecute(
+ const Point& aPos,
PopupMenu& rPopupMenu )
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
+
associateUIConfigurationManagers();
completeMenuProperties( &rPopupMenu );
executePopupMenu( aPos, &rPopupMenu );
resetAssociations();
}
-void
-ContextMenuHelper::completeAndExecute(
- const Point& aPos,
+void
+ContextMenuHelper::completeAndExecute(
+ const Point& aPos,
const uno::Reference< awt::XPopupMenu >& xPopupMenu )
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
@@ -302,17 +300,17 @@ ContextMenuHelper::completeAndExecute(
}
}
-uno::Reference< awt::XPopupMenu >
-ContextMenuHelper::create(
+uno::Reference< awt::XPopupMenu >
+ContextMenuHelper::create(
const ::rtl::OUString& /*aPopupMenuResourceId*/ )
{
// NOT IMPLEMENTED YET!
return uno::Reference< awt::XPopupMenu >();
}
-bool
-ContextMenuHelper::createAndExecute(
- const Point& /*aPos*/,
+bool
+ContextMenuHelper::createAndExecute(
+ const Point& /*aPos*/,
const ::rtl::OUString& /*aPopupMenuResourceId*/ )
{
// NOT IMPLEMENTED YET!
@@ -321,8 +319,8 @@ ContextMenuHelper::createAndExecute(
// private member
-void
-ContextMenuHelper::executePopupMenu(
+void
+ContextMenuHelper::executePopupMenu(
const Point& rPos,
PopupMenu* pMenu )
{
@@ -349,19 +347,19 @@ ContextMenuHelper::executePopupMenu(
}
bool
-ContextMenuHelper::dispatchCommand(
+ContextMenuHelper::dispatchCommand(
const uno::Reference< ::frame::XFrame >& rFrame,
const ::rtl::OUString& aCommandURL )
{
if ( !m_xURLTransformer.is() )
{
- m_xURLTransformer = uno::Reference< util::XURLTransformer >(
+ m_xURLTransformer = uno::Reference< util::XURLTransformer >(
::comphelper::getProcessServiceFactory()->createInstance(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.util.URLTransformer" ))),
uno::UNO_QUERY );
}
-
+
util::URL aTargetURL;
uno::Reference< frame::XDispatch > xDispatch;
if ( m_xURLTransformer.is() )
@@ -369,7 +367,7 @@ ContextMenuHelper::dispatchCommand(
aTargetURL.Complete = aCommandURL;
m_xURLTransformer->parseStrict( aTargetURL );
- uno::Reference< frame::XDispatchProvider > xDispatchProvider(
+ uno::Reference< frame::XDispatchProvider > xDispatchProvider(
rFrame, uno::UNO_QUERY );
if ( xDispatchProvider.is() )
{
@@ -402,7 +400,7 @@ ContextMenuHelper::dispatchCommand(
}
// retrieves and stores references to our user-interface
-// configuration managers, like image manager, ui command
+// configuration managers, like image manager, UI command
// description manager.
bool
ContextMenuHelper::associateUIConfigurationManagers()
@@ -429,9 +427,9 @@ ContextMenuHelper::associateUIConfigurationManagers()
uno::Reference< ui::XUIConfigurationManagerSupplier >
xSupplier( xModel, uno::UNO_QUERY );
if ( xSupplier.is() )
{
- uno::Reference< ui::XUIConfigurationManager >
xDocUICfgMgr(
+ uno::Reference< ui::XUIConfigurationManager > xDocUICfgMgr(
xSupplier->getUIConfigurationManager(), uno::UNO_QUERY
);
- m_xDocImageMgr = uno::Reference< ui::XImageManager >(
+ m_xDocImageMgr = uno::Reference< ui::XImageManager >(
xDocUICfgMgr->getImageManager(), uno::UNO_QUERY );
}
}
@@ -441,7 +439,7 @@ ContextMenuHelper::associateUIConfigurationManagers()
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.frame.ModuleManager" ))),
uno::UNO_QUERY );
-
+
uno::Reference< ui::XImageManager > xModuleImageManager;
rtl::OUString aModuleId;
if ( xModuleManager.is() )
@@ -456,11 +454,11 @@ ContextMenuHelper::associateUIConfigurationManagers()
uno::UNO_QUERY );
if ( xModuleCfgMgrSupplier.is() )
{
- uno::Reference< ui::XUIConfigurationManager > xUICfgMgr(
+ uno::Reference< ui::XUIConfigurationManager > xUICfgMgr(
xModuleCfgMgrSupplier->getUIConfigurationManager(
aModuleId ));
if ( xUICfgMgr.is() )
{
- m_xModuleImageMgr = uno::Reference< ui::XImageManager
>(
+ m_xModuleImageMgr = uno::Reference< ui::XImageManager
>(
xUICfgMgr->getImageManager(), uno::UNO_QUERY );
}
}
@@ -498,8 +496,8 @@ ContextMenuHelper::associateUIConfigurationManagers()
return true;
}
-Image
-ContextMenuHelper::getImageFromCommandURL(
+Image
+ContextMenuHelper::getImageFromCommandURL(
const ::rtl::OUString& aCmdURL,
bool bHiContrast ) const
{
@@ -508,11 +506,11 @@ ContextMenuHelper::getImageFromCommandURL(
ui::ImageType::SIZE_DEFAULT );
if ( bHiContrast )
nImageType |= ui::ImageType::COLOR_HIGHCONTRAST;
-
+
uno::Sequence< uno::Reference< graphic::XGraphic > > aGraphicSeq;
uno::Sequence< ::rtl::OUString > aImageCmdSeq( 1 );
aImageCmdSeq[0] = aCmdURL;
-
+
if ( m_xDocImageMgr.is() )
{
try
@@ -532,7 +530,7 @@ ContextMenuHelper::getImageFromCommandURL(
{
}
}
-
+
if ( m_xModuleImageMgr.is() )
{
try
@@ -557,11 +555,11 @@ ContextMenuHelper::getImageFromCommandURL(
}
rtl::OUString
-ContextMenuHelper::getLabelFromCommandURL(
+ContextMenuHelper::getLabelFromCommandURL(
const ::rtl::OUString& aCmdURL ) const
{
::rtl::OUString aLabel;
-
+
if ( m_xUICommandLabels.is() )
{
try
@@ -596,8 +594,8 @@ ContextMenuHelper::getLabelFromCommandURL(
return aLabel;
}
-void
-ContextMenuHelper::completeMenuProperties(
+void
+ContextMenuHelper::completeMenuProperties(
Menu* pMenu )
{
// Retrieve some settings necessary to display complete context
@@ -605,21 +603,21 @@ ContextMenuHelper::completeMenuProperties(
const StyleSettings& rSettings =
Application::GetSettings().GetStyleSettings();
bool bShowMenuImages( rSettings.GetUseImagesInMenus() );
bool bIsHiContrast( rSettings.GetHighContrastMode() );
-
+
if ( pMenu )
{
uno::Reference< frame::XFrame > xFrame( m_xWeakFrame );
uno::Reference< frame::XDispatchProvider > xDispatchProvider( xFrame,
uno::UNO_QUERY );
-
+
if ( !m_xURLTransformer.is() )
{
- m_xURLTransformer = uno::Reference< util::XURLTransformer >(
+ m_xURLTransformer = uno::Reference< util::XURLTransformer >(
::comphelper::getProcessServiceFactory()->createInstance(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.util.URLTransformer" ))),
uno::UNO_QUERY );
}
-
+
for ( sal_uInt16 nPos = 0; nPos < pMenu->GetItemCount(); nPos++ )
{
sal_uInt16 nId = pMenu->GetItemId( nPos );
@@ -629,7 +627,7 @@ ContextMenuHelper::completeMenuProperties(
if ( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR )
{
::rtl::OUString aCmdURL( pMenu->GetItemCommand( nId ));
-
+
if ( bShowMenuImages )
{
Image aImage;
@@ -647,8 +645,8 @@ ContextMenuHelper::completeMenuProperties(
}
// Use helper to retrieve state of the command URL
- StateEventHelper* pHelper = new
StateEventHelper(
-
xDispatchProvider,
+ StateEventHelper* pHelper = new
StateEventHelper(
+
xDispatchProvider,
m_xURLTransformer,
aCmdURL );
@@ -659,10 +657,9 @@ ContextMenuHelper::completeMenuProperties(
}
}
-
IMPL_STATIC_LINK_NOINSTANCE( ContextMenuHelper, ExecuteHdl_Impl, ExecuteInfo*,
pExecuteInfo )
{
- // Release solar mutex to prevent deadlocks with clipboard thread
+ // Release solar mutex to prevent deadlocks with clipboard thread
const sal_uInt32 nRef = Application::ReleaseSolarMutex();
try
{
@@ -681,3 +678,5 @@ IMPL_STATIC_LINK_NOINSTANCE( ContextMenuHelper,
ExecuteHdl_Impl, ExecuteInfo*, p
}
} // namespace svt
+
+/* vim: set noet sw=4 ts=4: */