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
767ec466
Kaydet (Commit)
767ec466
authored
Ock 13, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleanup SfxZoomDialog, convert plain pointer to unique_ptr
Change-Id: I50f16a6c2ec3dcbb12881ab42d0a2f9556cf7ec8
üst
3b3eeff3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
183 additions
and
166 deletions
+183
-166
zoom.cxx
cui/source/dialogs/zoom.cxx
+155
-138
zoom.hxx
cui/source/inc/zoom.hxx
+28
-28
No files found.
cui/source/dialogs/zoom.cxx
Dosyayı görüntüle @
767ec466
...
...
@@ -31,27 +31,29 @@
#include <dialmgr.hxx>
#include <svx/zoom_def.hxx>
// static ----------------------------------------------------------------
namespace
{
#define SPECIAL_FACTOR ((sal_uInt16)0xFFFF)
const
sal_uInt16
SPECIAL_FACTOR
=
0xFFFF
;
// class SvxZoomDialog ---------------------------------------------------
}
// anonymous namespace
sal_uInt16
SvxZoomDialog
::
GetFactor
()
const
{
if
(
m_p100Btn
->
IsChecked
()
)
if
(
m_p100Btn
->
IsChecked
()
)
return
100
;
if
(
m_pUserBtn
->
IsChecked
()
)
return
(
sal_uInt16
)
m_pUserEdit
->
GetValue
();
if
(
m_pUserBtn
->
IsChecked
())
return
static_cast
<
sal_uInt16
>
(
m_pUserEdit
->
GetValue
());
else
return
SPECIAL_FACTOR
;
}
void
SvxZoomDialog
::
SetFactor
(
sal_uInt16
nNewFactor
,
sal_uInt16
nBtnId
)
void
SvxZoomDialog
::
SetFactor
(
sal_uInt16
nNewFactor
,
sal_uInt16
nButtonId
)
{
m_pUserEdit
->
Disable
();
if
(
!
nBtnId
)
if
(
!
nButtonId
)
{
if
(
nNewFactor
==
100
)
{
...
...
@@ -62,35 +64,37 @@ void SvxZoomDialog::SetFactor( sal_uInt16 nNewFactor, sal_uInt16 nBtnId )
{
m_pUserBtn
->
Check
();
m_pUserEdit
->
Enable
();
m_pUserEdit
->
SetValue
(
(
long
)
nNewFactor
);
m_pUserEdit
->
SetValue
(
static_cast
<
long
>
(
nNewFactor
)
);
m_pUserEdit
->
GrabFocus
();
}
}
else
{
m_pUserEdit
->
SetValue
(
(
long
)
nNewFactor
);
if
(
ZOOMBTN_OPTIMAL
==
nBtnId
)
{
m_pOptimalBtn
->
Check
();
m_pOptimalBtn
->
GrabFocus
();
}
else
if
(
ZOOMBTN_PAGEWIDTH
==
nBtnId
)
{
m_pPageWidthBtn
->
Check
();
m_pPageWidthBtn
->
GrabFocus
();
}
else
if
(
ZOOMBTN_WHOLEPAGE
==
nBtnId
)
m_pUserEdit
->
SetValue
(
static_cast
<
long
>
(
nNewFactor
));
switch
(
nButtonId
)
{
m_pWholePageBtn
->
Check
();
m_pWholePageBtn
->
GrabFocus
();
case
ZOOMBTN_OPTIMAL
:
{
m_pOptimalBtn
->
Check
();
m_pOptimalBtn
->
GrabFocus
();
}
case
ZOOMBTN_PAGEWIDTH
:
{
m_pPageWidthBtn
->
Check
();
m_pPageWidthBtn
->
GrabFocus
();
}
case
ZOOMBTN_WHOLEPAGE
:
{
m_pWholePageBtn
->
Check
();
m_pWholePageBtn
->
GrabFocus
();
}
}
}
}
void
SvxZoomDialog
::
HideButton
(
sal_uInt16
nBtnId
)
void
SvxZoomDialog
::
HideButton
(
sal_uInt16
nButtonId
)
{
switch
(
nBtnId
)
switch
(
nButtonId
)
{
case
ZOOMBTN_OPTIMAL
:
m_pOptimalBtn
->
Hide
();
...
...
@@ -109,20 +113,25 @@ void SvxZoomDialog::HideButton( sal_uInt16 nBtnId )
}
}
void
SvxZoomDialog
::
SetLimits
(
sal_uInt16
nMin
,
sal_uInt16
nMax
)
void
SvxZoomDialog
::
SetLimits
(
sal_uInt16
nMin
,
sal_uInt16
nMax
)
{
DBG_ASSERT
(
nMin
<
nMax
,
"invalid limits"
);
m_pUserEdit
->
SetMin
(
nMin
);
m_pUserEdit
->
SetFirst
(
nMin
);
m_pUserEdit
->
SetMax
(
nMax
);
m_pUserEdit
->
SetLast
(
nMax
);
}
const
SfxItemSet
*
SvxZoomDialog
::
GetOutputItemSet
()
const
{
DBG_ASSERT
(
nMin
<
nMax
,
"invalid limits"
);
m_pUserEdit
->
SetMin
(
nMin
);
m_pUserEdit
->
SetFirst
(
nMin
);
m_pUserEdit
->
SetMax
(
nMax
);
m_pUserEdit
->
SetLast
(
nMax
);
return
mpOutSet
.
get
();
}
SvxZoomDialog
::
SvxZoomDialog
(
vcl
::
Window
*
pParent
,
const
SfxItemSet
&
rCoreSet
)
:
SfxModalDialog
(
pParent
,
"ZoomDialog"
,
"cui/ui/zoomdialog.ui"
)
,
rSet
(
rCoreSet
)
,
pOutSet
(
NULL
)
,
bModified
(
false
)
,
m
rSet
(
rCoreSet
)
,
mpOutSet
(
)
,
m
bModified
(
false
)
{
get
(
m_pOptimalBtn
,
"optimal"
);
...
...
@@ -138,26 +147,26 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
get
(
m_pColumnsEdit
,
"columnssb"
);
get
(
m_pBookModeChk
,
"bookmode"
);
get
(
m_pOKBtn
,
"ok"
);
Link
aLink
=
LINK
(
this
,
SvxZoomDialog
,
UserHdl
);
m_p100Btn
->
SetClickHdl
(
aLink
);
m_pOptimalBtn
->
SetClickHdl
(
aLink
);
m_pPageWidthBtn
->
SetClickHdl
(
aLink
);
m_pWholePageBtn
->
SetClickHdl
(
aLink
);
m_pUserBtn
->
SetClickHdl
(
aLink
);
Link
aLink
=
LINK
(
this
,
SvxZoomDialog
,
UserHdl
);
m_p100Btn
->
SetClickHdl
(
aLink
);
m_pOptimalBtn
->
SetClickHdl
(
aLink
);
m_pPageWidthBtn
->
SetClickHdl
(
aLink
);
m_pWholePageBtn
->
SetClickHdl
(
aLink
);
m_pUserBtn
->
SetClickHdl
(
aLink
);
Link
aViewLayoutLink
=
LINK
(
this
,
SvxZoomDialog
,
ViewLayoutUserHdl
);
m_pAutomaticBtn
->
SetClickHdl
(
aViewLayoutLink
);
m_pSingleBtn
->
SetClickHdl
(
aViewLayoutLink
);
m_pColumnsBtn
->
SetClickHdl
(
aViewLayoutLink
);
Link
aViewLayoutLink
=
LINK
(
this
,
SvxZoomDialog
,
ViewLayoutUserHdl
);
m_pAutomaticBtn
->
SetClickHdl
(
aViewLayoutLink
);
m_pSingleBtn
->
SetClickHdl
(
aViewLayoutLink
);
m_pColumnsBtn
->
SetClickHdl
(
aViewLayoutLink
);
Link
aViewLayoutSpinLink
=
LINK
(
this
,
SvxZoomDialog
,
ViewLayoutSpinHdl
);
m_pColumnsEdit
->
SetModifyHdl
(
aViewLayoutSpinLink
);
Link
aViewLayoutSpinLink
=
LINK
(
this
,
SvxZoomDialog
,
ViewLayoutSpinHdl
);
m_pColumnsEdit
->
SetModifyHdl
(
aViewLayoutSpinLink
);
Link
aViewLayoutCheckLink
=
LINK
(
this
,
SvxZoomDialog
,
ViewLayoutCheckHdl
);
m_pBookModeChk
->
SetClickHdl
(
aViewLayoutCheckLink
);
Link
aViewLayoutCheckLink
=
LINK
(
this
,
SvxZoomDialog
,
ViewLayoutCheckHdl
);
m_pBookModeChk
->
SetClickHdl
(
aViewLayoutCheckLink
);
m_pOKBtn
->
SetClickHdl
(
LINK
(
this
,
SvxZoomDialog
,
OKHdl
)
);
m_pUserEdit
->
SetModifyHdl
(
LINK
(
this
,
SvxZoomDialog
,
SpinHdl
)
);
m_pOKBtn
->
SetClickHdl
(
LINK
(
this
,
SvxZoomDialog
,
OKHdl
)
);
m_pUserEdit
->
SetModifyHdl
(
LINK
(
this
,
SvxZoomDialog
,
SpinHdl
)
);
// default values
sal_uInt16
nValue
=
100
;
...
...
@@ -166,50 +175,48 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
// maybe get the old value first
const
SfxUInt16Item
*
pOldUserItem
=
0
;
SfxObjectShell
*
pSh
=
SfxObjectShell
::
Current
();
SfxObjectShell
*
pSh
ell
=
SfxObjectShell
::
Current
();
if
(
pSh
)
pOldUserItem
=
static_cast
<
const
SfxUInt16Item
*>
(
pSh
->
GetItem
(
SID_ATTR_ZOOM_USER
));
if
(
pShell
)
pOldUserItem
=
static_cast
<
const
SfxUInt16Item
*>
(
pSh
ell
->
GetItem
(
SID_ATTR_ZOOM_USER
));
if
(
pOldUserItem
)
if
(
pOldUserItem
)
nValue
=
pOldUserItem
->
GetValue
();
// initialize UserEdit
if
(
nMin
>
nValue
)
if
(
nMin
>
nValue
)
nMin
=
nValue
;
if
(
nMax
<
nValue
)
if
(
nMax
<
nValue
)
nMax
=
nValue
;
m_pUserEdit
->
SetMin
(
nMin
);
m_pUserEdit
->
SetFirst
(
nMin
);
m_pUserEdit
->
SetMax
(
nMax
);
m_pUserEdit
->
SetLast
(
nMax
);
m_pUserEdit
->
SetValue
(
nValue
);
SetLimits
(
nMin
,
nMax
);
m_pUserEdit
->
SetValue
(
nValue
);
m_pUserEdit
->
SetAccessibleName
(
m_pUserBtn
->
GetText
());
m_pColumnsEdit
->
SetAccessibleName
(
m_pColumnsBtn
->
GetText
());
m_pColumnsEdit
->
SetAccessibleRelationMemberOf
(
m_pColumnsBtn
);
m_pBookModeChk
->
SetAccessibleRelationMemberOf
(
m_pColumnsBtn
);
const
SfxPoolItem
&
rItem
=
rSet
.
Get
(
rSet
.
GetPool
()
->
GetWhich
(
SID_ATTR_ZOOM
)
);
const
SfxPoolItem
&
rItem
=
mrSet
.
Get
(
mrSet
.
GetPool
()
->
GetWhich
(
SID_ATTR_ZOOM
)
);
if
(
rItem
.
ISA
(
SvxZoomItem
)
)
if
(
rItem
.
ISA
(
SvxZoomItem
)
)
{
const
SvxZoomItem
&
rZoomItem
=
static_cast
<
const
SvxZoomItem
&>
(
rItem
);
const
sal_uInt16
nZoom
=
rZoomItem
.
GetValue
();
const
SvxZoomType
eType
=
rZoomItem
.
GetType
();
const
sal_uInt16
nValSet
=
rZoomItem
.
GetValueSet
();
sal_uInt16
nB
t
nId
=
0
;
sal_uInt16
nB
utto
nId
=
0
;
switch
(
eType
)
switch
(
eType
)
{
case
SVX_ZOOM_OPTIMAL
:
nB
t
nId
=
ZOOMBTN_OPTIMAL
;
nB
utto
nId
=
ZOOMBTN_OPTIMAL
;
break
;
case
SVX_ZOOM_PAGEWIDTH
:
nB
t
nId
=
ZOOMBTN_PAGEWIDTH
;
nB
utto
nId
=
ZOOMBTN_PAGEWIDTH
;
break
;
case
SVX_ZOOM_WHOLEPAGE
:
nB
t
nId
=
ZOOMBTN_WHOLEPAGE
;
nB
utto
nId
=
ZOOMBTN_WHOLEPAGE
;
break
;
case
SVX_ZOOM_PERCENT
:
break
;
...
...
@@ -217,54 +224,56 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
break
;
}
if
(
!
(
SVX_ZOOM_ENABLE_100
&
nValSet
)
)
if
(
!
(
SVX_ZOOM_ENABLE_100
&
nValSet
)
)
m_p100Btn
->
Disable
();
if
(
!
(
SVX_ZOOM_ENABLE_OPTIMAL
&
nValSet
)
)
if
(
!
(
SVX_ZOOM_ENABLE_OPTIMAL
&
nValSet
)
)
m_pOptimalBtn
->
Disable
();
if
(
!
(
SVX_ZOOM_ENABLE_PAGEWIDTH
&
nValSet
)
)
if
(
!
(
SVX_ZOOM_ENABLE_PAGEWIDTH
&
nValSet
)
)
m_pPageWidthBtn
->
Disable
();
if
(
!
(
SVX_ZOOM_ENABLE_WHOLEPAGE
&
nValSet
)
)
if
(
!
(
SVX_ZOOM_ENABLE_WHOLEPAGE
&
nValSet
)
)
m_pWholePageBtn
->
Disable
();
SetFactor
(
nZoom
,
nBtnId
);
SetFactor
(
nZoom
,
nButtonId
);
}
else
{
const
sal_uInt16
nZoom
=
static_cast
<
const
SfxUInt16Item
&>
(
rItem
).
GetValue
();
SetFactor
(
nZoom
);
SetFactor
(
nZoom
);
}
const
SfxPoolItem
*
p
ViewLayoutItem
=
0
;
if
(
SfxItemState
::
SET
==
rSet
.
GetItemState
(
SID_ATTR_VIEWLAYOUT
,
false
,
&
pViewLayoutItem
)
)
const
SfxPoolItem
*
p
PoolViewLayoutItem
=
NULL
;
if
(
SfxItemState
::
SET
==
mrSet
.
GetItemState
(
SID_ATTR_VIEWLAYOUT
,
false
,
&
pPoolViewLayoutItem
)
)
{
const
sal_uInt16
nColumns
=
static_cast
<
const
SvxViewLayoutItem
*>
(
pViewLayoutItem
)
->
GetValue
();
const
bool
bBookMode
=
static_cast
<
const
SvxViewLayoutItem
*>
(
pViewLayoutItem
)
->
IsBookMode
();
const
SvxViewLayoutItem
*
pViewLayoutItem
=
static_cast
<
const
SvxViewLayoutItem
*>
(
pPoolViewLayoutItem
);
const
sal_uInt16
nColumns
=
pViewLayoutItem
->
GetValue
();
const
bool
bBookMode
=
pViewLayoutItem
->
IsBookMode
();
if
(
0
==
nColumns
)
if
(
0
==
nColumns
)
{
m_pAutomaticBtn
->
Check
();
m_pColumnsEdit
->
SetValue
(
2
);
m_pColumnsEdit
->
SetValue
(
2
);
m_pColumnsEdit
->
Disable
();
m_pBookModeChk
->
Disable
();
}
else
if
(
1
==
nColumns
)
else
if
(
1
==
nColumns
)
{
m_pSingleBtn
->
Check
();
m_pColumnsEdit
->
SetValue
(
2
);
m_pColumnsEdit
->
SetValue
(
2
);
m_pColumnsEdit
->
Disable
();
m_pBookModeChk
->
Disable
();
}
else
{
m_pColumnsBtn
->
Check
();
if
(
!
bBookMode
)
if
(
!
bBookMode
)
{
m_pColumnsEdit
->
SetValue
(
nColumns
);
if
(
0
!=
nColumns
%
2
)
m_pColumnsEdit
->
SetValue
(
nColumns
);
if
(
nColumns
%
2
!=
0
)
m_pBookModeChk
->
Disable
();
}
else
{
m_pColumnsEdit
->
SetValue
(
nColumns
);
m_pColumnsEdit
->
SetValue
(
nColumns
);
m_pBookModeChk
->
Check
();
}
}
...
...
@@ -277,52 +286,52 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
}
SvxZoomDialog
::~
SvxZoomDialog
()
{
delete
pOutSet
;
pOutSet
=
0
;
}
{}
IMPL_LINK
(
SvxZoomDialog
,
UserHdl
,
RadioButton
*
,
pBtn
)
IMPL_LINK
(
SvxZoomDialog
,
UserHdl
,
RadioButton
*
,
pButton
)
{
bModified
=
true
;
m
bModified
=
true
;
if
(
pB
t
n
==
m_pUserBtn
)
if
(
pB
utto
n
==
m_pUserBtn
)
{
m_pUserEdit
->
Enable
();
m_pUserEdit
->
GrabFocus
();
}
else
{
m_pUserEdit
->
Disable
();
}
return
0
;
}
IMPL_LINK_NOARG
(
SvxZoomDialog
,
SpinHdl
)
{
if
(
!
m_pUserBtn
->
IsChecked
()
)
if
(
!
m_pUserBtn
->
IsChecked
()
)
return
0
;
bModified
=
true
;
mbModified
=
true
;
return
0
;
}
IMPL_LINK
(
SvxZoomDialog
,
ViewLayoutUserHdl
,
RadioButton
*
,
pBtn
)
IMPL_LINK
(
SvxZoomDialog
,
ViewLayoutUserHdl
,
RadioButton
*
,
pButton
)
{
bModified
=
true
;
m
bModified
=
true
;
if
(
pB
t
n
==
m_pAutomaticBtn
)
if
(
pB
utto
n
==
m_pAutomaticBtn
)
{
m_pColumnsEdit
->
Disable
();
m_pBookModeChk
->
Disable
();
}
else
if
(
pB
t
n
==
m_pSingleBtn
)
else
if
(
pB
utto
n
==
m_pSingleBtn
)
{
m_pColumnsEdit
->
Disable
();
m_pBookModeChk
->
Disable
();
}
else
if
(
pB
t
n
==
m_pColumnsBtn
)
else
if
(
pB
utto
n
==
m_pColumnsBtn
)
{
m_pColumnsEdit
->
Enable
();
m_pColumnsEdit
->
GrabFocus
();
if
(
0
==
m_pColumnsEdit
->
GetValue
()
%
2
)
if
(
m_pColumnsEdit
->
GetValue
()
%
2
==
0
)
m_pBookModeChk
->
Enable
();
}
else
...
...
@@ -334,71 +343,75 @@ IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn )
return
0
;
}
IMPL_LINK
(
SvxZoomDialog
,
ViewLayoutSpinHdl
,
NumericField
*
,
pEdt
)
IMPL_LINK
(
SvxZoomDialog
,
ViewLayoutSpinHdl
,
NumericField
*
,
pEdit
)
{
if
(
pEdt
==
m_pColumnsEdit
&&
!
m_pColumnsBtn
->
IsChecked
()
)
if
(
pEdit
==
m_pColumnsEdit
&&
!
m_pColumnsBtn
->
IsChecked
()
)
return
0
;
if
(
0
==
m_pColumnsEdit
->
GetValue
()
%
2
)
if
(
m_pColumnsEdit
->
GetValue
()
%
2
==
0
)
{
m_pBookModeChk
->
Enable
();
}
else
{
m_pBookModeChk
->
Check
(
false
);
m_pBookModeChk
->
Check
(
false
);
m_pBookModeChk
->
Disable
();
}
bModified
=
true
;
m
bModified
=
true
;
return
0
;
}
IMPL_LINK
(
SvxZoomDialog
,
ViewLayoutCheckHdl
,
CheckBox
*
,
pChk
)
IMPL_LINK
(
SvxZoomDialog
,
ViewLayoutCheckHdl
,
CheckBox
*
,
pCheckBox
)
{
if
(
pCh
k
==
m_pBookModeChk
&&
!
m_pColumnsBtn
->
IsChecked
())
if
(
pCh
eckBox
==
m_pBookModeChk
&&
!
m_pColumnsBtn
->
IsChecked
())
return
0
;
bModified
=
true
;
m
bModified
=
true
;
return
0
;
}
IMPL_LINK
(
SvxZoomDialog
,
OKHdl
,
Button
*
,
pBtn
)
IMPL_LINK
(
SvxZoomDialog
,
OKHdl
,
Button
*
,
pButton
)
{
if
(
bModified
||
m_pOKBtn
!=
pBtn
)
if
(
mbModified
||
m_pOKBtn
!=
pButton
)
{
SvxZoomItem
aZoomItem
(
SVX_ZOOM_PERCENT
,
0
,
rSet
.
GetPool
()
->
GetWhich
(
SID_ATTR_ZOOM
)
);
SvxViewLayoutItem
aViewLayoutItem
(
0
,
false
,
rSet
.
GetPool
()
->
GetWhich
(
SID_ATTR_VIEWLAYOUT
)
);
SvxZoomItem
aZoomItem
(
SVX_ZOOM_PERCENT
,
0
,
mrSet
.
GetPool
()
->
GetWhich
(
SID_ATTR_ZOOM
)
);
SvxViewLayoutItem
aViewLayoutItem
(
0
,
false
,
mrSet
.
GetPool
()
->
GetWhich
(
SID_ATTR_VIEWLAYOUT
)
);
if
(
m_pOKBtn
==
pBtn
)
if
(
m_pOKBtn
==
pButton
)
{
sal_uInt16
nFactor
=
GetFactor
();
if
(
SPECIAL_FACTOR
==
nFactor
)
if
(
SPECIAL_FACTOR
==
nFactor
)
{
if
(
m_pOptimalBtn
->
IsChecked
()
)
aZoomItem
.
SetType
(
SVX_ZOOM_OPTIMAL
);
else
if
(
m_pPageWidthBtn
->
IsChecked
()
)
aZoomItem
.
SetType
(
SVX_ZOOM_PAGEWIDTH
);
else
if
(
m_pWholePageBtn
->
IsChecked
()
)
aZoomItem
.
SetType
(
SVX_ZOOM_WHOLEPAGE
);
if
(
m_pOptimalBtn
->
IsChecked
()
)
aZoomItem
.
SetType
(
SVX_ZOOM_OPTIMAL
);
else
if
(
m_pPageWidthBtn
->
IsChecked
()
)
aZoomItem
.
SetType
(
SVX_ZOOM_PAGEWIDTH
);
else
if
(
m_pWholePageBtn
->
IsChecked
()
)
aZoomItem
.
SetType
(
SVX_ZOOM_WHOLEPAGE
);
}
else
aZoomItem
.
SetValue
(
nFactor
);
{
aZoomItem
.
SetValue
(
nFactor
);
}
if
(
m_pAutomaticBtn
->
IsChecked
()
)
if
(
m_pAutomaticBtn
->
IsChecked
()
)
{
aViewLayoutItem
.
SetValue
(
0
);
aViewLayoutItem
.
SetBookMode
(
false
);
aViewLayoutItem
.
SetValue
(
0
);
aViewLayoutItem
.
SetBookMode
(
false
);
}
if
(
m_pSingleBtn
->
IsChecked
()
)
if
(
m_pSingleBtn
->
IsChecked
()
)
{
aViewLayoutItem
.
SetValue
(
1
);
aViewLayoutItem
.
SetBookMode
(
false
);
aViewLayoutItem
.
SetValue
(
1
);
aViewLayoutItem
.
SetBookMode
(
false
);
}
else
if
(
m_pColumnsBtn
->
IsChecked
()
)
else
if
(
m_pColumnsBtn
->
IsChecked
()
)
{
aViewLayoutItem
.
SetValue
(
static_cast
<
sal_uInt16
>
(
m_pColumnsEdit
->
GetValue
())
);
aViewLayoutItem
.
SetBookMode
(
m_pBookModeChk
->
IsChecked
()
);
aViewLayoutItem
.
SetValue
(
static_cast
<
sal_uInt16
>
(
m_pColumnsEdit
->
GetValue
())
);
aViewLayoutItem
.
SetBookMode
(
m_pBookModeChk
->
IsChecked
()
);
}
}
else
...
...
@@ -406,23 +419,27 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
OSL_FAIL
(
"Wrong Button"
);
return
0
;
}
pOutSet
=
new
SfxItemSet
(
rSet
);
pOutSet
->
Put
(
aZoomItem
);
mpOutSet
.
reset
(
new
SfxItemSet
(
mrSet
)
);
mpOutSet
->
Put
(
aZoomItem
);
// don't set attribute in case the whole viewlayout stuff is disabled:
if
(
m_pViewFrame
->
IsEnabled
())
pOutSet
->
Put
(
aViewLayoutItem
);
m
pOutSet
->
Put
(
aViewLayoutItem
);
// memorize value from the UserEdit beyond the dialog
SfxObjectShell
*
pShell
=
SfxObjectShell
::
Current
();
if
(
pShell
)
pShell
->
PutItem
(
SfxUInt16Item
(
SID_ATTR_ZOOM_USER
,
(
sal_uInt16
)
m_pUserEdit
->
GetValue
()
)
);
if
(
pShell
)
{
sal_uInt16
nZoomValue
=
static_cast
<
sal_uInt16
>
(
m_pUserEdit
->
GetValue
());
pShell
->
PutItem
(
SfxUInt16Item
(
SID_ATTR_ZOOM_USER
,
nZoomValue
));
}
EndDialog
(
RET_OK
);
}
else
{
EndDialog
(
RET_CANCEL
);
}
return
0
;
}
...
...
cui/source/inc/zoom.hxx
Dosyayı görüntüle @
767ec466
...
...
@@ -27,44 +27,44 @@
class
SvxZoomDialog
:
public
SfxModalDialog
{
private
:
RadioButton
*
m_pOptimalBtn
;
RadioButton
*
m_pWholePageBtn
;
RadioButton
*
m_pPageWidthBtn
;
RadioButton
*
m_p100Btn
;
RadioButton
*
m_pUserBtn
;
MetricField
*
m_pUserEdit
;
RadioButton
*
m_pOptimalBtn
;
RadioButton
*
m_pWholePageBtn
;
RadioButton
*
m_pPageWidthBtn
;
RadioButton
*
m_p100Btn
;
RadioButton
*
m_pUserBtn
;
MetricField
*
m_pUserEdit
;
VclContainer
*
m_pViewFrame
;
RadioButton
*
m_pAutomaticBtn
;
RadioButton
*
m_pSingleBtn
;
RadioButton
*
m_pColumnsBtn
;
NumericField
*
m_pColumnsEdit
;
CheckBox
*
m_pBookModeChk
;
VclContainer
*
m_pViewFrame
;
RadioButton
*
m_pAutomaticBtn
;
RadioButton
*
m_pSingleBtn
;
RadioButton
*
m_pColumnsBtn
;
NumericField
*
m_pColumnsEdit
;
CheckBox
*
m_pBookModeChk
;
OKButton
*
m_pOKBtn
;
OKButton
*
m_pOKBtn
;
const
SfxItemSet
&
rSet
;
SfxItemSet
*
pOutSet
;
bool
bModified
;
const
SfxItemSet
&
m
rSet
;
std
::
unique_ptr
<
SfxItemSet
>
m
pOutSet
;
bool
m
bModified
;
DECL_LINK
(
UserHdl
,
RadioButton
*
);
DECL_LINK
(
SpinHdl
,
void
*
);
DECL_LINK
(
ViewLayoutUserHdl
,
RadioButton
*
);
DECL_LINK
(
ViewLayoutSpinHdl
,
NumericField
*
);
DECL_LINK
(
ViewLayoutCheckHdl
,
CheckBox
*
);
DECL_LINK
(
OKHdl
,
Button
*
);
DECL_LINK
(
UserHdl
,
RadioButton
*
);
DECL_LINK
(
SpinHdl
,
void
*
);
DECL_LINK
(
ViewLayoutUserHdl
,
RadioButton
*
);
DECL_LINK
(
ViewLayoutSpinHdl
,
NumericField
*
);
DECL_LINK
(
ViewLayoutCheckHdl
,
CheckBox
*
);
DECL_LINK
(
OKHdl
,
Button
*
);
public
:
SvxZoomDialog
(
vcl
::
Window
*
pParent
,
const
SfxItemSet
&
rCoreSet
);
SvxZoomDialog
(
vcl
::
Window
*
pParent
,
const
SfxItemSet
&
rCoreSet
);
virtual
~
SvxZoomDialog
();
const
SfxItemSet
*
GetOutputItemSet
()
const
{
return
pOutSet
;
}
const
SfxItemSet
*
GetOutputItemSet
()
const
;
sal_uInt16
GetFactor
()
const
;
void
SetFactor
(
sal_uInt16
nNewFactor
,
sal_uInt16
nBtnId
=
0
);
sal_uInt16
GetFactor
()
const
;
void
SetFactor
(
sal_uInt16
nNewFactor
,
sal_uInt16
nButtonId
=
0
);
void
HideButton
(
sal_uInt16
nBtnId
);
void
SetLimits
(
sal_uInt16
nMin
,
sal_uInt16
nMax
);
void
HideButton
(
sal_uInt16
nButtonId
);
void
SetLimits
(
sal_uInt16
nMin
,
sal_uInt16
nMax
);
};
#endif
...
...
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