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
cad2fc1a
Kaydet (Commit)
cad2fc1a
authored
Nis 05, 2013
tarafından
Oliver-Rainer Wittmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#121933# - some improvement to the docking area layout on a undock-dock-cycle of a window
üst
d6b69ed6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
13 deletions
+77
-13
splitwin.cxx
sfx2/source/dialog/splitwin.cxx
+77
-13
No files found.
sfx2/source/dialog/splitwin.cxx
Dosyayı görüntüle @
cad2fc1a
...
@@ -51,6 +51,9 @@
...
@@ -51,6 +51,9 @@
#include <sfx2/msgpool.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewfrm.hxx>
#include <vector>
#include <utility>
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
rtl
;
using
namespace
::
rtl
;
...
@@ -58,6 +61,35 @@ using namespace ::rtl;
...
@@ -58,6 +61,35 @@ using namespace ::rtl;
#define nPixel 30L
#define nPixel 30L
#define USERITEM_NAME OUString::createFromAscii( "UserItem" )
#define USERITEM_NAME OUString::createFromAscii( "UserItem" )
namespace
{
// helper class to deactivate UpdateMode, if needed, for the life time of an instance
class
DeactivateUpdateMode
{
public
:
explicit
DeactivateUpdateMode
(
SfxSplitWindow
&
rSplitWindow
)
:
mrSplitWindow
(
rSplitWindow
)
,
mbUpdateMode
(
rSplitWindow
.
IsUpdateMode
()
)
{
if
(
mbUpdateMode
)
{
mrSplitWindow
.
SetUpdateMode
(
sal_False
);
}
}
~
DeactivateUpdateMode
(
void
)
{
if
(
mbUpdateMode
)
{
mrSplitWindow
.
SetUpdateMode
(
sal_True
);
}
}
private
:
SfxSplitWindow
&
mrSplitWindow
;
const
sal_Bool
mbUpdateMode
;
};
}
struct
SfxDock_Impl
struct
SfxDock_Impl
{
{
sal_uInt16
nType
;
sal_uInt16
nType
;
...
@@ -399,15 +431,17 @@ void SfxSplitWindow::Split()
...
@@ -399,15 +431,17 @@ void SfxSplitWindow::Split()
SplitWindow
::
Split
();
SplitWindow
::
Split
();
std
::
vector
<
std
::
pair
<
sal_uInt16
,
long
>
>
aNewOrgSizes
;
sal_uInt16
nCount
=
pDockArr
->
Count
();
sal_uInt16
nCount
=
pDockArr
->
Count
();
for
(
sal_uInt16
n
=
0
;
n
<
nCount
;
n
++
)
for
(
sal_uInt16
n
=
0
;
n
<
nCount
;
n
++
)
{
{
SfxDock_Impl
*
pD
=
(
*
pDockArr
)[
n
];
SfxDock_Impl
*
pD
=
(
*
pDockArr
)[
n
];
if
(
pD
->
pWin
)
if
(
pD
->
pWin
)
{
{
sal_uInt16
nId
=
pD
->
nType
;
const
sal_uInt16
nId
=
pD
->
nType
;
long
nSize
=
GetItemSize
(
nId
,
SWIB_FIXED
);
const
long
nSize
=
GetItemSize
(
nId
,
SWIB_FIXED
);
long
nSetSize
=
GetItemSize
(
GetSet
(
nId
)
);
const
long
nSetSize
=
GetItemSize
(
GetSet
(
nId
)
);
Size
aSize
;
Size
aSize
;
if
(
IsHorizontal
()
)
if
(
IsHorizontal
()
)
...
@@ -422,6 +456,18 @@ void SfxSplitWindow::Split()
...
@@ -422,6 +456,18 @@ void SfxSplitWindow::Split()
}
}
pD
->
pWin
->
SetItemSize_Impl
(
aSize
);
pD
->
pWin
->
SetItemSize_Impl
(
aSize
);
aNewOrgSizes
.
push_back
(
std
::
pair
<
sal_uInt16
,
long
>
(
nId
,
nSize
)
);
}
}
// workaround insuffiency of <SplitWindow> regarding dock layouting:
// apply FIXED item size as 'original' item size to improve layouting of undock-dock-cycle of a window
{
DeactivateUpdateMode
aDeactivateUpdateMode
(
*
this
);
for
(
sal_uInt16
i
=
0
;
i
<
aNewOrgSizes
.
size
();
++
i
)
{
SetItemSize
(
aNewOrgSizes
[
i
].
first
,
aNewOrgSizes
[
i
].
second
);
}
}
}
}
...
@@ -684,9 +730,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
...
@@ -684,9 +730,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
pDock
->
nSize
=
nWinSize
;
pDock
->
nSize
=
nWinSize
;
sal_Bool
bUpdateMode
=
IsUpdateMode
();
DeactivateUpdateMode
*
pDeactivateUpdateMode
=
new
DeactivateUpdateMode
(
*
this
);
if
(
bUpdateMode
)
SetUpdateMode
(
sal_False
);
if
(
bNewLine
||
nLine
==
GetItemCount
(
0
)
)
if
(
bNewLine
||
nLine
==
GetItemCount
(
0
)
)
{
{
...
@@ -759,9 +803,32 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
...
@@ -759,9 +803,32 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
pWorkWin
->
ShowChilds_Impl
();
pWorkWin
->
ShowChilds_Impl
();
}
}
if
(
bUpdateMode
)
delete
pDeactivateUpdateMode
;
SetUpdateMode
(
sal_True
);
bLocked
=
sal_False
;
bLocked
=
sal_False
;
// workaround insuffiency of <SplitWindow> regarding dock layouting:
// apply FIXED item size as 'original' item size to improve layouting of undock-dock-cycle of a window
{
std
::
vector
<
std
::
pair
<
sal_uInt16
,
long
>
>
aNewOrgSizes
;
// get FIXED item sizes
sal_uInt16
nCount
=
pDockArr
->
Count
();
for
(
sal_uInt16
n
=
0
;
n
<
nCount
;
n
++
)
{
SfxDock_Impl
*
pD
=
(
*
pDockArr
)[
n
];
if
(
pD
->
pWin
)
{
const
sal_uInt16
nId
=
pD
->
nType
;
const
long
nSize
=
GetItemSize
(
nId
,
SWIB_FIXED
);
aNewOrgSizes
.
push_back
(
std
::
pair
<
sal_uInt16
,
long
>
(
nId
,
nSize
)
);
}
}
// apply new item sizes
DeactivateUpdateMode
aDeactivateUpdateMode
(
*
this
);
for
(
sal_uInt16
i
=
0
;
i
<
aNewOrgSizes
.
size
();
++
i
)
{
SetItemSize
(
aNewOrgSizes
[
i
].
first
,
aNewOrgSizes
[
i
].
second
);
}
}
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
...
@@ -817,9 +884,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide )
...
@@ -817,9 +884,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide )
// Fenster removen, und wenn es das letzte der Zeile war, auch die Zeile
// Fenster removen, und wenn es das letzte der Zeile war, auch die Zeile
// ( Zeile = ItemSet )
// ( Zeile = ItemSet )
sal_Bool
bUpdateMode
=
IsUpdateMode
();
DeactivateUpdateMode
*
pDeactivateUpdateMode
=
new
DeactivateUpdateMode
(
*
this
);
if
(
bUpdateMode
)
SetUpdateMode
(
sal_False
);
bLocked
=
sal_True
;
bLocked
=
sal_True
;
RemoveItem
(
pDockWin
->
GetType
()
);
RemoveItem
(
pDockWin
->
GetType
()
);
...
@@ -827,8 +892,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide )
...
@@ -827,8 +892,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide )
if
(
nSet
&&
!
GetItemCount
(
nSet
)
)
if
(
nSet
&&
!
GetItemCount
(
nSet
)
)
RemoveItem
(
nSet
);
RemoveItem
(
nSet
);
if
(
bUpdateMode
)
delete
pDeactivateUpdateMode
;
SetUpdateMode
(
sal_True
);
bLocked
=
sal_False
;
bLocked
=
sal_False
;
};
};
...
...
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