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
f5e68bae
Kaydet (Commit)
f5e68bae
authored
Haz 03, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ruler: convert pCtrlItems to use vector of unique_ptr
Change-Id: Icc6cf55c26d605fd068edf575613cde745385dd2
üst
f64588a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
28 deletions
+21
-28
ruler.hxx
include/svx/ruler.hxx
+2
-1
svxruler.cxx
svx/source/dialog/svxruler.cxx
+19
-27
No files found.
include/svx/ruler.hxx
Dosyayı görüntüle @
f5e68bae
...
...
@@ -80,7 +80,8 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
friend
class
SvxRulerItem
;
using
Window
::
Notify
;
SvxRulerItem
**
pCtrlItem
;
std
::
vector
<
std
::
unique_ptr
<
SvxRulerItem
>
>
pCtrlItems
;
std
::
unique_ptr
<
SvxLongLRSpaceItem
>
mxLRSpaceItem
;
// left and right edge
std
::
unique_ptr
<
SfxRectangleItem
>
mxMinMaxItem
;
// maxima for dragging
std
::
unique_ptr
<
SvxLongULSpaceItem
>
mxULSpaceItem
;
// upper and lower edge
...
...
svx/source/dialog/svxruler.cxx
Dosyayı görüntüle @
f5e68bae
...
...
@@ -223,7 +223,7 @@ SvxRuler::SvxRuler(
SfxBindings
&
rBindings
,
// associated Bindings
WinBits
nWinStyle
)
:
// StarView WinBits
Ruler
(
pParent
,
nWinStyle
),
pCtrlItem
(
new
SvxRulerItem
*
[
CTRL_ITEM_COUNT
]
),
pCtrlItem
s
(
CTRL_ITEM_COUNT
),
pEditWin
(
pWin
),
mxRulerImpl
(
new
SvxRuler_Impl
),
bAppSetNullOffset
(
false
),
// Is the 0-offset of the ruler set by the application?
...
...
@@ -252,42 +252,40 @@ SvxRuler::SvxRuler(
{
/* Constructor; Initialize data buffer; controller items are created */
memset
(
pCtrlItem
,
0
,
sizeof
(
SvxRulerItem
*
)
*
CTRL_ITEM_COUNT
);
rBindings
.
EnterRegistrations
();
// Create Supported Items
sal_uInt16
i
=
0
;
// Page edges
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_RULER_LR_MIN_MAX
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_RULER_LR_MIN_MAX
,
*
this
,
rBindings
)
);
if
((
nWinStyle
&
WB_VSCROLL
)
==
WB_VSCROLL
)
{
bHorz
=
false
;
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_ATTR_LONG_ULSPACE
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_ATTR_LONG_ULSPACE
,
*
this
,
rBindings
)
);
}
else
{
bHorz
=
true
;
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_ATTR_LONG_LRSPACE
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_ATTR_LONG_LRSPACE
,
*
this
,
rBindings
)
);
}
// Page Position
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_RULER_PAGE_POS
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_RULER_PAGE_POS
,
*
this
,
rBindings
)
);
if
(
nFlags
&
SvxRulerSupportFlags
::
TABS
)
{
sal_uInt16
nTabStopId
=
bHorz
?
SID_ATTR_TABSTOP
:
SID_ATTR_TABSTOP_VERTICAL
;
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
nTabStopId
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
nTabStopId
,
*
this
,
rBindings
)
);
SetExtraType
(
RULER_EXTRA_TAB
,
nDefTabType
);
}
if
(
nFlags
&
(
SvxRulerSupportFlags
::
PARAGRAPH_MARGINS
|
SvxRulerSupportFlags
::
PARAGRAPH_MARGINS_VERTICAL
))
{
if
(
bHorz
)
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_ATTR_PARA_LRSPACE
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_ATTR_PARA_LRSPACE
,
*
this
,
rBindings
)
);
else
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_ATTR_PARA_LRSPACE_VERTICAL
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_ATTR_PARA_LRSPACE_VERTICAL
,
*
this
,
rBindings
)
);
mpIndents
.
resize
(
5
+
INDENT_GAP
);
...
...
@@ -306,15 +304,15 @@ SvxRuler::SvxRuler(
if
(
(
nFlags
&
SvxRulerSupportFlags
::
BORDERS
)
==
SvxRulerSupportFlags
::
BORDERS
)
{
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
bHorz
?
SID_RULER_BORDERS
:
SID_RULER_BORDERS_VERTICAL
,
*
this
,
rBindings
);
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
bHorz
?
SID_RULER_ROWS
:
SID_RULER_ROWS_VERTICAL
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
bHorz
?
SID_RULER_BORDERS
:
SID_RULER_BORDERS_VERTICAL
,
*
this
,
rBindings
)
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
bHorz
?
SID_RULER_ROWS
:
SID_RULER_ROWS_VERTICAL
,
*
this
,
rBindings
)
);
}
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_RULER_TEXT_RIGHT_TO_LEFT
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_RULER_TEXT_RIGHT_TO_LEFT
,
*
this
,
rBindings
)
);
if
(
(
nFlags
&
SvxRulerSupportFlags
::
OBJECT
)
==
SvxRulerSupportFlags
::
OBJECT
)
{
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_RULER_OBJECT
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_RULER_OBJECT
,
*
this
,
rBindings
)
);
mpObjectBorders
.
resize
(
OBJECT_BORDER_COUNT
);
for
(
sal_uInt16
nBorder
=
0
;
nBorder
<
OBJECT_BORDER_COUNT
;
++
nBorder
)
{
...
...
@@ -324,8 +322,8 @@ SvxRuler::SvxRuler(
}
}
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_RULER_PROTECT
,
*
this
,
rBindings
);
pCtrlItem
[
i
++
]
=
new
SvxRulerItem
(
SID_RULER_BORDER_DISTANCE
,
*
this
,
rBindings
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_RULER_PROTECT
,
*
this
,
rBindings
)
);
pCtrlItem
s
[
i
++
].
reset
(
new
SvxRulerItem
(
SID_RULER_BORDER_DISTANCE
,
*
this
,
rBindings
)
);
mxRulerImpl
->
nControlerItems
=
i
;
if
(
(
nFlags
&
SvxRulerSupportFlags
::
SET_NULLOFFSET
)
==
SvxRulerSupportFlags
::
SET_NULLOFFSET
)
...
...
@@ -353,13 +351,7 @@ void SvxRuler::dispose()
pBindings
->
EnterRegistrations
();
if
(
pCtrlItem
)
{
for
(
sal_uInt16
i
=
0
;
i
<
CTRL_ITEM_COUNT
&&
pCtrlItem
[
i
];
++
i
)
delete
pCtrlItem
[
i
];
delete
[]
pCtrlItem
;
pCtrlItem
=
NULL
;
}
pCtrlItems
.
clear
();
pBindings
->
LeaveRegistrations
();
...
...
@@ -1768,10 +1760,10 @@ void SvxRuler::SetActive(bool bOn)
pBindings
->
EnterRegistrations
();
if
(
bOn
)
for
(
sal_uInt16
i
=
0
;
i
<
mxRulerImpl
->
nControlerItems
;
i
++
)
pCtrlItem
[
i
]
->
ReBind
();
pCtrlItem
s
[
i
]
->
ReBind
();
else
for
(
sal_uInt16
j
=
0
;
j
<
mxRulerImpl
->
nControlerItems
;
j
++
)
pCtrlItem
[
j
]
->
UnBind
();
pCtrlItem
s
[
j
]
->
UnBind
();
pBindings
->
LeaveRegistrations
();
}
bActive
=
bOn
;
...
...
@@ -3383,8 +3375,8 @@ void SvxRuler::EndDrag()
{
for
(
sal_uInt16
i
=
0
;
i
<
mxRulerImpl
->
nControlerItems
;
i
++
)
{
pCtrlItem
[
i
]
->
ClearCache
();
pCtrlItem
[
i
]
->
GetBindings
().
Invalidate
(
pCtrlItem
[
i
]
->
GetId
());
pCtrlItem
s
[
i
]
->
ClearCache
();
pCtrlItem
s
[
i
]
->
GetBindings
().
Invalidate
(
pCtrlItems
[
i
]
->
GetId
());
}
}
}
...
...
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