Skip to content

Commit

Permalink
[GSoC] Add Bitmap tab to area dialog
Browse files Browse the repository at this point in the history
Change-Id: I6549e7eb4efd24d035b0383a750698a4c3f16cf7
Reviewed-on: https://gerrit.libreoffice.org/27546
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
  • Loading branch information
rishabhkumar296 authored and smehrbrodt committed Jul 26, 2016
1 parent c9b2af0 commit a44a069
Show file tree
Hide file tree
Showing 7 changed files with 627 additions and 3 deletions.
1 change: 1 addition & 0 deletions cui/Library_cui.mk
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/tabpages/textanim \
cui/source/tabpages/textattr \
cui/source/tabpages/tparea \
cui/source/tabpages/tpbitmap \
cui/source/tabpages/tpcolor \
cui/source/tabpages/tpgradnt \
cui/source/tabpages/tphatch \
Expand Down
1 change: 1 addition & 0 deletions cui/UIConfig_cui.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/autocorrectdialog \
cui/uiconfig/ui/backgroundpage \
cui/uiconfig/ui/baselinksdialog \
cui/uiconfig/ui/bitmaptabpage \
cui/uiconfig/ui/blackorwhitelistentrydialog \
cui/uiconfig/ui/borderareatransparencydialog \
cui/uiconfig/ui/borderbackgrounddialog \
Expand Down
61 changes: 60 additions & 1 deletion cui/source/inc/cuitabarea.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SvxAreaTabDialog : public SfxTabDialog
sal_uInt16 m_nColorTabPage;
sal_uInt16 m_nGradientTabPage;
sal_uInt16 m_nHatchTabPage;
//sal_uInt16 m_nBitmapTabPage;
sal_uInt16 m_nBitmapTabPage;
sal_uInt16 m_nPatternTabPage;

private:
Expand Down Expand Up @@ -553,6 +553,65 @@ public:

/************************************************************************/

class SvxBitmapTabPage : public SvxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:

VclPtr<SvxPresetListBox> m_pBitmapLB;
VclPtr<PushButton> m_pBtnImport;
VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;

const SfxItemSet& m_rOutAttrs;

XBitmapListRef m_pBitmapList;
ChangeType* m_pnBitmapListState;
XFillStyleItem m_aXFStyleItem;
XFillBitmapItem m_aXBitmapItem;

sal_uInt16* m_nPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_nPos;

bool* m_pbAreaTP;

XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;

DECL_LINK_TYPED( ModifyBitmapHdl, ValueSet*, void );
DECL_LINK_TYPED( ClickRenameHdl, SvxPresetListBox*, void );
DECL_LINK_TYPED( ClickDeleteHdl, SvxPresetListBox*, void );
DECL_LINK_TYPED( ClickImportHdl, Button*, void );
void ClickBitmapHdl_Impl();
sal_Int32 SearchBitmapList(const OUString& rBitmapName);

public:
SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxBitmapTabPage();
virtual void dispose() override;

void Construct();

static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );

virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
virtual void ActivatePage( const SfxItemSet& rSet ) override;
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) override;

void SetBitmapList( XBitmapListRef pBmpLst) { m_pBitmapList = pBmpLst; }

void SetPageType( sal_uInt16* pInType ) { m_nPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { m_nPos = pInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
void SetBmpChgd( ChangeType* pIn ) { m_pnBitmapListState = pIn; }
};

/************************************************************************/

class SvxPatternTabPage : public SvxTabPage
{
using TabPage::ActivatePage;
Expand Down
11 changes: 11 additions & 0 deletions cui/source/tabpages/tabarea.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
m_nColorTabPage = AddTabPage( "RID_SVXPAGE_COLOR", SvxColorTabPage::Create, nullptr );
m_nGradientTabPage = AddTabPage( "RID_SVXPAGE_GRADIENT", SvxGradientTabPage::Create, nullptr );
m_nHatchTabPage = AddTabPage( "RID_SVXPAGE_HATCH", SvxHatchTabPage::Create, nullptr );
m_nBitmapTabPage = AddTabPage( "RID_SVXPAGE_BITMAP", SvxBitmapTabPage::Create, nullptr );
m_nPatternTabPage = AddTabPage( "RID_SVXPAGE_PATTERN", SvxPatternTabPage::Create, nullptr);

SetCurPageId( "RID_SVXPAGE_AREA" );
Expand Down Expand Up @@ -309,6 +310,16 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
static_cast<SvxHatchTabPage&>(rPage).SetColorChgd( &mnColorListState );
static_cast<SvxHatchTabPage&>(rPage).Construct();
}
else if (nId == m_nBitmapTabPage )
{
static_cast<SvxBitmapTabPage&>(rPage).SetBitmapList( mpBitmapList );
static_cast<SvxBitmapTabPage&>(rPage).SetPageType( &mnPageType );
static_cast<SvxBitmapTabPage&>(rPage).SetDlgType( 0 );
static_cast<SvxBitmapTabPage&>(rPage).SetPos( &mnPos );
static_cast<SvxBitmapTabPage&>(rPage).SetAreaTP( &mbAreaTP );
static_cast<SvxBitmapTabPage&>(rPage).SetBmpChgd( &mnBitmapListState );
static_cast<SvxBitmapTabPage&>(rPage).Construct();
}
else if (nId == m_nPatternTabPage)
{
static_cast<SvxPatternTabPage&>(rPage).SetColorList( mpColorList );
Expand Down
Loading

0 comments on commit a44a069

Please sign in to comment.