toolbarlayoutmanager.cxx (6d739b60) | toolbarlayoutmanager.cxx (26169348) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 990 unchanged lines hidden (view full) --- 999 xDockWindow->enableDocking( sal_True ); 1000 uno::Reference< awt::XWindow > xWindow( xDockWindow, uno::UNO_QUERY ); 1001 if ( xWindow.is() ) 1002 xWindow->addWindowListener( uno::Reference< awt::XWindowListener >( static_cast< OWeakObject * >( this ), uno::UNO_QUERY )); 1003 } 1004 catch ( uno::Exception& ) {} 1005 } 1006 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 990 unchanged lines hidden (view full) --- 999 xDockWindow->enableDocking( sal_True ); 1000 uno::Reference< awt::XWindow > xWindow( xDockWindow, uno::UNO_QUERY ); 1001 if ( xWindow.is() ) 1002 xWindow->addWindowListener( uno::Reference< awt::XWindowListener >( static_cast< OWeakObject * >( this ), uno::UNO_QUERY )); 1003 } 1004 catch ( uno::Exception& ) {} 1005 } 1006 |
1007 ::rtl::OUString aGenericAddonTitle = implts_generateGenericAddonToolbarTitle( i+1 ); | 1007 ::rtl::OUString aAddonUIName = m_pAddonOptions->GetAddonsToolbarUIName( i ); 1008 ::rtl::OUString aAddonTitle = aAddonUIName.getLength() ? 1009 aAddonUIName : implts_generateGenericAddonToolbarTitle( i+1 ); |
1008 1009 if ( aElement.m_aName.getLength() > 0 ) 1010 { 1011 // Reuse a local entry so we are able to use the latest 1012 // UI changes for this document. 1013 implts_setElementData( aElement, xDockWindow ); 1014 aElement.m_xUIElement = xUIElement; 1015 if ( aElement.m_aUIName.getLength() == 0 ) 1016 { | 1010 1011 if ( aElement.m_aName.getLength() > 0 ) 1012 { 1013 // Reuse a local entry so we are able to use the latest 1014 // UI changes for this document. 1015 implts_setElementData( aElement, xDockWindow ); 1016 aElement.m_xUIElement = xUIElement; 1017 if ( aElement.m_aUIName.getLength() == 0 ) 1018 { |
1017 aElement.m_aUIName = aGenericAddonTitle; | 1019 aElement.m_aUIName = aAddonTitle; |
1018 implts_writeWindowStateData( aElement ); 1019 } 1020 } 1021 else 1022 { 1023 // Create new UI element and try to read its state data 1024 UIElement aNewToolbar( aAddonToolBarName, aElementType, xUIElement ); 1025 aNewToolbar.m_bFloating = true; 1026 implts_readWindowStateData( aAddonToolBarName, aNewToolbar ); 1027 implts_setElementData( aNewToolbar, xDockWindow ); 1028 if ( aNewToolbar.m_aUIName.getLength() == 0 ) 1029 { | 1020 implts_writeWindowStateData( aElement ); 1021 } 1022 } 1023 else 1024 { 1025 // Create new UI element and try to read its state data 1026 UIElement aNewToolbar( aAddonToolBarName, aElementType, xUIElement ); 1027 aNewToolbar.m_bFloating = true; 1028 implts_readWindowStateData( aAddonToolBarName, aNewToolbar ); 1029 implts_setElementData( aNewToolbar, xDockWindow ); 1030 if ( aNewToolbar.m_aUIName.getLength() == 0 ) 1031 { |
1030 aNewToolbar.m_aUIName = aGenericAddonTitle; | 1032 aNewToolbar.m_aUIName = aAddonTitle; |
1031 implts_writeWindowStateData( aNewToolbar ); 1032 } 1033 implts_insertToolbar( aNewToolbar ); 1034 } 1035 1036 uno::Reference< awt::XWindow > xWindow( xDockWindow, uno::UNO_QUERY ); 1037 if ( xWindow.is() ) 1038 { 1039 // Set generic title for add-on toolbar 1040 vos::OGuard aGuard( Application::GetSolarMutex() ); 1041 Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); 1042 if ( pWindow->GetText().Len() == 0 ) | 1033 implts_writeWindowStateData( aNewToolbar ); 1034 } 1035 implts_insertToolbar( aNewToolbar ); 1036 } 1037 1038 uno::Reference< awt::XWindow > xWindow( xDockWindow, uno::UNO_QUERY ); 1039 if ( xWindow.is() ) 1040 { 1041 // Set generic title for add-on toolbar 1042 vos::OGuard aGuard( Application::GetSolarMutex() ); 1043 Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); 1044 if ( pWindow->GetText().Len() == 0 ) |
1043 pWindow->SetText( aGenericAddonTitle ); | 1045 pWindow->SetText( aAddonTitle ); |
1044 if ( pWindow->GetType() == WINDOW_TOOLBOX ) 1045 { 1046 ToolBox* pToolbar = (ToolBox *)pWindow; 1047 pToolbar->SetMenuType(); 1048 } 1049 } 1050 } 1051 } --- 639 unchanged lines hidden (view full) --- 1691 } 1692 catch ( lang::WrappedTargetException ) {} 1693 } 1694 1695 if ( bPersistent && xPersistentWindowState.is() ) 1696 { 1697 try 1698 { | 1046 if ( pWindow->GetType() == WINDOW_TOOLBOX ) 1047 { 1048 ToolBox* pToolbar = (ToolBox *)pWindow; 1049 pToolbar->SetMenuType(); 1050 } 1051 } 1052 } 1053 } --- 639 unchanged lines hidden (view full) --- 1693 } 1694 catch ( lang::WrappedTargetException ) {} 1695 } 1696 1697 if ( bPersistent && xPersistentWindowState.is() ) 1698 { 1699 try 1700 { |
1699 uno::Sequence< beans::PropertyValue > aWindowState( 8 ); | 1701 uno::Sequence< beans::PropertyValue > aWindowState( 9 ); |
1700 1701 aWindowState[0].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_DOCKED ); 1702 aWindowState[0].Value = ::uno::makeAny( sal_Bool( !rElementData.m_bFloating )); 1703 aWindowState[1].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_VISIBLE ); 1704 aWindowState[1].Value = uno::makeAny( sal_Bool( rElementData.m_bVisible )); 1705 aWindowState[2].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_DOCKINGAREA ); 1706 aWindowState[2].Value = uno::makeAny( static_cast< ui::DockingArea >( rElementData.m_aDockedData.m_nDockedArea ) ); 1707 --- 12 unchanged lines hidden (view full) --- 1720 aSize.Width = rElementData.m_aFloatingData.m_aSize.Width(); 1721 aSize.Height = rElementData.m_aFloatingData.m_aSize.Height(); 1722 aWindowState[5].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_SIZE ); 1723 aWindowState[5].Value <<= aSize; 1724 aWindowState[6].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_UINAME ); 1725 aWindowState[6].Value = uno::makeAny( rElementData.m_aUIName ); 1726 aWindowState[7].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_LOCKED ); 1727 aWindowState[7].Value = uno::makeAny( rElementData.m_aDockedData.m_bLocked ); | 1702 1703 aWindowState[0].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_DOCKED ); 1704 aWindowState[0].Value = ::uno::makeAny( sal_Bool( !rElementData.m_bFloating )); 1705 aWindowState[1].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_VISIBLE ); 1706 aWindowState[1].Value = uno::makeAny( sal_Bool( rElementData.m_bVisible )); 1707 aWindowState[2].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_DOCKINGAREA ); 1708 aWindowState[2].Value = uno::makeAny( static_cast< ui::DockingArea >( rElementData.m_aDockedData.m_nDockedArea ) ); 1709 --- 12 unchanged lines hidden (view full) --- 1722 aSize.Width = rElementData.m_aFloatingData.m_aSize.Width(); 1723 aSize.Height = rElementData.m_aFloatingData.m_aSize.Height(); 1724 aWindowState[5].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_SIZE ); 1725 aWindowState[5].Value <<= aSize; 1726 aWindowState[6].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_UINAME ); 1727 aWindowState[6].Value = uno::makeAny( rElementData.m_aUIName ); 1728 aWindowState[7].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_LOCKED ); 1729 aWindowState[7].Value = uno::makeAny( rElementData.m_aDockedData.m_bLocked ); |
1730 aWindowState[8].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_STYLE ); 1731 aWindowState[8].Value = uno::makeAny( rElementData.m_nStyle ); |
|
1728 1729 ::rtl::OUString aName = rElementData.m_aName; 1730 if ( xPersistentWindowState->hasByName( aName )) 1731 { 1732 uno::Reference< container::XNameReplace > xReplace( xPersistentWindowState, uno::UNO_QUERY ); 1733 xReplace->replaceByName( aName, uno::makeAny( aWindowState )); 1734 } 1735 else --- 2571 unchanged lines hidden --- | 1732 1733 ::rtl::OUString aName = rElementData.m_aName; 1734 if ( xPersistentWindowState->hasByName( aName )) 1735 { 1736 uno::Reference< container::XNameReplace > xReplace( xPersistentWindowState, uno::UNO_QUERY ); 1737 xReplace->replaceByName( aName, uno::makeAny( aWindowState )); 1738 } 1739 else --- 2571 unchanged lines hidden --- |