diff options
author | Armin Le Grand <alg@apache.org> | 2014-03-19 16:17:02 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-28 14:31:08 +0100 |
commit | 6e61ecd09679a66060f932835622821d39e92f01 (patch) | |
tree | 4ce71adaa6da133cab09660b3efc1341104022a2 /cui | |
parent | c7190108f02921868cb617040aebdb2d22c02c1f (diff) |
Merge back branch alg_writerframes to trunk
(cherry picked from commit b635b4fa4e42053d30ab639643d2236a20243f62)
Conflicts:
comphelper/inc/comphelper/TypeGeneration.hxx
comphelper/source/property/TypeGeneration.cxx
cui/source/factory/dlgfact.hxx
cui/source/inc/cuitabarea.hxx
cui/source/tabpages/tabarea.cxx
cui/source/tabpages/tabarea.hrc
cui/source/tabpages/tabarea.src
cui/source/tabpages/tparea.cxx
drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
drawinglayer/source/texture/texture.cxx
editeng/inc/editeng/unotext.hxx
editeng/source/items/frmitems.cxx
include/drawinglayer/texture/texture.hxx
include/editeng/brushitem.hxx
include/svx/sdr/primitive2d/sdrdecompositiontools.hxx
include/svx/svxids.hrc
include/xmloff/xmltypes.hxx
reportdesign/source/ui/misc/UITools.cxx
sc/source/ui/drawfunc/drawsh.cxx
sfx2/source/dialog/tabdlg.cxx
svl/source/undo/undo.cxx
svx/inc/svx/unoshprp.hxx
sw/Library_sw.mk
sw/inc/doc.hxx
sw/inc/format.hxx
sw/inc/frmfmt.hxx
sw/inc/swatrset.hxx
sw/inc/unomap.hxx
sw/inc/unoprnms.hxx
sw/source/core/access/accpara.cxx
sw/source/core/attr/format.cxx
sw/source/core/attr/swatrset.cxx
sw/source/core/doc/docdraw.cxx
sw/source/core/doc/docfly.cxx
sw/source/core/doc/notxtfrm.cxx
sw/source/core/inc/frame.hxx
sw/source/core/inc/frmtool.hxx
sw/source/core/layout/atrfrm.cxx
sw/source/core/layout/paintfrm.cxx
sw/source/core/text/inftxt.cxx
sw/source/core/text/porfld.cxx
sw/source/core/text/txtfly.cxx
sw/source/core/txtnode/fntcache.cxx
sw/source/core/uibase/app/docst.cxx
sw/source/core/uibase/app/docstyle.cxx
sw/source/core/uibase/shells/drawdlg.cxx
sw/source/core/uibase/shells/frmsh.cxx
sw/source/core/unocore/unoframe.cxx
sw/source/core/unocore/unomap.cxx
sw/source/core/unocore/unoprnms.cxx
sw/source/core/unocore/unostyle.cxx
sw/source/ui/fmtui/tmpdlg.cxx
sw/source/ui/fmtui/tmpdlg.src
sw/source/ui/frmdlg/frmdlg.cxx
sw/source/ui/frmdlg/frmpage.src
sw/source/ui/inc/frmsh.hxx
xmloff/source/text/txtprhdl.cxx
xmloff/source/text/txtprmap.cxx
Change-Id: Id3ffaa83bb5594d287f1ac8f2c1c9cf55c70946d
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 4 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/backgrnd.hxx | 16 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 1 | ||||
-rw-r--r-- | cui/source/inc/cuitabarea.hxx | 32 | ||||
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 177 | ||||
-rw-r--r-- | cui/source/tabpages/strings.src | 4 | ||||
-rw-r--r-- | cui/source/tabpages/tabarea.cxx | 13 | ||||
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 191 | ||||
-rw-r--r-- | cui/uiconfig/ui/areatabpage.ui | 13 |
10 files changed, 238 insertions, 215 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 35c7152e1fce..b358e5c9fb1b 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1515,9 +1515,9 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, - const SdrView* pSdrView ) + bool bShadow) { - SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel,pSdrView ); + SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel, bShadow ); return new AbstractSvxAreaTabDialog_Impl( pDlg ); } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index feaad78c1625..1cf6b4c43f95 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -660,7 +660,7 @@ public: virtual AbstractSvxAreaTabDialog* CreateSvxAreaTabDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, - const SdrView* pSdrView = NULL ) SAL_OVERRIDE; + bool bShadow ) SAL_OVERRIDE; virtual SfxAbstractTabDialog* CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* pObj = NULL, diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index bd247f38587c..bebea499e75f 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -32,8 +32,6 @@ struct SvxBackgroundTable_Impl; struct SvxBackgroundPara_Impl; struct SvxBackgroundPage_Impl; class SvxBrushItem; -class XFillStyleItem; -class XFillGradientItem; /** class SvxBackgroundTabPage -------------------------------------------- @@ -87,17 +85,6 @@ private: MetricField* m_pColTransMF; CheckBox* m_pBtnPreview; - // Gradient controls - VclFrame* m_pBackGroundGradientFrame; - GradientLB* m_pLbGradients; - SvxXRectPreview* m_pCtlPreview; - - // Gradient data - XGradientListRef m_pGradientList; - SfxItemPool* m_pXPool; - XFillAttrSetItem m_aXFillAttr; - SfxItemSet& m_rXFillSet; - // Background Bitmap ---------------------------------- VclContainer* m_pBitmapContainer; VclContainer* m_pFileFrame; @@ -141,8 +128,6 @@ private: void HideColorUI_Impl(); void ShowBitmapUI_Impl(); void HideBitmapUI_Impl(); - void ShowGradientUI_Impl(); - void HideGradientUI_Impl(); sal_Bool LoadLinkedGraphic_Impl(); void RaiseLoadError_Impl(); void SetGraphicPosition_Impl( SvxGraphicPosition ePos ); @@ -160,7 +145,6 @@ private: DECL_LINK(BackgroundColorHdl_Impl, void *); DECL_LINK( TblDestinationHdl_Impl, ListBox* ); DECL_LINK( ParaDestinationHdl_Impl, ListBox* ); - DECL_LINK(ModifyGradientHdl_Impl, void *); }; #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index ffad575ca114..6d2df8771b85 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -42,6 +42,7 @@ // used in "tabpages" #define RID_SVXSTRARY_PAPERSIZE_STD (RID_SVX_START + 142) #define RID_SVXSTRARY_PAPERSIZE_DRAW (RID_SVX_START + 143) +#define RID_SVXSTR_READ_DATA_ERROR (RID_SVX_START + 230) #define RID_SVXSTR_TABLE_PRESET_NONE (RID_SVX_START + 969) #define RID_SVXSTR_TABLE_PRESET_ONLYOUTER (RID_SVX_START + 970) #define RID_SVXSTR_TABLE_PRESET_OUTERHORI (RID_SVX_START + 971) diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 6ae9dbc37a68..a5c1a49a6b6d 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -75,10 +75,7 @@ protected: void SavePalettes(); public: - SvxAreaTabDialog( Window* pParent, - const SfxItemSet* pAttr, - SdrModel* pModel, - const SdrView* pSdrView = NULL ); + SvxAreaTabDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow ); ~SvxAreaTabDialog(); void SetNewColorList( XColorListRef pColTab ) @@ -114,8 +111,8 @@ class SvxTransparenceTabPage : public SvxTabPage const SfxItemSet& rOutAttrs; RECT_POINT eRP; - sal_uInt16 nPageType; - sal_uInt16 nDlgType; + sal_uInt16 nPageType; + sal_uInt16 nDlgType; // main selection RadioButton* m_pRbtTransOff; @@ -238,6 +235,13 @@ private: XHatchListRef pHatchingList; XBitmapListRef pBitmapList; + // Placeholders for pointer-based entries; these will be inited + // to point to these so that the page is usable without that + // SvxAreaTabDialog has to call the setter methods (e.g. SetColorChgd). + // Without that the pages used in SvxAreaTabDialog are not usable + ChangeType maFixed_ChangeType; + sal_Bool maFixed_sal_Bool; + ChangeType* pnColorListState; ChangeType* pnBitmapListState; ChangeType* pnGradientListState; @@ -247,7 +251,7 @@ private: sal_uInt16 nDlgType; sal_Int32 nPos; - sal_Bool* pbAreaTP; + sal_Bool* pbAreaTP; XOutdevItemPool* pXPool; XFillAttrSetItem aXFillAttr; @@ -256,6 +260,14 @@ private: SfxMapUnit ePoolUnit; FieldUnit eFUnit; + //UUUU + bool mbOfferImportButton; + bool mbPositionsAdapted; + bool mbDirectGraphicSet; + Graphic maDirectGraphic; + OUString maDirectName; + PushButton* m_pBtnImport; + DECL_LINK(SelectDialogTypeHdl_Impl, void *); DECL_LINK( ModifyColorHdl_Impl, void * ); DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * ); @@ -264,6 +276,10 @@ private: DECL_LINK( ToggleHatchBckgrdColorHdl_Impl, void * ); DECL_LINK( ModifyBitmapHdl_Impl, void * ); DECL_LINK( ModifyStepCountHdl_Impl, void * ); + + //UUUU + DECL_LINK( ClickImportHdl_Impl, void * ); + DECL_LINK( ModifyTileHdl_Impl, void * ); DECL_LINK( ClickScaleHdl_Impl, void * ); void ClickInvisibleHdl_Impl(); @@ -273,7 +289,7 @@ private: void ClickBitmapHdl_Impl(); public: - SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ); + SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ); void Construct(); diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index c1d035991c9e..3193f01e5a84 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -51,8 +51,6 @@ #include <sfx2/htmlmode.hxx> #include <svtools/controldims.hrc> #include <svx/flagsdef.hxx> -#include <svx/xfillit0.hxx> -#include <svx/xflgrit.hxx> #include <svl/intitem.hxx> #include <sfx2/request.hxx> #include <svtools/grfmgr.hxx> @@ -352,9 +350,6 @@ void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt ) SvxBackgroundTabPage::SvxBackgroundTabPage(Window* pParent, const SfxItemSet& rCoreSet) : SvxTabPage(pParent, "BackgroundPage", "cui/ui/backgroundpage.ui", rCoreSet) - , m_pXPool(rCoreSet.GetPool()) - , m_aXFillAttr(m_pXPool) - , m_rXFillSet(m_aXFillAttr.GetItemSet()) , nHtmlMode(0) , bAllowShowSelector(true) , bIsGraphicValid(false) @@ -381,17 +376,6 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(Window* pParent, const SfxItemSet& rC get(m_pColTransMF, "transparencymf"); get(m_pBtnPreview, "showpreview"); - // Initialize gradient controls - get(m_pBackGroundGradientFrame, "backgroundgradientframe"); - get(m_pLbGradients, "gradientslb"); - Size aSize = getDrawListBoxOptimalSize(this); - m_pLbGradients->set_width_request(aSize.Width()); - m_pLbGradients->set_height_request(aSize.Height()); - get(m_pCtlPreview, "previewctl"); - aSize = getDrawPreviewOptimalSize(this); - m_pCtlPreview->set_width_request(aSize.Width()); - m_pCtlPreview->set_height_request(aSize.Height()); - get(m_pBitmapContainer, "graphicgrid"); get(m_pFileFrame, "fileframe"); get(m_pBtnBrowse, "browse"); @@ -790,7 +774,6 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet ) const SvxBrushItem& rOldItem = (const SvxBrushItem&)*pOld; SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos(); const sal_Bool bIsBrush = ( XFILL_SOLID == lcl_getFillStyle(m_pLbSelect) ); - const bool bIsGradient = ( XFILL_GRADIENT == lcl_getFillStyle(m_pLbSelect) ); // transparency has to be set if enabled, the color not already set to "No fill" and if( bColTransparency && @@ -798,37 +781,22 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet ) { aBgdColor.SetTransparency(lcl_PercentToTransparency(static_cast<long>(m_pColTransMF->GetValue()))); } - if ( ( (GPOS_NONE == eOldPos) && (bIsBrush || bIsGradient) ) - || ( (GPOS_NONE != eOldPos) && !(bIsBrush || bIsGradient) ) ) // Brush <-> Bitmap changed? + if ( ( (GPOS_NONE == eOldPos) && bIsBrush ) + || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap changed? { // background art hasn't been changed: if ( (GPOS_NONE == eOldPos) || !m_pLbSelect->IsVisible() ) { - if (bIsBrush) - { - // Brush-treatment: - if ( rOldItem.GetColor() != aBgdColor || - (SFX_ITEM_AVAILABLE >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection())) - { - bModified = true; - rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) ); - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) ) - rCoreSet.ClearItem( nWhich ); - // Handle XFILL_GRADIENT -> XFILL_SOLID - XFillStyleItem aFillStyleItem(XFILL_SOLID, GetWhich(SID_SW_ATTR_FILL_STYLE)); - rCoreSet.Put(aFillStyleItem); - } - else + // Brush-treatment: + if ( rOldItem.GetColor() != aBgdColor || + (SFX_ITEM_AVAILABLE >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection())) { - XFillStyleItem aFillStyleItem(((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue(), GetWhich(SID_SW_ATTR_FILL_STYLE)); - rCoreSet.Put(aFillStyleItem); - - const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT); - XFillGradientItem aFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue(), GetWhich(SID_SW_ATTR_FILL_GRADIENT)); - rCoreSet.Put(aFillGradientItem); + bModified = true; + rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) ); } + else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) ) + rCoreSet.ClearItem( nWhich ); } else { @@ -875,19 +843,9 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet ) } else // Brush <-> Bitmap changed! { - if (bIsBrush || bIsGradient) + if ( bIsBrush ) { rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) ); - if (bIsGradient) - { - // Handle XFILL_BITMAP -> XFILL_GRADIENT - XFillStyleItem aFillStyleItem(((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue(), GetWhich(SID_SW_ATTR_FILL_STYLE)); - rCoreSet.Put(aFillStyleItem); - - const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT); - XFillGradientItem aFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue(), GetWhich(SID_SW_ATTR_FILL_GRADIENT)); - rCoreSet.Put(aFillGradientItem); - } } else { @@ -916,7 +874,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet ) delete pTmpBrush; } } - bModified = ( bIsBrush || bIsGradient || m_pBtnLink->IsChecked() || bIsGraphicValid ); + bModified = ( bIsBrush || m_pBtnLink->IsChecked() || bIsGraphicValid ); } } else if ( SID_ATTR_BRUSH_CHAR == nSlot && aBgdColor != Color( COL_WHITE ) ) @@ -1132,7 +1090,6 @@ void SvxBackgroundTabPage::ShowSelector() m_pBtnArea->SetClickHdl( HDL(RadioClickHdl_Impl) ); m_pBtnTile->SetClickHdl( HDL(RadioClickHdl_Impl) ); m_pBtnPosition->SetClickHdl( HDL(RadioClickHdl_Impl) ); - m_pLbGradients->SetSelectHdl(HDL(ModifyGradientHdl_Impl)); // delayed loading via timer (because of UI-Update) pPageImpl->pLoadTimer = new Timer; @@ -1221,7 +1178,6 @@ void SvxBackgroundTabPage::ShowColorUI_Impl() if (!m_pBackGroundColorFrame->IsVisible()) { HideBitmapUI_Impl(); - HideGradientUI_Impl(); m_pBackGroundColorFrame->Show(); if(bColTransparency) @@ -1252,7 +1208,6 @@ void SvxBackgroundTabPage::ShowBitmapUI_Impl() (m_pBackGroundColorFrame->IsVisible() || !m_pFileFrame->IsVisible())) { HideColorUI_Impl(); - HideGradientUI_Impl(); m_pBitmapContainer->Show(); @@ -1281,36 +1236,6 @@ void SvxBackgroundTabPage::HideBitmapUI_Impl() m_pGraphTransFrame->Hide(); } -void SvxBackgroundTabPage::ShowGradientUI_Impl() -{ - if (!m_pBackGroundGradientFrame->IsVisible()) - { - HideColorUI_Impl(); - HideBitmapUI_Impl(); - - m_pBackGroundGradientFrame->Show(); - if (!m_rXFillSet.HasItem(XATTR_FILLSTYLE) || ((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue() != XFILL_GRADIENT) - { - // Frame has no gradient? Then select the first one, just to be able to show something in the preview control. - m_pLbGradients->SelectEntryPos(0); - ModifyGradientHdl_Impl(this); - } - else - { - // It has one, try to select the matching entry in the gradient list box. - const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT); - m_pLbGradients->SelectEntryByList(m_pGradientList, rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue()); - } - } -} - -void SvxBackgroundTabPage::HideGradientUI_Impl() -{ - m_pBackGroundGradientFrame->Hide(); -} - - - void SvxBackgroundTabPage::SetGraphicPosition_Impl( SvxGraphicPosition ePos ) { switch ( ePos ) @@ -1409,15 +1334,11 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl) ShowColorUI_Impl(); m_pParaLBox->Enable(); // drawing background can't be a bitmap } - else if ( XFILL_BITMAP == lcl_getFillStyle(m_pLbSelect) ) + else { ShowBitmapUI_Impl(); m_pParaLBox->Enable(false); // drawing background can't be a bitmap } - else - { - ShowGradientUI_Impl(); - } return 0; } @@ -1490,23 +1411,6 @@ IMPL_LINK( SvxBackgroundTabPage, RadioClickHdl_Impl, RadioButton*, pBtn ) return 0; } -IMPL_LINK_NOARG(SvxBackgroundTabPage, ModifyGradientHdl_Impl) -{ - sal_Int32 nPos = m_pLbGradients->GetSelectEntryPos(); - - if (nPos != LISTBOX_ENTRY_NOTFOUND) - { - XGradientEntry* pEntry = m_pGradientList->GetGradient(nPos); - m_rXFillSet.Put( XFillStyleItem( XFILL_GRADIENT ) ); - m_rXFillSet.Put( XFillGradientItem( pEntry->GetName(), pEntry->GetGradient() ) ); - } - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); - return 0; -} - - - IMPL_LINK_NOARG(SvxBackgroundTabPage, BrowseHdl_Impl) /* [Description] @@ -1810,36 +1714,25 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr, if ( GPOS_NONE == ePos || !m_pLbSelect->IsVisible() ) { - // We don't have a graphic, do we have gradient fill style? - if (!m_rXFillSet.HasItem(XATTR_FILLSTYLE) || ((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue() != XFILL_GRADIENT) - { - lcl_setFillStyle(m_pLbSelect, XFILL_SOLID); - ShowColorUI_Impl(); - Color aTrColor( COL_TRANSPARENT ); - aBgdColor = rColor; - - sal_uInt16 nCol = ( aTrColor != aBgdColor ) ? - GetItemId_Impl(*m_pBackgroundColorSet, aBgdColor) : 0; + lcl_setFillStyle(m_pLbSelect, XFILL_SOLID); + ShowColorUI_Impl(); + Color aTrColor( COL_TRANSPARENT ); + aBgdColor = rColor; - if( aTrColor != aBgdColor && nCol == 0) - { - m_pBackgroundColorSet->SetNoSelection(); - } - else - { - m_pBackgroundColorSet->SelectItem( nCol ); - } + sal_uInt16 nCol = ( aTrColor != aBgdColor ) ? + GetItemId_Impl(*m_pBackgroundColorSet, aBgdColor) : 0; - m_pPreviewWin1->NotifyChange( aBgdColor ); + if( aTrColor != aBgdColor && nCol == 0) + { + m_pBackgroundColorSet->SetNoSelection(); } else { - // Gradient fill style, then initialize preview with data from Writer. - lcl_setFillStyle(m_pLbSelect, XFILL_GRADIENT); - ShowGradientUI_Impl(); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_pBackgroundColorSet->SelectItem( nCol ); } + + m_pPreviewWin1->NotifyChange( aBgdColor ); + if ( m_pLbSelect->IsVisible() ) // initialize graphic part { aBgdGraphicFilter = ""; @@ -1942,7 +1835,6 @@ void SvxBackgroundTabPage::EnableTransparency(sal_Bool bColor, sal_Bool bGraphic void SvxBackgroundTabPage::PageCreated (SfxAllItemSet aSet) { SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,false); - SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST,false); if (pFlagItem) { @@ -1956,25 +1848,6 @@ void SvxBackgroundTabPage::PageCreated (SfxAllItemSet aSet) if ( ( nFlags & SVX_ENABLE_TRANSPARENCY ) == SVX_ENABLE_TRANSPARENCY ) EnableTransparency(sal_True, sal_True); } - - if (pGradientListItem) - { - // If we get a gradient list, also read fill and gradient style. - m_pGradientList = pGradientListItem->GetGradientList(); - m_pLbGradients->Fill(m_pGradientList); - const XFillStyleItem& rFillStyleItem = (const XFillStyleItem&)aSet.Get(SID_SW_ATTR_FILL_STYLE); - m_rXFillSet.Put(XFillStyleItem(rFillStyleItem.GetValue())); - const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)aSet.Get(SID_SW_ATTR_FILL_GRADIENT); - m_rXFillSet.Put(XFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue())); - } - else - // Otherwise hide the gradient UI. - for (int i = 0; i < m_pLbSelect->GetEntryCount(); ++i) - if ((XFillStyle)(sal_uLong)m_pLbSelect->GetEntryData(i) == XFILL_GRADIENT) - { - m_pLbSelect->RemoveEntry(i); - break; - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/strings.src b/cui/source/tabpages/strings.src index 7eefbe56c943..9de66cc0183f 100644 --- a/cui/source/tabpages/strings.src +++ b/cui/source/tabpages/strings.src @@ -191,5 +191,9 @@ String RID_SVXSTR_DIMENSION_LINE { Text [en-US ] = "Dimension line"; }; +String RID_SVXSTR_READ_DATA_ERROR +{ + Text [ en-US ] = "The file could not be loaded!" ; +}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx index 2a764fa0f87e..bee8f1bb27a4 100644 --- a/cui/source/tabpages/tabarea.cxx +++ b/cui/source/tabpages/tabarea.cxx @@ -40,7 +40,7 @@ SvxAreaTabDialog::SvxAreaTabDialog Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, - const SdrView* /* pSdrView */ + bool bShadow ) : SfxTabDialog( pParent, "AreaDialog", @@ -73,7 +73,16 @@ SvxAreaTabDialog::SvxAreaTabDialog mbAreaTP( sal_False ) { m_nAreaTabPage = AddTabPage( "RID_SVXPAGE_AREA", SvxAreaTabPage::Create, 0 ); - m_nShadowTabPage = AddTabPage( "RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, 0 ); + + if(bShadow) + { + m_nShadowTabPage = AddTabPage( "RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, 0 ); + } + else + { + RemoveTabPage( "RID_SVXPAGE_SHADOW" ); + } + m_nTransparenceTabPage = AddTabPage( "RID_SVXPAGE_TRANSPARENCE", SvxTransparenceTabPage::Create, 0); m_nColorTabPage = AddTabPage( "RID_SVXPAGE_COLOR", SvxColorTabPage::Create, 0 ); m_nGradientTabPage = AddTabPage( "RID_SVXPAGE_GRADIENT", SvxGradientTabPage::Create, 0 ); diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 43dd000f766d..0005b0f3cfdb 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -41,6 +41,10 @@ #include <sfx2/request.hxx> #include "paragrph.hrc" +//UUUU +#include "sfx2/opengrf.hxx" +#include <vcl/msgbox.hxx> + // static ---------------------------------------------------------------- static sal_uInt16 pAreaRanges[] = @@ -587,20 +591,35 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : pHatchingList( NULL ), pBitmapList( NULL ), - pnColorListState( 0 ), - pnBitmapListState( 0 ), - pnGradientListState( 0 ), - pnHatchingListState( 0 ), + // local fixed not o be changed values for local pointers + maFixed_ChangeType(CT_NONE), + maFixed_sal_Bool(false), + + // init with pointers to fixed ChangeType + pnColorListState(&maFixed_ChangeType), + pnBitmapListState(&maFixed_ChangeType), + pnGradientListState(&maFixed_ChangeType), + pnHatchingListState(&maFixed_ChangeType), - nPageType( 0 ), - nDlgType( 0 ), - nPos( LISTBOX_ENTRY_NOTFOUND ), + nPageType(0), + nDlgType(0), + nPos(0), - pbAreaTP( 0 ), + // init with pointer to fixed bool + pbAreaTP(&maFixed_sal_Bool), pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) + rXFSet ( aXFillAttr.GetItemSet() ), + + ePoolUnit(SFX_MAPUNIT_100TH_MM), + eFUnit(FUNIT_NONE), + + //UUUU + mbOfferImportButton(false), + mbPositionsAdapted(false), + mbDirectGraphicSet(false), + maDirectGraphic() { get(m_pTypeLB,"LB_AREA_TYPE"); get(m_pFillLB,"boxLB_FILL"); @@ -641,6 +660,7 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : get(m_pFlOffset,"FL_OFFSET"); get(m_pRbtRow,"RBT_ROW"); get(m_pRbtColumn,"RBT_COLUMN"); + get(m_pBtnImport, "btnimport"); get(m_pMtrFldOffset,"MTR_FLD_OFFSET"); get(m_pCtlXRectPreview,"CTL_COLOR_PREVIEW"); @@ -704,6 +724,8 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : m_pLbColor->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyColorHdl_Impl ) ); m_pLbHatchBckgrdColor->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl ) ); m_pCbxHatchBckgrd->SetToggleHdl( LINK( this, SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl ) ); + //UUUU + m_pBtnImport->SetClickHdl(LINK(this, SvxAreaTabPage, ClickImportHdl_Impl)); m_pLbGradient->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyGradientHdl_Impl ) ); m_pLbHatching->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchingHdl_Impl ) ); @@ -1101,33 +1123,44 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet& rAttrs ) break; case XFILL_BITMAP: { - nPos = m_pLbBitmap->GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != m_pLbBitmap->GetSavedValue() ) + //UUUU + if(mbDirectGraphicSet && GRAPHIC_NONE != maDirectGraphic.GetType()) { - const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos); - const OUString aString(m_pLbBitmap->GetSelectEntry()); - const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()); - pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP ); - if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) ) - { - rAttrs.Put( aFillBitmapItem ); - bModified = sal_True; - } + const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic); + rAttrs.Put(XFillStyleItem(XFILL_BITMAP)); + rAttrs.Put(aXBmpItem); + bModified = sal_True; } - // NEW - if( (eSavedStyle != eStyle) && - ( bModified || - SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), true ) ) ) + else { - XFillStyleItem aStyleItem( XFILL_BITMAP ); - pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); - if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) + nPos = m_pLbBitmap->GetSelectEntryPos(); + if( nPos != LISTBOX_ENTRY_NOTFOUND && + nPos != m_pLbBitmap->GetSavedValue() ) { - rAttrs.Put( aStyleItem ); - bModified = sal_True; + const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos); + const OUString aString(m_pLbBitmap->GetSelectEntry()); + const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()); + pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP ); + if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) ) + { + rAttrs.Put( aFillBitmapItem ); + bModified = sal_True; + } + } + // NEW + if( (eSavedStyle != eStyle) && + ( bModified || + SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), true ) ) ) + { + XFillStyleItem aStyleItem( XFILL_BITMAP ); + pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); + if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) + { + rAttrs.Put( aStyleItem ); + bModified = sal_True; + } } - } + } } break; } @@ -2039,6 +2072,19 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl() m_pLbColor->Hide(); m_pLbGradient->Hide(); m_pLbHatching->Hide(); + + //UUUU + if(mbOfferImportButton) + { + m_pBtnImport->Show(); + m_pBtnImport->Enable(); + } + else + { + m_pBtnImport->Hide(); + m_pBtnImport->Disable(); + } + m_pLbBitmap->Enable(); m_pLbBitmap->Show(); m_pCtlBitmapPreview->Enable(); @@ -2084,6 +2130,11 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl() IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl) { + //UUUU + mbDirectGraphicSet = false; + maDirectGraphic.Clear(); + maDirectName = ""; + const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbBitmap->GetSelectEntryPos(); if( _nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -2139,41 +2190,99 @@ IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p ) return( 0L ); } +IMPL_LINK_NOARG( SvxAreaTabPage, ClickImportHdl_Impl ) +{ + ResMgr& rMgr = CUI_MGR(); + SvxOpenGraphicDialog aDlg("Import"); + aDlg.EnableLink(sal_False); + + if(!aDlg.Execute()) + { + EnterWait(); + const int nError(aDlg.GetGraphic(maDirectGraphic)); + LeaveWait(); + + if(!nError && GRAPHIC_NONE != maDirectGraphic.GetType()) + { + // extract name from filename + const INetURLObject aURL(aDlg.GetPath()); + maDirectName = aURL.GetName().getToken( 0, '.' ); + + // use loaded graphic + const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic); + rXFSet.Put(XFillStyleItem(XFILL_BITMAP)); + rXFSet.Put(aXBmpItem); + + // trigger state flag for directly loaded graphic + mbDirectGraphicSet = true; + + // preview + m_pCtlBitmapPreview->SetAttributes(aXFillAttr.GetItemSet()); + m_pCtlBitmapPreview->Invalidate(); + } + else + { + // graphic could not be loaded + ErrorBox(this, WB_OK, OUString(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr))).Execute(); + } + } + + return 0L; +} +//------------------------------------------------------------------------ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyTileHdl_Impl) { TriState eState = m_pTsbTile->GetState(); if( eState == TRISTATE_TRUE ) { + // tiled + // disable stretched for tiled graphic m_pTsbStretch->Disable(); m_pFlOffset->Enable(); + // allow positioning m_pCtlPosition->Invalidate(); + // allow 'Position" title m_pFlPosition->Enable(); + // allow size definitions m_pFlSize->Enable(); } else if( eState == TRISTATE_FALSE ) { + // non-tiled + // enable stretch selection m_pTsbStretch->Enable(); + // no need for offsets, only position is supported in non-tiled m_pFlOffset->Disable(); - m_pCtlPosition->Invalidate(); - m_pFlPosition->Disable(); - if( m_pTsbStretch->GetState() != TRISTATE_FALSE ) { + // non-tiled, stretched + // no need for positioning + m_pCtlPosition->Invalidate(); + // no need for 'Position" title, all deactivated + m_pFlPosition->Disable(); + // no need for size definitions m_pFlSize->Disable(); } else { + // non-tiled, non-stretched + // allow positioning + m_pCtlPosition->Enable(); + m_pCtlPosition->Invalidate(); + // allow 'Position" title, positioning is active + m_pFlPosition->Enable(); m_pFlSize->Enable(); } } else { + // disable all when tiling is undefined m_pTsbStretch->Disable(); m_pFlOffset->Disable(); @@ -2335,6 +2444,8 @@ void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,false); SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,false); SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,false); + //UUUU + SFX_ITEMSET_ARG (&aSet, pOfferImportItem, SfxBoolItem, SID_OFFER_IMPORT, sal_False); if (pColorListItem) SetColorList(pColorListItem->GetColorList()); @@ -2350,6 +2461,18 @@ void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) SetDlgType(pDlgTypeItem->GetValue()); if (pPosItem) SetPos(pPosItem->GetValue()); + + //UUUU + if(pOfferImportItem) + { + const bool bNew(pOfferImportItem->GetValue()); + + if(mbOfferImportButton != bNew) + { + mbOfferImportButton = bNew; + } + } + Construct(); } diff --git a/cui/uiconfig/ui/areatabpage.ui b/cui/uiconfig/ui/areatabpage.ui index 8bb0f6b8b4c8..4c11f610b006 100644 --- a/cui/uiconfig/ui/areatabpage.ui +++ b/cui/uiconfig/ui/areatabpage.ui @@ -821,6 +821,19 @@ <property name="position">3</property> </packing> </child> + <child> + <object class="GtkButton" id="btnimport"> + <property name="label" translatable="yes">Import Graphic...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |