Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b1314f22
Kaydet (Commit)
b1314f22
authored
Eyl 20, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cook up a scheme to allow windows to have per-module settings
Change-Id: I5fa62c3c2af2ccbbc7e8a61e5537488515b2808c
üst
6936fa4a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
23 deletions
+64
-23
childwin.hxx
include/sfx2/childwin.hxx
+1
-0
moduleoptions.hxx
include/unotools/moduleoptions.hxx
+2
-0
childwin.cxx
sfx2/source/appl/childwin.cxx
+25
-9
workwin.cxx
sfx2/source/appl/workwin.cxx
+27
-4
moduleoptions.cxx
unotools/source/config/moduleoptions.cxx
+9
-10
No files found.
include/sfx2/childwin.hxx
Dosyayı görüntüle @
b1314f22
...
...
@@ -55,6 +55,7 @@ struct SfxChildWinInfo
Size
aSize
;
sal_uInt16
nFlags
;
OUString
aExtraString
;
OUString
aModule
;
OString
aWinState
;
SfxChildWinInfo
()
...
...
include/unotools/moduleoptions.hxx
Dosyayı görüntüle @
b1314f22
...
...
@@ -172,6 +172,8 @@ class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtModuleOptions : public utl::detail::
*/
static
EFactory
ClassifyFactoryByModel
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XModel
>&
xModel
);
static
OUString
GetFactoryShortName
(
EFactory
eFactory
);
OUString
GetDefaultModuleName
();
sal_Bool
IsMath
()
const
;
...
...
sfx2/source/appl/childwin.cxx
Dosyayı görüntüle @
b1314f22
...
...
@@ -17,13 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <boost/scoped_ptr.hpp>
#include <vcl/toolbox.hxx>
#include <tools/rcid.h>
#include <unotools/moduleoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <cppuhelper/implbase1.hxx>
...
...
@@ -288,7 +291,12 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo)
aWinData
.
append
(
rInfo
.
aExtraString
);
}
SvtViewOptions
aWinOpt
(
E_WINDOW
,
OUString
::
number
(
nID
)
);
OUString
sName
(
OUString
::
number
(
nID
));
//Try and save window state per-module, e.g. sidebar on in one application
//but off in another
if
(
!
rInfo
.
aModule
.
isEmpty
())
sName
=
rInfo
.
aModule
+
"/"
+
sName
;
SvtViewOptions
aWinOpt
(
E_WINDOW
,
sName
);
aWinOpt
.
SetWindowState
(
OStringToOUString
(
rInfo
.
aWinState
,
RTL_TEXTENCODING_UTF8
));
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
NamedValue
>
aSeq
(
1
);
...
...
@@ -313,7 +321,7 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const
{
DBG_CHKTHIS
(
SfxChildWindow
,
0
);
SfxChildWinInfo
aInfo
;
SfxChildWinInfo
aInfo
(
pImp
->
pFact
->
aInfo
)
;
aInfo
.
aPos
=
pWindow
->
GetPosPixel
();
aInfo
.
aSize
=
pWindow
->
GetSizePixel
();
if
(
pWindow
->
IsSystemWindow
()
)
...
...
@@ -347,22 +355,30 @@ sal_uInt16 SfxChildWindow::GetPosition()
}
//-------------------------------------------------------------------------
void
SfxChildWindow
::
InitializeChildWinFactory_Impl
(
sal_uInt16
nId
,
SfxChildWinInfo
&
rInfo
)
void
SfxChildWindow
::
InitializeChildWinFactory_Impl
(
sal_uInt16
nId
,
SfxChildWinInfo
&
rInfo
)
{
// load configuration
SvtViewOptions
aWinOpt
(
E_WINDOW
,
OUString
::
number
(
nId
)
);
if
(
aWinOpt
.
Exists
()
&&
aWinOpt
.
HasVisible
()
)
rInfo
.
bVisible
=
aWinOpt
.
IsVisible
();
// set state from configuration. Can be overwritten by UserData, see below
boost
::
scoped_ptr
<
SvtViewOptions
>
xWinOpt
;
// first see if a module specific id exists
if
(
rInfo
.
aModule
.
getLength
())
xWinOpt
.
reset
(
new
SvtViewOptions
(
E_WINDOW
,
rInfo
.
aModule
+
"/"
+
OUString
::
number
(
nId
)));
// if not then try the generic id
if
(
!
xWinOpt
||
!
xWinOpt
->
Exists
())
xWinOpt
.
reset
(
new
SvtViewOptions
(
E_WINDOW
,
OUString
::
number
(
nId
)));
if
(
xWinOpt
->
Exists
()
&&
xWinOpt
->
HasVisible
()
)
rInfo
.
bVisible
=
xWinOpt
->
IsVisible
();
// set state from configuration. Can be overwritten by UserData, see below
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
NamedValue
>
aSeq
=
aWinOpt
.
GetUserData
();
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
NamedValue
>
aSeq
=
xWinOpt
->
GetUserData
();
OUString
aTmp
;
if
(
aSeq
.
getLength
()
)
aSeq
[
0
].
Value
>>=
aTmp
;
OUString
aWinData
(
aTmp
);
rInfo
.
aWinState
=
OUStringToOString
(
aWinOpt
.
GetWindowState
(),
RTL_TEXTENCODING_UTF8
);
rInfo
.
aWinState
=
OUStringToOString
(
xWinOpt
->
GetWindowState
(),
RTL_TEXTENCODING_UTF8
);
if
(
!
aWinData
.
isEmpty
()
)
...
...
sfx2/source/appl/workwin.cxx
Dosyayı görüntüle @
b1314f22
...
...
@@ -18,7 +18,7 @@
*/
#include <config_features.h>
#include <comphelper/processfactory.hxx>
#include <stdio.h>
#include <boost/unordered_map.hpp>
...
...
@@ -46,10 +46,12 @@
#include <svl/whiter.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <unotools/moduleoptions.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp>
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
...
...
@@ -2445,6 +2447,27 @@ void SfxWorkWindow::SaveStatus_Impl(SfxChildWindow *pChild, const SfxChildWinInf
void
SfxWorkWindow
::
InitializeChild_Impl
(
SfxChildWin_Impl
*
pCW
)
{
SfxDispatcher
*
pDisp
=
pBindings
->
GetDispatcher_Impl
();
SfxViewFrame
*
pFrame
=
pDisp
?
pDisp
->
GetFrame
()
:
0
;
SfxModule
*
pMod
=
pFrame
?
SfxModule
::
GetActiveModule
(
pFrame
)
:
0
;
OUString
sModule
;
if
(
pFrame
)
{
try
{
using
namespace
::
com
::
sun
::
star
;
uno
::
Reference
<
frame
::
XModuleManager2
>
xModuleManager
(
frame
::
ModuleManager
::
create
(
::
comphelper
::
getProcessComponentContext
()));
sModule
=
xModuleManager
->
identify
(
pFrame
->
GetFrame
().
GetFrameInterface
());
SvtModuleOptions
::
EFactory
eFac
=
SvtModuleOptions
::
ClassifyFactoryByServiceName
(
sModule
);
sModule
=
SvtModuleOptions
::
GetFactoryShortName
(
eFac
);
}
catch
(...)
{
}
}
SfxChildWinFactory
*
pFact
=
0
;
SfxApplication
*
pApp
=
SFX_APP
();
{
...
...
@@ -2455,6 +2478,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW)
if
(
pFact
->
nId
==
pCW
->
nSaveId
)
{
pCW
->
aInfo
=
pFact
->
aInfo
;
pCW
->
aInfo
.
aModule
=
sModule
;
SfxChildWindow
::
InitializeChildWinFactory_Impl
(
pCW
->
nSaveId
,
pCW
->
aInfo
);
pCW
->
bCreate
=
pCW
->
aInfo
.
bVisible
;
...
...
@@ -2471,8 +2495,6 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW)
}
}
SfxDispatcher
*
pDisp
=
pBindings
->
GetDispatcher_Impl
();
SfxModule
*
pMod
=
pDisp
?
SfxModule
::
GetActiveModule
(
pDisp
->
GetFrame
()
)
:
0
;
if
(
pMod
)
{
SfxChildWinFactArr_Impl
*
pFactories
=
pMod
->
GetChildWinFactories_Impl
();
...
...
@@ -2485,6 +2507,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW)
if
(
pFact
->
nId
==
pCW
->
nSaveId
)
{
pCW
->
aInfo
=
pFact
->
aInfo
;
pCW
->
aInfo
.
aModule
=
sModule
;
SfxChildWindow
::
InitializeChildWinFactory_Impl
(
pCW
->
nSaveId
,
pCW
->
aInfo
);
pCW
->
bCreate
=
pCW
->
aInfo
.
bVisible
;
...
...
unotools/source/config/moduleoptions.cxx
Dosyayı görüntüle @
b1314f22
...
...
@@ -321,7 +321,6 @@ class SvtModuleOptions_Impl : public ::utl::ConfigItem
sal_Bool
IsModuleInstalled
(
SvtModuleOptions
::
EModule
eModule
)
const
;
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
GetAllServiceNames
();
OUString
GetFactoryName
(
SvtModuleOptions
::
EFactory
eFactory
)
const
;
OUString
GetFactoryShortName
(
SvtModuleOptions
::
EFactory
eFactory
)
const
;
OUString
GetFactoryStandardTemplate
(
SvtModuleOptions
::
EFactory
eFactory
)
const
;
OUString
GetFactoryEmptyDocumentURL
(
SvtModuleOptions
::
EFactory
eFactory
)
const
;
OUString
GetFactoryDefaultFilter
(
SvtModuleOptions
::
EFactory
eFactory
)
const
;
...
...
@@ -602,7 +601,7 @@ OUString SvtModuleOptions_Impl::GetFactoryName( SvtModuleOptions::EFactory eFact
}
//*****************************************************************************************************************
OUString
SvtModuleOptions
_Impl
::
GetFactoryShortName
(
SvtModuleOptions
::
EFactory
eFactory
)
const
OUString
SvtModuleOptions
::
GetFactoryShortName
(
SvtModuleOptions
::
EFactory
eFactory
)
{
// Attention: Hard configured yet ... because it's not fine to make changes possible by xml file yet.
// But it's good to plan further possibilities!
...
...
@@ -1357,21 +1356,21 @@ OUString SvtModuleOptions::GetDefaultModuleName()
{
OUString
aModule
;
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SWRITER
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_WRITER
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_WRITER
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SCALC
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_CALC
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_CALC
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SIMPRESS
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_IMPRESS
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_IMPRESS
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SDATABASE
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_DATABASE
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_DATABASE
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SDRAW
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_DRAW
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_DRAW
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SWEB
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_WRITERWEB
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_WRITERWEB
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SGLOBAL
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_WRITERGLOBAL
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_WRITERGLOBAL
);
else
if
(
m_pDataContainer
->
IsModuleInstalled
(
SvtModuleOptions
::
E_SMATH
))
aModule
=
m_pDataContainer
->
GetFactoryShortName
(
SvtModuleOptions
::
E_MATH
);
aModule
=
GetFactoryShortName
(
SvtModuleOptions
::
E_MATH
);
return
aModule
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment