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
c95d9019
Kaydet (Commit)
c95d9019
authored
Eyl 15, 2011
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Header/Footer: add the Border and Background... menu item
üst
8081794d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
115 additions
and
39 deletions
+115
-39
hdft.hxx
svx/inc/svx/hdft.hxx
+6
-0
hdft.cxx
svx/source/dialog/hdft.cxx
+53
-39
cmdid.h
sw/inc/cmdid.h
+1
-0
swcommands.h
sw/inc/swcommands.h
+1
-0
mn.src
sw/source/ui/app/mn.src
+6
-0
HeaderFooterWin.cxx
sw/source/ui/docvw/HeaderFooterWin.cxx
+48
-0
No files found.
svx/inc/svx/hdft.hxx
Dosyayı görüntüle @
c95d9019
...
...
@@ -40,6 +40,12 @@
#include <svx/pagectrl.hxx>
#include "svx/svxdllapi.h"
namespace
svx
{
SVX_DLLPUBLIC
bool
ShowBorderBackgroundDlg
(
Window
*
pParent
,
SfxItemSet
*
pBBSet
,
bool
bEnableBackgroundSelector
);
}
// class SvxHFPage ------------------------------------------------------
class
SVX_DLLPUBLIC
SvxHFPage
:
public
SfxTabPage
...
...
svx/source/dialog/hdft.cxx
Dosyayı görüntüle @
c95d9019
...
...
@@ -89,6 +89,36 @@ static sal_uInt16 pRanges[] =
0
};
namespace
svx
{
bool
ShowBorderBackgroundDlg
(
Window
*
pParent
,
SfxItemSet
*
pBBSet
,
bool
bEnableBackgroundSelector
)
{
bool
bRes
=
false
;
SvxAbstractDialogFactory
*
pFact
=
SvxAbstractDialogFactory
::
Create
();
if
(
pFact
)
{
SfxAbstractTabDialog
*
pDlg
=
pFact
->
CreateSvxBorderBackgroundDlg
(
pParent
,
*
pBBSet
,
bEnableBackgroundSelector
);
DBG_ASSERT
(
pDlg
,
"Dialogdiet fail!"
);
if
(
pDlg
->
Execute
()
==
RET_OK
&&
pDlg
->
GetOutputItemSet
()
)
{
SfxItemIter
aIter
(
*
pDlg
->
GetOutputItemSet
()
);
const
SfxPoolItem
*
pItem
=
aIter
.
FirstItem
();
while
(
pItem
)
{
if
(
!
IsInvalidItem
(
pItem
)
)
pBBSet
->
Put
(
*
pItem
);
pItem
=
aIter
.
NextItem
();
}
bRes
=
true
;
}
delete
pDlg
;
}
return
bRes
;
}
}
// returns the Which values to the range
...
...
@@ -531,54 +561,38 @@ IMPL_LINK( SvxHFPage, BackgroundHdl, Button *, EMPTYARG )
pBBSet
->
Put
(
*
pItem
);
}
SvxAbstractDialogFactory
*
pFact
=
SvxAbstractDialogFactory
::
Create
();
if
(
pFact
)
if
(
svx
::
ShowBorderBackgroundDlg
(
this
,
pBBSet
,
bEnableBackgroundSelector
)
)
{
SfxAbstractTabDialog
*
pDlg
=
pFact
->
CreateSvxBorderBackgroundDlg
(
this
,
*
pBBSet
,
bEnableBackgroundSelector
);
DBG_ASSERT
(
pDlg
,
"Dialogdiet fail!"
);
if
(
pDlg
->
Execute
()
==
RET_OK
&&
pDlg
->
GetOutputItemSet
()
)
{
SfxItemIter
aIter
(
*
pDlg
->
GetOutputItemSet
()
);
const
SfxPoolItem
*
pItem
=
aIter
.
FirstItem
();
while
(
pItem
)
{
if
(
!
IsInvalidItem
(
pItem
)
)
pBBSet
->
Put
(
*
pItem
);
pItem
=
aIter
.
NextItem
();
}
//----------------------------------------------------------------
//----------------------------------------------------------------
sal_uInt16
nWhich
=
GetWhich
(
SID_ATTR_BRUSH
);
if
(
pBBSet
->
GetItemState
(
nWhich
)
==
SFX_ITEM_SET
)
{
const
SvxBrushItem
&
rItem
=
(
const
SvxBrushItem
&
)
pBBSet
->
Get
(
nWhich
);
if
(
nId
==
SID_ATTR_PAGE_HEADERSET
)
aBspWin
.
SetHdColor
(
rItem
.
GetColor
()
);
else
aBspWin
.
SetFtColor
(
rItem
.
GetColor
()
);
}
sal_uInt16
nWhich
=
GetWhich
(
SID_ATTR_BRUSH
);
//----------------------------------------------------------------
if
(
pBBSet
->
GetItemState
(
nWhich
)
==
SFX_ITEM_SET
)
{
const
SvxBrushItem
&
rItem
=
(
const
SvxBrushItem
&
)
pBBSet
->
Get
(
nWhich
);
if
(
nId
==
SID_ATTR_PAGE_HEADERSET
)
aBspWin
.
SetHdColor
(
rItem
.
GetColor
()
);
else
aBspWin
.
SetFtColor
(
rItem
.
GetColor
()
);
}
nWhich
=
GetWhich
(
SID_ATTR_BORDER_OUTER
);
//----------------------------------------------------------------
if
(
pBBSet
->
GetItemState
(
nWhich
)
==
SFX_ITEM_SET
)
{
const
SvxBoxItem
&
rItem
=
(
const
SvxBoxItem
&
)
pBBSet
->
Get
(
nWhich
);
nWhich
=
GetWhich
(
SID_ATTR_BORDER_OUTER
);
if
(
nId
==
SID_ATTR_PAGE_HEADERSET
)
aBspWin
.
SetHdBorder
(
rItem
);
else
aBspWin
.
SetFtBorder
(
rItem
);
}
if
(
pBBSet
->
GetItemState
(
nWhich
)
==
SFX_ITEM_SET
)
{
const
SvxBoxItem
&
rItem
=
(
const
SvxBoxItem
&
)
pBBSet
->
Get
(
nWhich
);
UpdateExample
();
if
(
nId
==
SID_ATTR_PAGE_HEADERSET
)
aBspWin
.
SetHdBorder
(
rItem
);
else
aBspWin
.
SetFtBorder
(
rItem
);
}
delete
pDlg
;
UpdateExample
();
}
return
0
;
}
...
...
sw/inc/cmdid.h
Dosyayı görüntüle @
c95d9019
...
...
@@ -1017,6 +1017,7 @@ included in c-context files, so c++ style stuff will cause problems.
#define FN_HEADERFOOTER_EDIT (FN_HEADERFOOTER+1)
#define FN_HEADERFOOTER_DELETE (FN_HEADERFOOTER+2)
#define FN_HEADERFOOTER_BORDERBACK (FN_HEADERFOOTER+3)
/*--------------------------------------------------------------------
Region: Parameter
...
...
sw/inc/swcommands.h
Dosyayı görüntüle @
c95d9019
...
...
@@ -435,5 +435,6 @@
#define CMD_FN_COPY_HYPERLINK_LOCATION ".uno:CopyHyperlinkLocation"
#define CMD_FN_HEADERFOOTER_EDIT ".uno:HeaderFooterEdit"
#define CMD_FN_HEADERFOOTER_DELETE ".uno:HeaderFooterDelete"
#define CMD_FN_HEADERFOOTER_BORDERBACK ".uno:HeaderFooterBorderBackground"
#endif
sw/source/ui/app/mn.src
Dosyayı görüntüle @
c95d9019
...
...
@@ -1445,6 +1445,12 @@ Menu MN_HEADERFOOTER_BUTTON
Text [ en-US ] = "Format $1..." ;
};
MenuItem
{
Identifier = FN_HEADERFOOTER_BORDERBACK ;
HelpID = CMD_FN_HEADERFOOTER_BORDERBACK ;
Text [ en-US ] = "Border and Background..." ;
};
MenuItem
{
Identifier = FN_HEADERFOOTER_DELETE ;
HelpID = CMD_FN_HEADERFOOTER_DELETE ;
...
...
sw/source/ui/docvw/HeaderFooterWin.cxx
Dosyayı görüntüle @
c95d9019
...
...
@@ -45,7 +45,9 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/color/bcolortools.hxx>
#include <editeng/boxitem.hxx>
#include <svtools/svtdata.hxx>
#include <svx/hdft.hxx>
#include <vcl/decoview.hxx>
#include <vcl/gradient.hxx>
#include <vcl/menubtn.hxx>
...
...
@@ -292,6 +294,52 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
nPageId
,
&
rSh
);
}
break
;
case
FN_HEADERFOOTER_BORDERBACK
:
{
const
SwPageDesc
*
pDesc
=
m_pPageFrm
->
GetPageDesc
();
const
SwFrmFmt
&
rMaster
=
pDesc
->
GetMaster
();
SwFrmFmt
*
pHFFmt
=
const_cast
<
SwFrmFmt
*
>
(
rMaster
.
GetFooter
().
GetFooterFmt
()
);
if
(
m_bIsHeader
)
pHFFmt
=
const_cast
<
SwFrmFmt
*
>
(
rMaster
.
GetHeader
().
GetHeaderFmt
()
);
SfxItemPool
*
pPool
=
pHFFmt
->
GetAttrSet
().
GetPool
();
SfxItemSet
aSet
(
*
pPool
,
RES_BACKGROUND
,
RES_BACKGROUND
,
RES_BOX
,
RES_BOX
,
SID_ATTR_BORDER_INNER
,
SID_ATTR_BORDER_INNER
,
RES_SHADOW
,
RES_SHADOW
,
0
);
aSet
.
Put
(
pHFFmt
->
GetAttrSet
()
);
// Create a box info item... needed by the dialog
SvxBoxInfoItem
aBoxInfo
(
SID_ATTR_BORDER_INNER
);
const
SfxPoolItem
*
pBoxInfo
;
if
(
SFX_ITEM_SET
==
pHFFmt
->
GetAttrSet
().
GetItemState
(
SID_ATTR_BORDER_INNER
,
sal_True
,
&
pBoxInfo
)
)
aBoxInfo
=
*
(
SvxBoxInfoItem
*
)
pBoxInfo
;
aBoxInfo
.
SetTable
(
sal_False
);
aBoxInfo
.
SetDist
(
sal_True
);
aBoxInfo
.
SetMinDist
(
sal_False
);
aBoxInfo
.
SetDefDist
(
MIN_BORDER_DIST
);
aBoxInfo
.
SetValid
(
VALID_DISABLE
);
aSet
.
Put
(
aBoxInfo
);
if
(
svx
::
ShowBorderBackgroundDlg
(
this
,
&
aSet
,
true
)
)
{
const
SfxPoolItem
*
pItem
;
if
(
SFX_ITEM_SET
==
aSet
.
GetItemState
(
RES_BACKGROUND
,
sal_False
,
&
pItem
)
)
pHFFmt
->
SetFmtAttr
(
*
pItem
);
if
(
SFX_ITEM_SET
==
aSet
.
GetItemState
(
RES_BOX
,
sal_False
,
&
pItem
)
)
pHFFmt
->
SetFmtAttr
(
*
pItem
);
if
(
SFX_ITEM_SET
==
aSet
.
GetItemState
(
RES_SHADOW
,
sal_False
,
&
pItem
)
)
pHFFmt
->
SetFmtAttr
(
*
pItem
);
}
}
break
;
case
FN_HEADERFOOTER_DELETE
:
{
rSh
.
ChangeHeaderOrFooter
(
rStyleName
,
m_bIsHeader
,
false
,
true
);
...
...
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