summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/tparea.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/tabpages/tparea.cxx')
-rw-r--r--cui/source/tabpages/tparea.cxx250
1 files changed, 94 insertions, 156 deletions
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index eb0add42eb74..35db8ef9a85a 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -41,10 +41,6 @@
#include <sfx2/request.hxx>
#include "paragrph.hrc"
-//UUUU
-#include "sfx2/opengrf.hxx"
-#include <vcl/msgbox.hxx>
-
// static ----------------------------------------------------------------
static const sal_uInt16 pAreaRanges[] =
@@ -591,34 +587,20 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
pHatchingList( NULL ),
pBitmapList( NULL ),
- // 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),
+ pnColorListState( 0 ),
+ pnBitmapListState( 0 ),
+ pnGradientListState( 0 ),
+ pnHatchingListState( 0 ),
- nPageType(0),
- nDlgType(0),
- nPos(0),
+ nPageType( 0 ),
+ nDlgType( 0 ),
+ nPos( LISTBOX_ENTRY_NOTFOUND ),
- // init with pointer to fixed bool
- pbAreaTP(&maFixed_sal_Bool),
+ pbAreaTP( 0 ),
pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() ),
-
- ePoolUnit(SFX_MAPUNIT_100TH_MM),
- eFUnit(FUNIT_NONE),
-
- //UUUU
- mbOfferImportButton(false),
- mbDirectGraphicSet(false),
- maDirectGraphic()
+ rXFSet ( aXFillAttr.GetItemSet() )
{
get(m_pTypeLB,"LB_AREA_TYPE");
get(m_pFillLB,"boxLB_FILL");
@@ -659,7 +641,6 @@ 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");
@@ -723,8 +704,6 @@ 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 ) );
@@ -1122,44 +1101,33 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet& rAttrs )
break;
case XFILL_BITMAP:
{
- //UUUU
- if(mbDirectGraphicSet && GRAPHIC_NONE != maDirectGraphic.GetType())
- {
- const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic);
- rAttrs.Put(XFillStyleItem(XFILL_BITMAP));
- rAttrs.Put(aXBmpItem);
- bModified = true;
- }
- else
+ nPos = m_pLbBitmap->GetSelectEntryPos();
+ if( nPos != LISTBOX_ENTRY_NOTFOUND &&
+ nPos != m_pLbBitmap->GetSavedValue() )
{
- nPos = m_pLbBitmap->GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- m_pLbBitmap->IsValueChangedFromSaved() )
+ 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 ) )
{
- 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 = true;
- }
+ rAttrs.Put( aFillBitmapItem );
+ bModified = true;
}
- // NEW
- if( (eSavedStyle != eStyle) &&
- ( bModified ||
- SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), 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 ) )
{
- XFillStyleItem aStyleItem( XFILL_BITMAP );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = true;
- }
+ rAttrs.Put( aStyleItem );
+ bModified = true;
}
- }
+ }
}
break;
}
@@ -1825,6 +1793,21 @@ void SvxAreaTabPage::ClickColorHdl_Impl()
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pColorList->GetPath() );
+
+ aURL.Append( pColorList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyColorHdl_Impl( this );
}
@@ -1880,6 +1863,21 @@ void SvxAreaTabPage::ClickGradientHdl_Impl()
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pGradientList->GetPath() );
+
+ aURL.Append( pGradientList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyGradientHdl_Impl( this );
ModifyStepCountHdl_Impl( m_pTsbStepCount );
}
@@ -1935,6 +1933,21 @@ void SvxAreaTabPage::ClickHatchingHdl_Impl()
m_pCbxHatchBckgrd->Enable();
m_pLbHatchBckgrdColor->Enable();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pHatchingList->GetPath() );
+
+ aURL.Append( pHatchingList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyHatchingHdl_Impl( this );
ModifyHatchBckgrdColorHdl_Impl( this );
ToggleHatchBckgrdColorHdl_Impl( this );
@@ -2026,19 +2039,6 @@ 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();
@@ -2061,6 +2061,21 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl()
m_pBxBitmap->Show();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pBitmapList->GetPath() );
+
+ aURL.Append( pBitmapList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyBitmapHdl_Impl( this );
ModifyTileHdl_Impl( m_pTsbOriginal );
}
@@ -2069,11 +2084,6 @@ 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 )
@@ -2129,99 +2139,41 @@ IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p )
return( 0L );
}
-IMPL_LINK_NOARG( SvxAreaTabPage, ClickImportHdl_Impl )
-{
- ResMgr& rMgr = CUI_MGR();
- SvxOpenGraphicDialog aDlg("Import");
- aDlg.EnableLink(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();
@@ -2383,8 +2335,6 @@ void SvxAreaTabPage::PageCreated(const 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, false);
if (pColorListItem)
SetColorList(pColorListItem->GetColorList());
@@ -2400,18 +2350,6 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet)
SetDlgType(pDlgTypeItem->GetValue());
if (pPosItem)
SetPos(pPosItem->GetValue());
-
- //UUUU
- if(pOfferImportItem)
- {
- const bool bNew(pOfferImportItem->GetValue());
-
- if(mbOfferImportButton != bNew)
- {
- mbOfferImportButton = bNew;
- }
- }
-
Construct();
}