diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-08-02 09:13:10 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-08-02 09:13:10 +0000 |
commit | 37a8e672511c44f148fb14ff520cc708eddaec2e (patch) | |
tree | a4a95f8aeee9edd586b781cadafdb85b1b1823c2 /sc/source/ui/drawfunc/drawsh5.cxx | |
parent | 665c0efd5ae8e553299a5523d5b5fd30beb56d9c (diff) |
INTEGRATION: CWS formatpaintbrush02 (1.13.62); FILE MERGED
2004/07/16 14:54:03 nn 1.13.62.2: #i20119# change parameter to GetAttrFromMarked/SetAttrToMarked
2004/07/15 18:35:01 nn 1.13.62.1: #i20119# format paint brush handling
Diffstat (limited to 'sc/source/ui/drawfunc/drawsh5.cxx')
-rw-r--r-- | sc/source/ui/drawfunc/drawsh5.cxx | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 6420950e51a8..2ba85d2e19bb 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drawsh5.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: rt $ $Date: 2004-07-12 15:27:46 $ + * last change: $Author: kz $ $Date: 2004-08-02 10:13:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -655,6 +655,44 @@ void ScDrawShell::ExecFormText(SfxRequest& rReq) } } +//------------------------------------------------------------------ + +void ScDrawShell::ExecFormatPaintbrush( SfxRequest& rReq ) +{ + ScViewFunc* pView = pViewData->GetView(); + if ( pView->HasPaintBrush() ) + { + // cancel paintbrush mode + pView->ResetBrushDocument(); + } + else + { + BOOL bLock = FALSE; + const SfxItemSet *pArgs = rReq.GetArgs(); + if( pArgs && pArgs->Count() >= 1 ) + bLock = static_cast<const SfxBoolItem&>(pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue(); + + ScDrawView* pDrawView = pViewData->GetScDrawView(); + if ( pDrawView && pDrawView->HasMarked() ) + { + BOOL bOnlyHardAttr = TRUE; + SfxItemSet* pItemSet = new SfxItemSet( pDrawView->GetAttrFromMarked(bOnlyHardAttr) ); + pView->SetDrawBrushSet( pItemSet, bLock ); + } + } +} + +void ScDrawShell::StateFormatPaintbrush( SfxItemSet& rSet ) +{ + ScDrawView* pDrawView = pViewData->GetScDrawView(); + BOOL bSelection = pDrawView && pDrawView->HasMarked(); + BOOL bHasPaintBrush = pViewData->GetView()->HasPaintBrush(); + + if ( !bHasPaintBrush && !bSelection ) + rSet.DisableItem( SID_FORMATPAINTBRUSH ); + else + rSet.Put( SfxBoolItem( SID_FORMATPAINTBRUSH, bHasPaintBrush ) ); +} |