Kaydet (Commit) 32193abe authored tarafından Caolán McNamara's avatar Caolán McNamara

move m_bVertical down to SwPageExample from SwPageGridExample

Change-Id: I242d8e7296daff83d73c199f5f593200796607bc
üst 3cc52de5
...@@ -44,6 +44,14 @@ ...@@ -44,6 +44,14 @@
// Taking the updated values from the set // Taking the updated values from the set
void SwPageExample::UpdateExample( const SfxItemSet& rSet ) void SwPageExample::UpdateExample( const SfxItemSet& rSet )
{ {
if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR, true))
{
const SvxFrameDirectionItem& rDirItem =
static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR));
m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
}
SfxItemPool* pPool = rSet.GetPool(); SfxItemPool* pPool = rSet.GetPool();
sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE ); sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE );
if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET ) if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
...@@ -590,13 +598,6 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet ) ...@@ -590,13 +598,6 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
//get the grid information //get the grid information
if(SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID, true)) if(SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID, true))
pGridItem = static_cast<SwTextGridItem*>(static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone()); pGridItem = static_cast<SwTextGridItem*>(static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone());
if( SfxItemState::DEFAULT <= rSet.GetItemState( RES_FRAMEDIR, true ))
{
const SvxFrameDirectionItem& rDirItem =
static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR));
m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
}
SwPageExample::UpdateExample(rSet); SwPageExample::UpdateExample(rSet);
} }
......
...@@ -30,9 +30,12 @@ class SfxItemSet; ...@@ -30,9 +30,12 @@ class SfxItemSet;
class SW_DLLPUBLIC SwPageExample : public SvxPageWindow class SW_DLLPUBLIC SwPageExample : public SvxPageWindow
{ {
protected:
bool m_bVertical;
public: public:
SwPageExample(vcl::Window* pPar) SwPageExample(vcl::Window* pPar)
: SvxPageWindow(pPar) : SvxPageWindow(pPar)
, m_bVertical(false)
{ {
SetSize(SvxPaperInfo::GetPaperSize(PAPER_A4)); SetSize(SvxPaperInfo::GetPaperSize(PAPER_A4));
} }
...@@ -45,7 +48,6 @@ class SwTextGridItem; ...@@ -45,7 +48,6 @@ class SwTextGridItem;
class SW_DLLPUBLIC SwPageGridExample : public SwPageExample class SW_DLLPUBLIC SwPageGridExample : public SwPageExample
{ {
SwTextGridItem* pGridItem; SwTextGridItem* pGridItem;
bool m_bVertical;
protected: protected:
virtual void DrawPage(vcl::RenderContext& rRenderContext, virtual void DrawPage(vcl::RenderContext& rRenderContext,
const Point& rPoint, const Point& rPoint,
...@@ -55,7 +57,6 @@ public: ...@@ -55,7 +57,6 @@ public:
SwPageGridExample(vcl::Window* pPar) SwPageGridExample(vcl::Window* pPar)
: SwPageExample(pPar) : SwPageExample(pPar)
, pGridItem(0) , pGridItem(0)
, m_bVertical(false)
{} {}
virtual ~SwPageGridExample(); virtual ~SwPageGridExample();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment