summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-11-02 13:19:49 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-11-02 13:19:49 +0100
commit8a329b45c0c7592b69f3ee720abb7b9962dd5023 (patch)
treec93bdb5d26e38f2e01abae70b8cef2010d0d06f1 /sfx2
parent8241bf7c831b07bc19509387f1514c42bc5624c1 (diff)
undoapi: allow retrieving the count/comments of Undo/Redo actions both on the current and the top level
Diffstat (limited to 'sfx2')
-rwxr-xr-xsfx2/qa/complex/sfx2/UndoManager.java75
-rwxr-xr-xsfx2/source/doc/docundomanager.cxx90
-rwxr-xr-xsfx2/source/inc/docundomanager.hxx4
3 files changed, 119 insertions, 50 deletions
diff --git a/sfx2/qa/complex/sfx2/UndoManager.java b/sfx2/qa/complex/sfx2/UndoManager.java
index e6cc11dc470d..eecceb5753f8 100755
--- a/sfx2/qa/complex/sfx2/UndoManager.java
+++ b/sfx2/qa/complex/sfx2/UndoManager.java
@@ -68,36 +68,42 @@ import org.openoffice.test.OfficeConnection;
*/
public class UndoManager
{
+ // -----------------------------------------------------------------------------------------------------------------
@Before
public void beforeTest()
{
m_currentDocument = null;
}
+ // -----------------------------------------------------------------------------------------------------------------
@Test
public void checkWriterUndo() throws Exception
{
impl_checkUndo( WriterDocumentTest.class, true );
}
+ // -----------------------------------------------------------------------------------------------------------------
@Test
public void checkCalcUndo() throws Exception
{
impl_checkUndo( CalcDocumentTest.class, false );
}
+ // -----------------------------------------------------------------------------------------------------------------
@Test
public void checkDrawUndo() throws Exception
{
impl_checkUndo( DrawDocumentTest.class, false );
}
+ // -----------------------------------------------------------------------------------------------------------------
@Test
public void checkImpressUndo() throws Exception
{
impl_checkUndo( ImpressDocumentTest.class, false );
}
+ // -----------------------------------------------------------------------------------------------------------------
@After
public void afterTest()
{
@@ -105,6 +111,7 @@ public class UndoManager
m_currentDocument.close();
}
+ // -----------------------------------------------------------------------------------------------------------------
/**
* returns the undo manager belonging to a given document
* @return
@@ -115,6 +122,7 @@ public class UndoManager
return suppUndo.getUndoManager();
}
+ // -----------------------------------------------------------------------------------------------------------------
private static class UndoListener implements XUndoManagerListener
{
public void undoActionAdded( UndoManagerEvent i_event )
@@ -236,6 +244,7 @@ public class UndoManager
private String m_mostRecentlyRedone = null;
};
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_checkUndo( final Class i_testClass, final boolean i_fakeTestForNow ) throws Exception
{
final Constructor ctor = i_testClass.getConstructor( XMultiServiceFactory.class );
@@ -287,6 +296,7 @@ public class UndoManager
m_currentDocument = null;
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testSingleModification( final DocumentTest i_test, final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_test.doSingleModification();
@@ -315,6 +325,7 @@ public class UndoManager
assertEquals( "UI-Undo does not notify the listener", 2, i_listener.getUndoActionCount() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testMultipleModifications( final DocumentTest i_test, final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_listener.reset();
@@ -342,6 +353,7 @@ public class UndoManager
i_test.verifyInitialDocumentState();
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testCustomUndoActions( final DocumentTest i_test, final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.clear();
@@ -400,6 +412,7 @@ public class UndoManager
assertTrue( action1.disposed() && action2.disposed() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testLocking( final DocumentTest i_test, final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.reset();
@@ -440,30 +453,66 @@ public class UndoManager
assertTrue( "unlocking the manager when it is not locked should throw", caughtExpected );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testContextHandling( final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
+ // .............................................................................................................
+ // part I: non-empty contexts
i_undoManager.reset();
i_listener.reset();
+ // put one action on the undo and one on the redo stack, as precondition for the following tests
+ XUndoAction undoAction1 = new CustomUndoAction( "Undo Action 1" );
+ i_undoManager.addUndoAction( undoAction1 );
+ XUndoAction undoAction2 = new CustomUndoAction( "Undo Action 2" );
+ i_undoManager.addUndoAction( undoAction2 );
+ i_undoManager.undo();
+ assertTrue( "precondition for context handling tests not met (1)", i_undoManager.isUndoPossible() );
+ assertTrue( "precondition for context handling tests not met (2)", i_undoManager.isRedoPossible() );
+ assertArrayEquals( new String[] { undoAction1.getTitle() }, i_undoManager.getAllUndoActionTitles() );
+ assertArrayEquals( new String[] { undoAction2.getTitle() }, i_undoManager.getAllRedoActionTitles() );
+
+ // enter a context, add a single action
i_undoManager.enterUndoContext( "Undo Context" );
assertEquals( "unexpected undo context depth after entering a context", 1, i_listener.getUndoContextDepth() );
- i_undoManager.addUndoAction( new CustomUndoAction() );
+ XUndoAction undoAction3 = new CustomUndoAction( "Undo Action 3" );
+ i_undoManager.addUndoAction( undoAction3 );
+
+ // while the context is open, its title should already contribute to the stack, ...
+ assertEquals( "Undo Context", i_undoManager.getCurrentUndoActionTitle() );
+ // ... getAllUndo/RedoActionTitles should operate on the top level, not on the level defined by the open
+ // context, ...
+ assertArrayEquals( new String[] { "Undo Context", undoAction1.getTitle() },
+ i_undoManager.getAllUndoActionTitles() );
+ assertArrayEquals( new String[] {}, i_undoManager.getAllRedoActionTitles() );
+ // (the redo stack has been cleared when a new context was entered)
+ // ... but Undo and Redo should be impossible as long as the context is open
+ assertFalse( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+
+ // leave the context, check the listener has been notified properly, and the notified context depth is correct
i_undoManager.leaveUndoContext();
- assertTrue( "leaving a non-empty context does not call leftUndoContext", i_listener.contextLeft() );
- assertFalse( "leaving a non-empty context should not call cancelledUndoContext", i_listener.contextCancelled() );
+ assertTrue( i_listener.contextLeft() );
+ assertFalse( i_listener.hiddenContextLeft() );
+ assertFalse( i_listener.contextCancelled() );
assertEquals( "unexpected undo context depth leaving a non-empty context", 0, i_listener.getUndoContextDepth() );
+ // .............................................................................................................
+ // part II: empty contexts
i_undoManager.reset();
i_listener.reset();
+ // enter a context, leave it immediately without adding an action to it
i_undoManager.enterUndoContext( "Undo Context" );
i_undoManager.leaveUndoContext();
- assertFalse( "leaving an empty context should not call leftUndoContext", i_listener.contextLeft() );
- assertTrue( "leaving an empty context does not call cancelledUndoContext", i_listener.contextCancelled() );
+ assertFalse( i_listener.contextLeft() );
+ assertFalse( i_listener.hiddenContextLeft() );
+ assertTrue( i_listener.contextCancelled() );
assertFalse( "leaving an empty context should silently remove it, and not contribute to the stack",
i_undoManager.isUndoPossible() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testNestedContexts( final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.reset();
@@ -491,6 +540,7 @@ public class UndoManager
assertTrue( "nested actions not properly undone", action1.undoCalled() && action2.undoCalled() && action3.undoCalled() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testErrorHandling( final DocumentTest i_test, final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.reset();
@@ -604,13 +654,15 @@ public class UndoManager
}
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testStackHandling( final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.reset();
i_listener.reset();
- assertFalse( i_undoManager.isUndoPossible() ); // just for completeness, those two
- assertFalse( i_undoManager.isRedoPossible() ); // have been checked before already ...
+ assertFalse( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+
i_undoManager.addUndoAction( new CustomUndoAction() );
assertTrue( i_undoManager.isUndoPossible() );
assertFalse( i_undoManager.isRedoPossible() );
@@ -628,6 +680,7 @@ public class UndoManager
assertFalse( "adding a new action should have cleared the Redo stack", i_undoManager.isRedoPossible() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testClearance( final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.reset();
@@ -689,13 +742,14 @@ public class UndoManager
assertEquals( "seems that |reset| did not really close the open contexts", 1, i_listener.getUndoContextDepth() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private void impl_testHiddenContexts( final XUndoManager i_undoManager, final UndoListener i_listener ) throws com.sun.star.uno.Exception
{
i_undoManager.reset();
i_listener.reset();
+ assertFalse( "precondition for testing hidden undo contexts not met", i_undoManager.isUndoPossible() );
// entering a hidden context should be rejected if the stack is empty
- assertFalse( "precondition for testing hidden undo contexts not met", i_undoManager.isUndoPossible() );
boolean caughtExpected = false;
try { i_undoManager.enterHiddenUndoContext(); }
catch ( final EmptyUndoStackException e ) { caughtExpected = true; }
@@ -771,11 +825,13 @@ public class UndoManager
assertTrue( action3.undoCalled() );
}
+ // -----------------------------------------------------------------------------------------------------------------
private XComponentContext getContext()
{
return m_connection.getComponentContext();
}
+ // -----------------------------------------------------------------------------------------------------------------
private XMultiServiceFactory getORB()
{
final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(
@@ -783,6 +839,7 @@ public class UndoManager
return xMSF1;
}
+ // -----------------------------------------------------------------------------------------------------------------
@BeforeClass
public static void setUpConnection() throws Exception
{
@@ -792,6 +849,7 @@ public class UndoManager
m_connection.setUp();
}
+ // -----------------------------------------------------------------------------------------------------------------
@AfterClass
public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception
{
@@ -802,6 +860,7 @@ public class UndoManager
System.out.println( "--------------------------------------------------------------------------------" );
}
+ // -----------------------------------------------------------------------------------------------------------------
private static class CustomUndoAction implements XUndoAction, XComponent
{
CustomUndoAction()
diff --git a/sfx2/source/doc/docundomanager.cxx b/sfx2/source/doc/docundomanager.cxx
index 7318a7a9c13a..d326e584c45a 100755
--- a/sfx2/source/doc/docundomanager.cxx
+++ b/sfx2/source/doc/docundomanager.cxx
@@ -78,6 +78,8 @@ namespace sfx2
using ::com::sun::star::document::XUndoManager;
/** === end UNO using === **/
+ using ::svl::IUndoManager;
+
//==================================================================================================================
//= UndoActionWrapper
//==================================================================================================================
@@ -160,7 +162,7 @@ namespace sfx2
struct DocumentUndoManager_Impl : public SfxUndoListener
{
::cppu::OInterfaceContainerHelper aUndoListeners;
- ::svl::IUndoManager* pUndoManager;
+ IUndoManager* pUndoManager;
DocumentUndoManager& rAntiImpl;
bool bAPIActionRunning;
::std::stack< bool > aContextVisibilities;
@@ -190,7 +192,7 @@ namespace sfx2
SfxObjectShell* getObjectShell() { return rAntiImpl.getBaseModel().GetObjectShell(); }
//..............................................................................................................
- ::svl::IUndoManager& getUndoManager()
+ IUndoManager& getUndoManager()
{
ENSURE_OR_THROW( pUndoManager != NULL, "DocumentUndoManager_Impl::getUndoManager: no access to the doc's UndoManager implementation!" );
@@ -253,12 +255,12 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( rAntiImpl );
- ::svl::IUndoManager& rUndoManager = getUndoManager();
+ IUndoManager& rUndoManager = getUndoManager();
if ( !rUndoManager.IsUndoEnabled() )
// ignore this request if the manager is locked
return;
- if ( i_hidden && ( rUndoManager.GetUndoActionCount() == 0 ) )
+ if ( i_hidden && ( rUndoManager.GetUndoActionCount( IUndoManager::CurrentLevel ) == 0 ) )
throw EmptyUndoStackException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "can't enter a hidden context without a previous Undo action" ) ),
static_cast< XUndoManager* >( &rAntiImpl )
@@ -345,7 +347,7 @@ namespace sfx2
if ( bAPIActionRunning )
return;
- rAntiImpl.impl_notify( pUndoManager->GetUndoActionComment(), &XUndoManagerListener::leftContext );
+ rAntiImpl.impl_notify( pUndoManager->GetUndoActionComment( 0, IUndoManager::CurrentLevel ), &XUndoManagerListener::leftContext );
}
//------------------------------------------------------------------------------------------------------------------
@@ -375,7 +377,7 @@ namespace sfx2
if ( bAPIActionRunning )
return;
- rAntiImpl.impl_notify( pUndoManager->GetUndoActionComment(), &XUndoManagerListener::cancelledContext );
+ rAntiImpl.impl_notify( ::rtl::OUString(), &XUndoManagerListener::cancelledContext );
}
//------------------------------------------------------------------------------------------------------------------
@@ -453,7 +455,7 @@ namespace sfx2
aEvent.UndoContextDepth = m_pImpl->getUndoManager().GetListActionDepth();
// TODO: this notification method here is used by DocumentUndoManager_Impl, to multiplex the notifications we
- // receive from the ::svl::IUndoManager. Those notitications are sent with a locked SolarMutex, which means
+ // receive from the IUndoManager. Those notitications are sent with a locked SolarMutex, which means
// we're doing the multiplexing here with a locked SM, too. Which is Bad (TM).
// Fixing this properly would require outsourcing all the notifications into an own thread - which might lead
// to problems of its own, since clients might expect synchronous notifications.
@@ -490,7 +492,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( !rUndoManager.IsUndoEnabled() )
// ignore this request if the manager is locked
return;
@@ -516,11 +518,10 @@ namespace sfx2
if ( nContextElements == 0 )
impl_notify( ::rtl::OUString(), &XUndoManagerListener::cancelledContext, aGuard );
- // TODO: obtain the title of the context which has just been left
else if ( isHiddenContext )
impl_notify( ::rtl::OUString(), &XUndoManagerListener::leftHiddenContext, aGuard );
else
- impl_notify( rUndoManager.GetUndoActionComment(0), &XUndoManagerListener::leftContext, aGuard );
+ impl_notify( rUndoManager.GetUndoActionComment( 0, IUndoManager::CurrentLevel ), &XUndoManagerListener::leftContext, aGuard );
// <--- SYNCHRONIZED
}
@@ -537,17 +538,17 @@ namespace sfx2
1
);
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( !rUndoManager.IsUndoEnabled() )
// ignore the request if the manager is locked
return;
- const bool bHadRedoActions = ( rUndoManager.GetRedoActionCount() > 0 );
+ const bool bHadRedoActions = ( rUndoManager.GetRedoActionCount( IUndoManager::CurrentLevel ) > 0 );
{
::comphelper::FlagGuard aNotificationGuard( m_pImpl->bAPIActionRunning );
rUndoManager.AddUndoAction( new UndoActionWrapper( i_action ) );
}
- const bool bHasRedoActions = ( rUndoManager.GetRedoActionCount() > 0 );
+ const bool bHasRedoActions = ( rUndoManager.GetRedoActionCount( IUndoManager::CurrentLevel ) > 0 );
lcl_invalidateXDo( *m_pImpl );
impl_notify( i_action->getTitle(), &XUndoManagerListener::undoActionAdded, aGuard );
@@ -559,14 +560,14 @@ namespace sfx2
//------------------------------------------------------------------------------------------------------------------
void DocumentUndoManager::impl_do_nolck(
- USHORT ( ::svl::IUndoManager::*i_checkMethod )() const, BOOL ( ::svl::IUndoManager::*i_doMethod )(),
- String ( ::svl::IUndoManager::*i_titleRetriever )( USHORT ) const,
+ USHORT ( IUndoManager::*i_checkMethod )( bool const ) const, BOOL ( IUndoManager::*i_doMethod )(),
+ String ( IUndoManager::*i_titleRetriever )( USHORT, bool const ) const,
void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& ) )
{
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( rUndoManager.IsInListAction() )
throw UndoContextNotClosedException( ::rtl::OUString(), static_cast< XUndoManager* >( this ) );
@@ -588,10 +589,10 @@ namespace sfx2
}
}
- if ( (rUndoManager.*i_checkMethod)() == 0 )
+ if ( (rUndoManager.*i_checkMethod)( IUndoManager::TopLevel ) == 0 )
throw EmptyUndoStackException( ::rtl::OUString::createFromAscii( "stack is empty" ), static_cast< XUndoManager* >( this ) );
- const ::rtl::OUString sUndoActionTitle = (rUndoManager.*i_titleRetriever)(0);
+ const ::rtl::OUString sUndoActionTitle = (rUndoManager.*i_titleRetriever)( 0, IUndoManager::TopLevel );
{
::comphelper::FlagGuard aNotificationGuard( m_pImpl->bAPIActionRunning );
try
@@ -616,9 +617,9 @@ namespace sfx2
void SAL_CALL DocumentUndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
{
impl_do_nolck(
- &::svl::IUndoManager::GetUndoActionCount,
- &::svl::IUndoManager::Undo,
- &::svl::IUndoManager::GetUndoActionComment,
+ &IUndoManager::GetUndoActionCount,
+ &IUndoManager::Undo,
+ &IUndoManager::GetUndoActionComment,
&XUndoManagerListener::actionUndone
);
}
@@ -627,9 +628,9 @@ namespace sfx2
void SAL_CALL DocumentUndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
{
impl_do_nolck(
- &::svl::IUndoManager::GetRedoActionCount,
- &::svl::IUndoManager::Redo,
- &::svl::IUndoManager::GetRedoActionComment,
+ &IUndoManager::GetRedoActionCount,
+ &IUndoManager::Redo,
+ &IUndoManager::GetRedoActionComment,
&XUndoManagerListener::actionRedone
);
}
@@ -640,10 +641,10 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( rUndoManager.IsInListAction() )
return sal_False;
- return rUndoManager.GetUndoActionCount() > 0;
+ return rUndoManager.GetUndoActionCount( IUndoManager::TopLevel ) > 0;
// <--- SYNCHRONIZED
}
@@ -653,10 +654,10 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( rUndoManager.IsInListAction() )
return sal_False;
- return rUndoManager.GetRedoActionCount() > 0;
+ return rUndoManager.GetRedoActionCount( IUndoManager::TopLevel ) > 0;
// <--- SYNCHRONIZED
}
@@ -669,14 +670,19 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( i_impl.rAntiImpl );
- const ::svl::IUndoManager& rUndoManager = i_impl.getUndoManager();
- if ( ( i_undo ? rUndoManager.GetUndoActionCount() : rUndoManager.GetRedoActionCount() )== 0 )
+ const IUndoManager& rUndoManager = i_impl.getUndoManager();
+ const USHORT nActionCount = i_undo
+ ? rUndoManager.GetUndoActionCount( IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionCount( IUndoManager::TopLevel );
+ if ( nActionCount == 0 )
throw EmptyUndoStackException(
i_undo ? ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no action on the undo stack" ) )
: ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no action on the redo stack" ) ),
static_cast< XUndoManager* >( &i_impl.rAntiImpl )
);
- return i_undo ? rUndoManager.GetUndoActionComment(0) : rUndoManager.GetRedoActionComment(0);
+ return i_undo
+ ? rUndoManager.GetUndoActionComment( 0, IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionComment( 0, IUndoManager::TopLevel );
// <--- SYNCHRONIZED
}
@@ -686,13 +692,17 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( i_impl.rAntiImpl );
- const ::svl::IUndoManager& rUndoManager = i_impl.getUndoManager();
- const sal_Int32 nCount = i_undo ? rUndoManager.GetUndoActionCount() : rUndoManager.GetRedoActionCount();
+ const IUndoManager& rUndoManager = i_impl.getUndoManager();
+ const sal_Int32 nCount = i_undo
+ ? rUndoManager.GetUndoActionCount( IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionCount( IUndoManager::TopLevel );
Sequence< ::rtl::OUString > aTitles( nCount );
for ( sal_Int32 i=0; i<nCount; ++i )
{
- aTitles[i] = i_undo ? rUndoManager.GetUndoActionComment(i) : rUndoManager.GetRedoActionComment(i);
+ aTitles[i] = i_undo
+ ? rUndoManager.GetUndoActionComment( i, IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionComment( i, IUndoManager::TopLevel );
}
return aTitles;
// <--- SYNCHRONIZED
@@ -729,7 +739,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( rUndoManager.IsInListAction() )
throw UndoContextNotClosedException( ::rtl::OUString(), static_cast< XUndoManager* >( this ) );
@@ -747,7 +757,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( rUndoManager.IsInListAction() )
throw UndoContextNotClosedException( ::rtl::OUString(), static_cast< XUndoManager* >( this ) );
@@ -765,7 +775,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
{
::comphelper::FlagGuard aNotificationGuard( m_pImpl->bAPIActionRunning );
while ( rUndoManager.IsInListAction() )
@@ -783,7 +793,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
rUndoManager.EnableUndo( false );
// <--- SYNCHRONIZED
}
@@ -794,7 +804,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
if ( rUndoManager.IsUndoEnabled() )
throw NotLockedException( ::rtl::OUString::createFromAscii( "Undo manager is not locked" ), static_cast< XUndoManager* >( this ) );
rUndoManager.EnableUndo( true );
@@ -807,7 +817,7 @@ namespace sfx2
// SYNCHRONIZED --->
SfxModelGuard aGuard( *this );
- ::svl::IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
return !rUndoManager.IsUndoEnabled();
// <--- SYNCHRONIZED
}
diff --git a/sfx2/source/inc/docundomanager.hxx b/sfx2/source/inc/docundomanager.hxx
index 37ab4cb4e0d9..7998657fbb3a 100755
--- a/sfx2/source/inc/docundomanager.hxx
+++ b/sfx2/source/inc/docundomanager.hxx
@@ -117,9 +117,9 @@ namespace sfx2
);
void impl_do_nolck(
- USHORT ( ::svl::IUndoManager::*i_checkMethod )() const,
+ USHORT ( ::svl::IUndoManager::*i_checkMethod )( bool const ) const,
BOOL ( ::svl::IUndoManager::*i_doMethod )(),
- UniString ( ::svl::IUndoManager::*i_titleRetriever )( USHORT ) const,
+ UniString ( ::svl::IUndoManager::*i_titleRetriever )( USHORT, bool const ) const,
void ( SAL_CALL ::com::sun::star::document::XUndoManagerListener::*i_notificationMethod )( const ::com::sun::star::document::UndoManagerEvent& )
);