You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2024/04/08 15:54:17 UTC
(openoffice) branch AOO42X updated: Maintenance cleanup
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 694cb55c1a Maintenance cleanup
694cb55c1a is described below
commit 694cb55c1a439c3395ae15b8fc78804a3865b6f5
Author: mseidel <ms...@apache.org>
AuthorDate: Mon Apr 8 17:53:09 2024 +0200
Maintenance cleanup
(cherry picked from commit caeabaab393eea3de03af65cb68f7b944d2c9898)
---
.../source/uielement/recentfilesmenucontroller.cxx | 470 ++++++++++-----------
main/sw/source/filter/ww8/rtfexport.hxx | 245 ++++++-----
2 files changed, 357 insertions(+), 358 deletions(-)
diff --git a/main/framework/source/uielement/recentfilesmenucontroller.cxx b/main/framework/source/uielement/recentfilesmenucontroller.cxx
index 3fe04e79d9..74b8af3362 100644
--- a/main/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/main/framework/source/uielement/recentfilesmenucontroller.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_framework.hxx"
@@ -52,7 +50,7 @@ using namespace com::sun::star::util;
static const char SFX_REFERER_USER[] = "private:user";
static const char CMD_CLEAR_LIST[] = ".uno:ClearRecentFileList";
static const char CMD_PREFIX[] = "vnd.sun.star.popup:RecentFileList?entry=";
-static const char MENU_SHOTCUT[] = "~N: ";
+static const char MENU_SHORTCUT[] = "~N: ";
namespace framework
{
@@ -71,17 +69,17 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star
}
};
-DEFINE_XSERVICEINFO_MULTISERVICE ( RecentFilesMenuController ,
- OWeakObject ,
- SERVICENAME_POPUPMENUCONTROLLER ,
+DEFINE_XSERVICEINFO_MULTISERVICE ( RecentFilesMenuController ,
+ OWeakObject ,
+ SERVICENAME_POPUPMENUCONTROLLER ,
IMPLEMENTATIONNAME_RECENTFILESMENUCONTROLLER
)
-DEFINE_INIT_SERVICE ( RecentFilesMenuController, {} )
+DEFINE_INIT_SERVICE ( RecentFilesMenuController, {} )
RecentFilesMenuController::RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
svt::PopupMenuControllerBase( xServiceManager ),
- m_bDisabled( sal_False )
+ m_bDisabled( sal_False )
{
}
@@ -92,74 +90,74 @@ RecentFilesMenuController::~RecentFilesMenuController()
// private function
void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu )
{
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
- PopupMenu* pVCLPopupMenu = 0;
-
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- resetPopupMenu( rPopupMenu );
- if ( pPopupMenu )
- pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- if ( pVCLPopupMenu )
- {
- Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST );
- Reference< XStringWidth > xStringLength( new RecentFilesStringLength );
-
- int nPickListMenuItems = ( aHistoryList.getLength() > MAX_MENU_ITEMS ) ? MAX_MENU_ITEMS : aHistoryList.getLength();
-
- m_aRecentFilesItems.clear();
- if (( nPickListMenuItems > 0 ) && !m_bDisabled )
- {
- for ( int i = 0; i < nPickListMenuItems; i++ )
- {
- Sequence< PropertyValue >& rPickListEntry = aHistoryList[i];
- RecentFile aRecentFile;
-
- for ( int j = 0; j < rPickListEntry.getLength(); j++ )
- {
- Any a = rPickListEntry[j].Value;
-
- if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_URL )
- a >>= aRecentFile.aURL;
- else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_FILTER )
- a >>= aRecentFile.aFilter;
- else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_TITLE )
- a >>= aRecentFile.aTitle;
- else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_PASSWORD )
- a >>= aRecentFile.aPassword;
- }
-
- m_aRecentFilesItems.push_back( aRecentFile );
- }
- }
-
- if ( !m_aRecentFilesItems.empty() )
- {
- const sal_uInt32 nCount = m_aRecentFilesItems.size();
- for ( sal_uInt32 i = 0; i < nCount; i++ )
+ VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
+ PopupMenu* pVCLPopupMenu = 0;
+
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+
+ resetPopupMenu( rPopupMenu );
+ if ( pPopupMenu )
+ pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
+
+ if ( pVCLPopupMenu )
+ {
+ Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST );
+ Reference< XStringWidth > xStringLength( new RecentFilesStringLength );
+
+ int nPickListMenuItems = ( aHistoryList.getLength() > MAX_MENU_ITEMS ) ? MAX_MENU_ITEMS : aHistoryList.getLength();
+
+ m_aRecentFilesItems.clear();
+ if (( nPickListMenuItems > 0 ) && !m_bDisabled )
+ {
+ for ( int i = 0; i < nPickListMenuItems; i++ )
+ {
+ Sequence< PropertyValue >& rPickListEntry = aHistoryList[i];
+ RecentFile aRecentFile;
+
+ for ( int j = 0; j < rPickListEntry.getLength(); j++ )
+ {
+ Any a = rPickListEntry[j].Value;
+
+ if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_URL )
+ a >>= aRecentFile.aURL;
+ else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_FILTER )
+ a >>= aRecentFile.aFilter;
+ else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_TITLE )
+ a >>= aRecentFile.aTitle;
+ else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_PASSWORD )
+ a >>= aRecentFile.aPassword;
+ }
+
+ m_aRecentFilesItems.push_back( aRecentFile );
+ }
+ }
+
+ if ( !m_aRecentFilesItems.empty() )
+ {
+ const sal_uInt32 nCount = m_aRecentFilesItems.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
- rtl::OUStringBuffer aMenuShortCut;
+ rtl::OUStringBuffer aMenuShortCut;
if ( i <= 9 )
{
if ( i == 9 )
- aMenuShortCut.appendAscii( RTL_CONSTASCII_STRINGPARAM( "1~0: " ) );
+ aMenuShortCut.appendAscii( RTL_CONSTASCII_STRINGPARAM( "1~0: " ) );
else
{
- aMenuShortCut.appendAscii( RTL_CONSTASCII_STRINGPARAM( MENU_SHOTCUT ) );
- aMenuShortCut.setCharAt( 1, sal_Unicode( i + '1' ) );
+ aMenuShortCut.appendAscii( RTL_CONSTASCII_STRINGPARAM( MENU_SHORTCUT ) );
+ aMenuShortCut.setCharAt( 1, sal_Unicode( i + '1' ) );
}
}
else
{
- aMenuShortCut.append( sal_Int32( i + 1 ) );
- aMenuShortCut.appendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+ aMenuShortCut.append( sal_Int32( i + 1 ) );
+ aMenuShortCut.appendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
}
- rtl::OUStringBuffer aStrBuffer;
- aStrBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( CMD_PREFIX ) );
- aStrBuffer.append( sal_Int32( i ) );
- rtl::OUString aURLString( aStrBuffer.makeStringAndClear() );
+ rtl::OUStringBuffer aStrBuffer;
+ aStrBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( CMD_PREFIX ) );
+ aStrBuffer.append( sal_Int32( i ) );
+ rtl::OUString aURLString( aStrBuffer.makeStringAndClear() );
// Abbreviate URL
rtl::OUString aTipHelpText;
@@ -170,241 +168,243 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
{
// Do handle file URL differently => convert it to a system
// path and abbreviate it with a special function:
- rtl::OUString aSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
- aTipHelpText = aSystemPath;
+ rtl::OUString aSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
+ aTipHelpText = aSystemPath;
::rtl::OUString aCompactedSystemPath;
- if ( osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, MAX_STR_WIDTH, NULL ) == osl_File_E_None )
- aMenuTitle = aCompactedSystemPath;
+ if ( osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, MAX_STR_WIDTH, NULL ) == osl_File_E_None )
+ aMenuTitle = aCompactedSystemPath;
else
aMenuTitle = aSystemPath;
}
else
{
// Use INetURLObject to abbreviate all other URLs
- aMenuTitle = aURL.getAbbreviated( xStringLength, MAX_STR_WIDTH, INetURLObject::DECODE_UNAMBIGUOUS );
+ aMenuTitle = aURL.getAbbreviated( xStringLength, MAX_STR_WIDTH, INetURLObject::DECODE_UNAMBIGUOUS );
aTipHelpText = aURLString;
}
- aMenuShortCut.append( aMenuTitle );
+ aMenuShortCut.append( aMenuTitle );
- pVCLPopupMenu->InsertItem( sal_uInt16( i+1 ), aMenuShortCut.makeStringAndClear() );
+ pVCLPopupMenu->InsertItem( sal_uInt16( i+1 ), aMenuShortCut.makeStringAndClear() );
pVCLPopupMenu->SetTipHelpText( sal_uInt16( i+1 ), aTipHelpText );
- pVCLPopupMenu->SetItemCommand( sal_uInt16( i+1 ), aURLString );
+ pVCLPopupMenu->SetItemCommand( sal_uInt16( i+1 ), aURLString );
}
- pVCLPopupMenu->InsertSeparator();
- // Clear List menu entry
- pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 1 ),
- String( FwkResId( STR_CLEAR_RECENT_FILES ) ) );
- pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 1 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_CLEAR_LIST ) ) );
- pVCLPopupMenu->SetHelpText( sal_uInt16( nCount + 1 ),
- String( FwkResId( STR_CLEAR_RECENT_FILES_HELP ) ) );
+ pVCLPopupMenu->InsertSeparator();
+ // Clear List menu entry
+ pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 1 ),
+ String( FwkResId( STR_CLEAR_RECENT_FILES ) ) );
+ pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 1 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_CLEAR_LIST ) ) );
+ pVCLPopupMenu->SetHelpText( sal_uInt16( nCount + 1 ),
+ String( FwkResId( STR_CLEAR_RECENT_FILES_HELP ) ) );
+ }
+ else
+ {
+ // No recent documents => insert "no document" string
+ pVCLPopupMenu->InsertItem( 1, String( FwkResId( STR_NODOCUMENT ) ) );
+ // Do not disable it, otherwise the Toolbar controller and MenuButton
+ // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
+ pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MIB_NOSELECT );
}
- else
- {
- // No recent documents => insert "no document" string
- pVCLPopupMenu->InsertItem( 1, String( FwkResId( STR_NODOCUMENT ) ) );
- // Do not disable it, otherwise the Toolbar controller and MenuButton
- // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
- pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MIB_NOSELECT );
- }
}
}
void RecentFilesMenuController::executeEntry( sal_Int32 nIndex )
{
- static int NUM_OF_PICKLIST_ARGS = 3;
-
- Reference< XDispatch > xDispatch;
- Reference< XDispatchProvider > xDispatchProvider;
- css::util::URL aTargetURL;
- Sequence< PropertyValue > aArgsList;
-
- osl::ClearableMutexGuard aLock( m_aMutex );
- xDispatchProvider = Reference< XDispatchProvider >( m_xFrame, UNO_QUERY );
- aLock.clear();
-
- if (( nIndex >= 0 ) &&
- ( nIndex < sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() )))
- {
- const RecentFile& rRecentFile = m_aRecentFilesItems[ nIndex ];
-
- aTargetURL.Complete = rRecentFile.aURL;
- m_xURLTransformer->parseStrict( aTargetURL );
-
- aArgsList.realloc( NUM_OF_PICKLIST_ARGS );
- aArgsList[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
- aArgsList[0].Value = makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER )));
-
- // documents in the picklist will never be opened as templates
- aArgsList[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate" ));
- aArgsList[1].Value = makeAny( (sal_Bool) sal_False );
-
- ::rtl::OUString aFilter( rRecentFile.aFilter );
- sal_Int32 nPos = aFilter.indexOf( '|' );
- if ( nPos >= 0 )
- {
- ::rtl::OUString aFilterOptions;
-
- if ( nPos < ( aFilter.getLength() - 1 ) )
- aFilterOptions = aFilter.copy( nPos+1 );
-
- aArgsList[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
- aArgsList[2].Value <<= aFilterOptions;
-
- aFilter = aFilter.copy( 0, nPos-1 );
- aArgsList.realloc( ++NUM_OF_PICKLIST_ARGS );
- }
-
- aArgsList[NUM_OF_PICKLIST_ARGS-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
- aArgsList[NUM_OF_PICKLIST_ARGS-1].Value <<= aFilter;
-
- xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ), 0 );
- }
-
- if ( xDispatch.is() )
- {
- // Call dispatch asynchronously as we can be destroyed while dispatch is
- // executed. VCL is not able to survive this as it wants to call listeners
- // after select!!!
- LoadRecentFile* pLoadRecentFile = new LoadRecentFile;
- pLoadRecentFile->xDispatch = xDispatch;
- pLoadRecentFile->aTargetURL = aTargetURL;
- pLoadRecentFile->aArgSeq = aArgsList;
-
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RecentFilesMenuController"))).log(m_xServiceManager, m_xFrame, aTargetURL, aArgsList);
-
- Application::PostUserEvent( STATIC_LINK(0, RecentFilesMenuController, ExecuteHdl_Impl), pLoadRecentFile );
- }
+ static int NUM_OF_PICKLIST_ARGS = 3;
+
+ Reference< XDispatch > xDispatch;
+ Reference< XDispatchProvider > xDispatchProvider;
+ css::util::URL aTargetURL;
+ Sequence< PropertyValue > aArgsList;
+
+ osl::ClearableMutexGuard aLock( m_aMutex );
+ xDispatchProvider = Reference< XDispatchProvider >( m_xFrame, UNO_QUERY );
+ aLock.clear();
+
+ if (( nIndex >= 0 ) &&
+ ( nIndex < sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() )))
+ {
+ const RecentFile& rRecentFile = m_aRecentFilesItems[ nIndex ];
+
+ aTargetURL.Complete = rRecentFile.aURL;
+ m_xURLTransformer->parseStrict( aTargetURL );
+
+ aArgsList.realloc( NUM_OF_PICKLIST_ARGS );
+ aArgsList[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
+ aArgsList[0].Value = makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER )));
+
+ // documents in the picklist will never be opened as templates
+ aArgsList[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate" ));
+ aArgsList[1].Value = makeAny( (sal_Bool) sal_False );
+
+ ::rtl::OUString aFilter( rRecentFile.aFilter );
+ sal_Int32 nPos = aFilter.indexOf( '|' );
+ if ( nPos >= 0 )
+ {
+ ::rtl::OUString aFilterOptions;
+
+ if ( nPos < ( aFilter.getLength() - 1 ) )
+ aFilterOptions = aFilter.copy( nPos+1 );
+
+ aArgsList[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
+ aArgsList[2].Value <<= aFilterOptions;
+
+ aFilter = aFilter.copy( 0, nPos-1 );
+ aArgsList.realloc( ++NUM_OF_PICKLIST_ARGS );
+ }
+
+ aArgsList[NUM_OF_PICKLIST_ARGS-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
+ aArgsList[NUM_OF_PICKLIST_ARGS-1].Value <<= aFilter;
+
+ xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ), 0 );
+ }
+
+ if ( xDispatch.is() )
+ {
+ // Call dispatch asynchronously as we can be destroyed while dispatch is
+ // executed. VCL is not able to survive this as it wants to call listeners
+ // after select!!!
+ LoadRecentFile* pLoadRecentFile = new LoadRecentFile;
+ pLoadRecentFile->xDispatch = xDispatch;
+ pLoadRecentFile->aTargetURL = aTargetURL;
+ pLoadRecentFile->aArgSeq = aArgsList;
+
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RecentFilesMenuController"))).log(m_xServiceManager, m_xFrame, aTargetURL, aArgsList);
+
+ Application::PostUserEvent( STATIC_LINK(0, RecentFilesMenuController, ExecuteHdl_Impl), pLoadRecentFile );
+ }
}
// XEventListener
void SAL_CALL RecentFilesMenuController::disposing( const EventObject& ) throw ( RuntimeException )
{
- Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
+ Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- osl::MutexGuard aLock( m_aMutex );
- m_xFrame.clear();
- m_xDispatch.clear();
- m_xServiceManager.clear();
+ osl::MutexGuard aLock( m_aMutex );
+ m_xFrame.clear();
+ m_xDispatch.clear();
+ m_xServiceManager.clear();
- if ( m_xPopupMenu.is() )
- m_xPopupMenu->removeMenuListener( Reference< css::awt::XMenuListener >(( OWeakObject *)this, UNO_QUERY ));
- m_xPopupMenu.clear();
+ if ( m_xPopupMenu.is() )
+ m_xPopupMenu->removeMenuListener( Reference< css::awt::XMenuListener >(( OWeakObject *)this, UNO_QUERY ));
+ m_xPopupMenu.clear();
}
// XStatusListener
void SAL_CALL RecentFilesMenuController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException )
{
- osl::MutexGuard aLock( m_aMutex );
- m_bDisabled = !Event.IsEnabled;
+ osl::MutexGuard aLock( m_aMutex );
+ m_bDisabled = !Event.IsEnabled;
}
void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
- Reference< css::awt::XPopupMenu > xPopupMenu;
-
- osl::ClearableMutexGuard aLock( m_aMutex );
- xPopupMenu = m_xPopupMenu;
- aLock.clear();
-
- if ( xPopupMenu.is() )
- {
- const rtl::OUString aCommand( xPopupMenu->getCommand( rEvent.MenuId ) );
- OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s",
- rtl::OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
-
- if ( aCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_CLEAR_LIST ) ) )
- SvtHistoryOptions().Clear( ePICKLIST );
- else
- executeEntry( rEvent.MenuId-1 );
- }
+ Reference< css::awt::XPopupMenu > xPopupMenu;
+
+ osl::ClearableMutexGuard aLock( m_aMutex );
+ xPopupMenu = m_xPopupMenu;
+ aLock.clear();
+
+ if ( xPopupMenu.is() )
+ {
+ const rtl::OUString aCommand( xPopupMenu->getCommand( rEvent.MenuId ) );
+ OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s",
+ rtl::OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
+
+ if ( aCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_CLEAR_LIST ) ) )
+ SvtHistoryOptions().Clear( ePICKLIST );
+ else
+ executeEntry( rEvent.MenuId-1 );
+ }
}
void SAL_CALL RecentFilesMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- osl::MutexGuard aLock( m_aMutex );
- impl_setPopupMenu();
+ osl::MutexGuard aLock( m_aMutex );
+ impl_setPopupMenu();
}
// XPopupMenuController
void RecentFilesMenuController::impl_setPopupMenu()
{
- if ( m_xPopupMenu.is() )
- fillPopupMenu( m_xPopupMenu );
+ if ( m_xPopupMenu.is() )
+ fillPopupMenu( m_xPopupMenu );
}
// XDispatchProvider
Reference< XDispatch > SAL_CALL RecentFilesMenuController::queryDispatch(
- const URL& aURL,
- const ::rtl::OUString& /*sTarget*/,
- sal_Int32 /*nFlags*/ )
+ const URL& aURL,
+ const ::rtl::OUString& /*sTarget*/,
+ sal_Int32 /*nFlags*/ )
throw( RuntimeException )
{
- osl::MutexGuard aLock( m_aMutex );
+ osl::MutexGuard aLock( m_aMutex );
throwIfDisposed();
- if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
- return Reference< XDispatch >( static_cast< OWeakObject* >( this ), UNO_QUERY );
- else
- return Reference< XDispatch >();
+ if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
+ return Reference< XDispatch >( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ else
+ return Reference< XDispatch >();
}
// XDispatch
void SAL_CALL RecentFilesMenuController::dispatch(
- const URL& aURL,
- const Sequence< PropertyValue >& /*seqProperties*/ )
+ const URL& aURL,
+ const Sequence< PropertyValue >& /*seqProperties*/ )
throw( RuntimeException )
{
- osl::MutexGuard aLock( m_aMutex );
+ osl::MutexGuard aLock( m_aMutex );
throwIfDisposed();
- if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
- {
- // Parse URL to retrieve entry argument and its value
- sal_Int32 nQueryPart = aURL.Complete.indexOf( '?', m_aBaseURL.getLength() );
- if ( nQueryPart > 0 )
- {
- const rtl::OUString aEntryArgStr( RTL_CONSTASCII_USTRINGPARAM( "entry=" ));
- sal_Int32 nEntryArg = aURL.Complete.indexOf( aEntryArgStr, nQueryPart );
- sal_Int32 nEntryPos = nEntryArg + aEntryArgStr.getLength();
- if (( nEntryArg > 0 ) && ( nEntryPos < aURL.Complete.getLength() ))
- {
- sal_Int32 nAddArgs = aURL.Complete.indexOf( '&', nEntryPos );
- rtl::OUString aEntryArg;
-
- if ( nAddArgs < 0 )
- aEntryArg = aURL.Complete.copy( nEntryPos );
- else
- aEntryArg = aURL.Complete.copy( nEntryPos, nAddArgs-nEntryPos );
-
- sal_Int32 nEntry = aEntryArg.toInt32();
- executeEntry( nEntry );
- }
- }
- }
+ if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
+ {
+ // Parse URL to retrieve entry argument and its value
+ sal_Int32 nQueryPart = aURL.Complete.indexOf( '?', m_aBaseURL.getLength() );
+ if ( nQueryPart > 0 )
+ {
+ const rtl::OUString aEntryArgStr( RTL_CONSTASCII_USTRINGPARAM( "entry=" ));
+ sal_Int32 nEntryArg = aURL.Complete.indexOf( aEntryArgStr, nQueryPart );
+ sal_Int32 nEntryPos = nEntryArg + aEntryArgStr.getLength();
+ if (( nEntryArg > 0 ) && ( nEntryPos < aURL.Complete.getLength() ))
+ {
+ sal_Int32 nAddArgs = aURL.Complete.indexOf( '&', nEntryPos );
+ rtl::OUString aEntryArg;
+
+ if ( nAddArgs < 0 )
+ aEntryArg = aURL.Complete.copy( nEntryPos );
+ else
+ aEntryArg = aURL.Complete.copy( nEntryPos, nAddArgs-nEntryPos );
+
+ sal_Int32 nEntry = aEntryArg.toInt32();
+ executeEntry( nEntry );
+ }
+ }
+ }
}
IMPL_STATIC_LINK_NOINSTANCE( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile*, pLoadRecentFile )
{
- try
- {
- // Asynchronous execution as this can lead to our own destruction!
- // Framework can recycle our current frame and the layout manager disposes all user interface
- // elements if a component gets detached from its frame!
- pLoadRecentFile->xDispatch->dispatch( pLoadRecentFile->aTargetURL, pLoadRecentFile->aArgSeq );
- }
- catch ( Exception& )
- {
- }
-
- delete pLoadRecentFile;
- return 0;
+ try
+ {
+ // Asynchronous execution as this can lead to our own destruction!
+ // Framework can recycle our current frame and the layout manager disposes all user interface
+ // elements if a component gets detached from its frame!
+ pLoadRecentFile->xDispatch->dispatch( pLoadRecentFile->aTargetURL, pLoadRecentFile->aArgSeq );
+ }
+ catch ( Exception& )
+ {
+ }
+
+ delete pLoadRecentFile;
+ return 0;
}
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/filter/ww8/rtfexport.hxx b/main/sw/source/filter/ww8/rtfexport.hxx
index 8cc1892988..b35af1585a 100644
--- a/main/sw/source/filter/ww8/rtfexport.hxx
+++ b/main/sw/source/filter/ww8/rtfexport.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,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.
- *
+ *
*************************************************************/
-
-
#ifndef _RTFEXPORT_HXX_
#define _RTFEXPORT_HXX_
@@ -51,163 +49,164 @@ class SvStream;
inline SvStream& operator<<( SvStream& s, const rtl::OString r) { return (s << r.getStr()); }
namespace com { namespace sun { namespace star {
- namespace frame { class XModel; }
-} } }
+ namespace frame { class XModel; }
+} } }
-/// The class that does all the actual RTF export-related work.
+// The class that does all the actual RTF export-related work.
class RtfExport : public MSWordExportBase
{
- /// Pointer to the filter that owns us.
- RtfExportFilter *m_pFilter;
- Writer* m_pWriter;
+ // Pointer to the filter that owns us.
+ RtfExportFilter *m_pFilter;
+ Writer* m_pWriter;
- /// Attribute output for document.
- RtfAttributeOutput *m_pAttrOutput;
+ // Attribute output for document.
+ RtfAttributeOutput *m_pAttrOutput;
- /// Sections/headers/footers
- MSWordSections *m_pSections;
+ // Sections/headers/footers
+ MSWordSections *m_pSections;
- RtfSdrExport *m_pSdrExport;
+ RtfSdrExport *m_pSdrExport;
public:
- /// Access to the attribute output class.
- virtual AttributeOutputBase& AttrOutput() const;
+ // Access to the attribute output class.
+ virtual AttributeOutputBase& AttrOutput() const;
+
+ // Access to the sections/headers/footers.
+ virtual MSWordSections& Sections() const;
- /// Access to the sections/headers/footres.
- virtual MSWordSections& Sections() const;
+ // Access to the Rtf Sdr exporter.
+ virtual RtfSdrExport& SdrExporter() const;
- /// Access to the Rtf Sdr exporter.
- virtual RtfSdrExport& SdrExporter() const;
+ // Hack, unfortunately necessary at some places for now.
+ virtual bool HackIsWW8OrHigher() const;
- /// Hack, unfortunately necessary at some places for now.
- virtual bool HackIsWW8OrHigher() const;
+ // Guess the script (asian/western).
+ virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
- /// Guess the script (asian/western).
- virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
+ virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen );
- virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen );
+ virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
- virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+ // For i120928,add an interface to export graphic of bullet
+ virtual void ExportGrfBullet(const SwTxtNode& rNd);
- //For i120928,add an interface to export graphic of bullet
- virtual void ExportGrfBullet(const SwTxtNode& rNd);
+ virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ }
+ virtual void WriteChar( sal_Unicode );
- virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ }
- virtual void WriteChar( sal_Unicode );
+ // Write the numbering table.
+ virtual void WriteNumbering();
- /// Write the numbering table.
- virtual void WriteNumbering();
+ // Write the revision table.
+ virtual void WriteRevTab();
- /// Write the revision table.
- virtual void WriteRevTab();
+ // Output the actual headers and footers.
+ virtual void WriteHeadersFooters( sal_uInt8 nHeadFootFlags,
+ const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, sal_uInt8 nBreakCode );
- /// Output the actual headers and footers.
- virtual void WriteHeadersFooters( sal_uInt8 nHeadFootFlags,
- const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, sal_uInt8 nBreakCode );
+ // Write the field
+ virtual void OutputField( const SwField* pFld, ww::eField eFldType,
+ const String& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL );
- /// Write the field
- virtual void OutputField( const SwField* pFld, ww::eField eFldType,
- const String& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL );
+ // Write the data of the form field
+ virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
+ virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark );
- /// Write the data of the form field
- virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
- virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark );
-
- virtual void DoComboBox(const rtl::OUString &rName,
- const rtl::OUString &rHelp,
- const rtl::OUString &ToolTip,
- const rtl::OUString &rSelected,
- com::sun::star::uno::Sequence<rtl::OUString> &rListItems);
+ virtual void DoComboBox(const rtl::OUString &rName,
+ const rtl::OUString &rHelp,
+ const rtl::OUString &ToolTip,
+ const rtl::OUString &rSelected,
+ com::sun::star::uno::Sequence<rtl::OUString> &rListItems);
- virtual void DoFormText(const SwInputField * pFld);
-
- virtual sal_uLong ReplaceCr( sal_uInt8 nChar );
+ virtual void DoFormText(const SwInputField * pFld);
+
+ virtual sal_uLong ReplaceCr( sal_uInt8 nChar );
protected:
- /// Format-dependant part of the actual export.
- virtual void ExportDocument_Impl();
+ // Format-dependent part of the actual export.
+ virtual void ExportDocument_Impl();
- virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {}
+ virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {}
- /// Get ready for a new section.
- virtual void PrepareNewPageDesc( const SfxItemSet* pSet,
- const SwNode& rNd,
- const SwFmtPageDesc* pNewPgDescFmt = 0,
- const SwPageDesc* pNewPgDesc = 0 );
+ // Get ready for a new section.
+ virtual void PrepareNewPageDesc( const SfxItemSet* pSet,
+ const SwNode& rNd,
+ const SwFmtPageDesc* pNewPgDescFmt = 0,
+ const SwPageDesc* pNewPgDesc = 0 );
- /// Return value indicates if an inherited outline numbering is suppressed.
- virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt);
+ // Return value indicates if an inherited outline numbering is suppressed.
+ virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt);
- /// Output SwGrfNode
- virtual void OutputGrfNode( const SwGrfNode& );
+ // Output SwGrfNode
+ virtual void OutputGrfNode( const SwGrfNode& );
- /// Output SwOLENode
- virtual void OutputOLENode( const SwOLENode& );
+ // Output SwOLENode
+ virtual void OutputOLENode( const SwOLENode& );
- virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, sal_uLong nLnNum );
+ virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, sal_uLong nLnNum );
public:
- /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class.
- RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument,
- SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter );
+ // Pass the pDocument, pCurrentPam and pOriginalPam to the base class.
+ RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument,
+ SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter );
- /// Destructor.
- virtual ~RtfExport();
+ // Destructor.
+ virtual ~RtfExport();
#if defined(UNX)
- static const sal_Char sNewLine; // \012 or \015
+ static const sal_Char sNewLine; // \012 or \015
#else
- static const sal_Char __FAR_DATA sNewLine[]; // \015\012
+ static const sal_Char __FAR_DATA sNewLine[]; // \015\012
#endif
- rtl_TextEncoding eDefaultEncoding;
- rtl_TextEncoding eCurrentEncoding;
- /// This is used by OutputFlyFrame_Impl() to control the written syntax
- bool bRTFFlySyntax;
-
- sal_Bool m_bOutStyleTab : 1;
- SvStream& Strm();
- SvStream& OutULong( sal_uLong nVal );
- SvStream& OutLong( long nVal );
- void OutUnicode(const sal_Char *pToken, const String &rContent);
- void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT );
- static rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc);
- static rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc);
- static rtl::OString OutHex(sal_uLong nHex, sal_uInt8 nLen);
- void OutPageDescription( const SwPageDesc& rPgDsc, sal_Bool bWriteReset, sal_Bool bCheckForFirstPage );
-
- sal_uInt16 GetColor( const Color& rColor ) const;
- void InsColor( const Color& rCol );
- void InsColorLine( const SvxBoxItem& rBox );
- void OutColorTable();
- sal_uInt16 GetRedline( const String& rAuthor );
- const String* GetRedline( sal_uInt16 nId );
-
- void InsStyle( sal_uInt16 nId, const rtl::OString& rStyle );
- rtl::OString* GetStyle( sal_uInt16 nId );
+ rtl_TextEncoding eDefaultEncoding;
+ rtl_TextEncoding eCurrentEncoding;
+ // This is used by OutputFlyFrame_Impl() to control the written syntax
+ bool bRTFFlySyntax;
+
+ sal_Bool m_bOutStyleTab : 1;
+ SvStream& Strm();
+ SvStream& OutULong( sal_uLong nVal );
+ SvStream& OutLong( long nVal );
+ void OutUnicode(const sal_Char *pToken, const String &rContent);
+ void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT );
+ static rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc);
+ static rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc);
+ static rtl::OString OutHex(sal_uLong nHex, sal_uInt8 nLen);
+ void OutPageDescription( const SwPageDesc& rPgDsc, sal_Bool bWriteReset, sal_Bool bCheckForFirstPage );
+
+ sal_uInt16 GetColor( const Color& rColor ) const;
+ void InsColor( const Color& rCol );
+ void InsColorLine( const SvxBoxItem& rBox );
+ void OutColorTable();
+ sal_uInt16 GetRedline( const String& rAuthor );
+ const String* GetRedline( sal_uInt16 nId );
+
+ void InsStyle( sal_uInt16 nId, const rtl::OString& rStyle );
+ rtl::OString* GetStyle( sal_uInt16 nId );
private:
- /// No copying.
- RtfExport( const RtfExport& );
-
- /// No copying.
- RtfExport& operator=( const RtfExport& );
-
- void WriteFonts();
- void WriteStyles();
- void WriteMainText();
- void WriteInfo();
- /// Writes the writer-specific \pgdsctbl group.
- void WritePageDescTable();
- /// This is necessary to have the numbering table ready before the main text is being processed.
- void BuildNumbering();
- void WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader);
- void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr);
-
- RtfColorTbl m_aColTbl;
- RtfStyleTbl m_aStyTbl;
- RtfRedlineTbl m_aRedlineTbl;
+ // No copying.
+ RtfExport( const RtfExport& );
+
+ // No copying.
+ RtfExport& operator=( const RtfExport& );
+
+ void WriteFonts();
+ void WriteStyles();
+ void WriteMainText();
+ void WriteInfo();
+ // Writes the writer-specific \pgdsctbl group.
+ void WritePageDescTable();
+ // This is necessary to have the numbering table ready before the main text is being processed.
+ void BuildNumbering();
+ void WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader);
+ void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr);
+
+ RtfColorTbl m_aColTbl;
+ RtfStyleTbl m_aStyTbl;
+ RtfRedlineTbl m_aRedlineTbl;
};
#endif // _RTFEXPORT_HXX_
-/* vi:set shiftwidth=4 expandtab: */
+
+/* vim: set noet sw=4 ts=4: */