diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2016-08-11 10:40:19 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-07 21:31:27 +0300 |
commit | 37a3fc1ca2a08e41dcf39946d891e7e315106d64 (patch) | |
tree | 409636f6aafd802d9d810513f533804e900f2787 | |
parent | f10549961983b10148ba9ffe91a5e6c19bde909f (diff) |
tdf#101390 Add Arrows toolbox functions on writer drawingbar.
Writer arrows toolbox includes following commands
.uno:LineArrowEnd
.uno:LineCircleArrow
.uno:LineSquareArrow
.uno:LineArrows
.uno:LineArrowStart
.uno:LineArrowCircle
.uno:LineArrowSquare
.uno:Line
Change-Id: I91af27826ea411eabfa61c11962cfb85d2d2aab2
Reviewed-on: https://gerrit.libreoffice.org/28363
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
-rw-r--r-- | include/svx/svxids.hrc | 10 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu | 64 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 64 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu | 11 | ||||
-rw-r--r-- | sd/inc/app.hrc | 8 | ||||
-rw-r--r-- | sd/sdi/sdraw.sdi | 144 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 142 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/fesh.hxx | 1 | ||||
-rw-r--r-- | sw/sdi/viewsh.sdi | 39 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 176 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/conrect.cxx | 31 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 8 | ||||
-rw-r--r-- | sw/uiconfig/swriter/toolbar/arrowsbar.xml | 30 | ||||
-rw-r--r-- | sw/uiconfig/swriter/toolbar/drawbar.xml | 1 |
16 files changed, 514 insertions, 223 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 7157993b2030..a6e058f29a1a 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -990,9 +990,17 @@ #define SID_EDIT_POSTIT ( SID_SVX_START + 1158 ) +#define SID_LINE_ARROW_CIRCLE ( SID_SVX_START + 1159 ) +#define SID_LINE_ARROW_SQUARE ( SID_SVX_START + 1160 ) +#define SID_LINE_CIRCLE_ARROW ( SID_SVX_START + 1161 ) +#define SID_LINE_SQUARE_ARROW ( SID_SVX_START + 1162 ) +#define SID_LINE_ARROWS ( SID_SVX_START + 1163 ) +#define SID_DRAWTBX_ARROWS ( SID_SVX_START + 1164 ) +#define SID_LINE_ARROW_START ( SID_SVX_START + 1165 ) +#define SID_LINE_ARROW_END ( SID_SVX_START + 1166 ) // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE (SID_EDIT_POSTIT + 1) +#define SID_SVX_FIRSTFREE ( SID_LINE_ARROW_END + 1 ) // Overflow check for slot IDs diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu index 001e9110b193..abd220734a53 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu @@ -1486,70 +1486,6 @@ <value>1</value> </prop> </node> - <node oor:name=".uno:ArrowsToolbox" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Lines and Arrows</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineArrowStart" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line Starts with Arrow</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineArrowEnd" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line Ends with Arrow</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineArrows" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line with Arrows</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineArrowCircle" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line with Arrow/Circle</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineCircleArrow" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line with Circle/Arrow</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineArrowSquare" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line with Arrow/Square</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:LineSquareArrow" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Line with Square/Arrow</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> <node oor:name=".uno:Mirror" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Flip</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index da06390aa38f..24b9d9d6fe2f 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1921,6 +1921,70 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:ArrowsToolbox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Lines and Arrows</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineArrowStart" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line Starts with Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineArrowEnd" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line Ends with Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineArrows" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line with Arrows</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineArrowCircle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line with Arrow/Circle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineCircleArrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line with Circle/Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineArrowSquare" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line with Arrow/Square</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineSquareArrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Line with Square/Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:GrafMode" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Image mode</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu index e7b44ce3c816..00fc15ea3981 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu @@ -191,6 +191,17 @@ <value>true</value> </prop> </node> + <node oor:name="private:resource/toolbar/arrowsbar" oor:op="replace"> + <prop oor:name="Docked" oor:type="xs:boolean"> + <value>false</value> + </prop> + <prop oor:name="UIName" oor:type="xs:string"> + <value xml:lang="en-US">Arrows</value> + </prop> + <prop oor:name="Visible" oor:type="xs:boolean"> + <value>false</value> + </prop> + </node> <node oor:name="private:resource/toolbar/classificationbar" oor:op="replace"> <prop oor:name="DockPos" oor:type="xs:string"> <value>0,2</value> diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index 70d730a61dcc..9a97d9f9b4bc 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -212,14 +212,6 @@ // FREE 160 - 168 #define SID_DOUBLECLICK_TEXTEDIT (SID_SD_START+169) #define SID_CLICK_CHANGE_ROTATION (SID_SD_START+170) -#define SID_DRAWTBX_ARROWS (SID_SD_START+171) -#define SID_LINE_ARROW_START (SID_SD_START+172) -#define SID_LINE_ARROW_END (SID_SD_START+173) -#define SID_LINE_ARROWS (SID_SD_START+174) -#define SID_LINE_ARROW_CIRCLE (SID_SD_START+175) -#define SID_LINE_CIRCLE_ARROW (SID_SD_START+176) -#define SID_LINE_ARROW_SQUARE (SID_SD_START+177) -#define SID_LINE_SQUARE_ARROW (SID_SD_START+178) #define SID_HELPLINES_VISIBLE (SID_SD_START+179) #define SID_HELPLINES_FRONT (SID_SD_START+180) #define SID_BEFORE_OBJ (SID_SD_START+181) diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index fec1edf251c6..afc8ee88f677 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -141,24 +141,6 @@ SfxUInt16Item AnimatorState SID_ANIMATOR_STATE GroupId = GID_OPTIONS; ] -SfxVoidItem ArrowsToolbox SID_DRAWTBX_ARROWS - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = TRUE, - MenuConfig = TRUE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - SfxVoidItem Backward SID_MOREBACK () [ @@ -2423,114 +2405,6 @@ SfxBoolItem LeaveAllGroups SID_LEAVE_ALL_GROUPS GroupId = GID_MODIFY; ] -SfxBoolItem LineArrowCircle SID_LINE_ARROW_CIRCLE - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - -SfxBoolItem LineArrowEnd SID_LINE_ARROW_END - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - -SfxBoolItem LineArrows SID_LINE_ARROWS - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - -SfxBoolItem LineArrowSquare SID_LINE_ARROW_SQUARE - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - -SfxBoolItem LineArrowStart SID_LINE_ARROW_START - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - -SfxBoolItem LineCircleArrow SID_LINE_CIRCLE_ARROW - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - SfxVoidItem LineColor SID_SETLINECOLOR (SfxUInt32Item Red ID_VAL_RED,SfxUInt32Item Green ID_VAL_GREEN,SfxUInt32Item Blue ID_VAL_BLUE) [ @@ -2565,24 +2439,6 @@ SfxVoidItem LineEndPolygon SID_LINEEND_POLYGON GroupId = GID_DRAWING; ] -SfxBoolItem LineSquareArrow SID_LINE_SQUARE_ARROW - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerItem; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_DRAWING; -] - SfxVoidItem LineTo SID_LINETO (SfxUInt32Item MouseEndX ID_VAL_MOUSEEND_X,SfxUInt32Item MouseEndY ID_VAL_MOUSEEND_Y) [ diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index f5f83ae7ecf3..69db251c211a 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -5348,6 +5348,131 @@ SfxBoolItem Line SID_DRAW_LINE GroupId = GID_DRAWING; ] +SfxBoolItem LineArrowCircle SID_LINE_ARROW_CIRCLE + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] + +SfxBoolItem LineArrowEnd SID_LINE_ARROW_END + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] + +SfxBoolItem LineArrows SID_LINE_ARROWS + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] + +SfxBoolItem LineArrowSquare SID_LINE_ARROW_SQUARE + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] + +SfxBoolItem LineArrowStart SID_LINE_ARROW_START + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] + +SfxBoolItem LineCircleArrow SID_LINE_CIRCLE_ARROW + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] + +SfxBoolItem LineSquareArrow SID_LINE_SQUARE_ARROW + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerItem; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] SfxBoolItem Line_Diagonal SID_DRAW_XLINE @@ -5366,6 +5491,23 @@ SfxBoolItem Line_Diagonal SID_DRAW_XLINE GroupId = GID_DRAWING; ] +SfxVoidItem ArrowsToolbox SID_DRAWTBX_ARROWS + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = GID_DRAWING; +] SvxColorItem FrameLineColor SID_FRAME_LINECOLOR diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index ad698ec57b0d..b91c4ddc57e9 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -36,6 +36,7 @@ $(eval $(call gb_UIConfig_add_statusbarfiles,modules/swriter,\ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swriter,\ sw/uiconfig/swriter/toolbar/alignmentbar \ + sw/uiconfig/swriter/toolbar/arrowsbar \ sw/uiconfig/swriter/toolbar/arrowshapes \ sw/uiconfig/swriter/toolbar/basicshapes \ sw/uiconfig/swriter/toolbar/bezierobjectbar \ diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 2a868a0b6f91..20eb7c903e77 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -814,6 +814,7 @@ public: const Point& _rDocPos ); void ToggleHeaderFooterEdit( ); + static void SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj, sal_uInt16 nSlotId); }; void ClearFEShellTabCols(); diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index d43ffb8f8c6d..e93cad9f66db 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -82,6 +82,45 @@ interface TextEditView : BaseTextEditView ExecMethod = ExecDraw ; StateMethod = GetDrawState ; ] + SID_LINE_ARROW_END + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_LINE_ARROW_CIRCLE + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_LINE_ARROW_SQUARE + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_LINE_ARROW_START + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_LINE_CIRCLE_ARROW + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_LINE_SQUARE_ARROW + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_LINE_ARROWS + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAWTBX_ARROWS + [ + StateMethod = GetDrawState ; + ] SID_DRAW_RECT [ ExecMethod = ExecDraw ; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 66302da6e940..5adc6cd9dc8a 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -30,12 +30,19 @@ #include <svx/sxciaitm.hxx> #include <svx/xfillit.hxx> #include <svx/svdocapt.hxx> +#include <svx/dialogs.hrc> +#include <svx/xlnwtit.hxx> +#include <svx/xlnstwit.hxx> +#include <svx/xlnedwit.hxx> +#include <svx/xlnedit.hxx> +#include <svx/xlnstit.hxx> #include <sfx2/app.hxx> #include <editeng/boxitem.hxx> #include <editeng/opaqitem.hxx> #include <editeng/protitem.hxx> #include <svx/svdpage.hxx> #include <svx/svdpagv.hxx> +#include <svx/dialmgr.hxx> #include <tools/globname.hxx> #include <IDocumentSettingAccess.hxx> #include <DocumentSettingManager.hxx> @@ -86,6 +93,7 @@ #include <sfx2/lokhelper.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <calbck.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> #include <com/sun/star/embed/EmbedMisc.hpp> #include <com/sun/star/embed/Aspects.hpp> @@ -94,6 +102,38 @@ using namespace com::sun::star; +/** + * set line starts and ends for the object to be created + */ + +namespace { + +::basegfx::B2DPolyPolygon getPolygon( sal_uInt16 nResId, SdrModel* pDoc ) +{ + ::basegfx::B2DPolyPolygon aRetval; + XLineEndListRef pLineEndList = pDoc->GetLineEndList(); + + if( pLineEndList.is() ) + { + OUString aArrowName( SVX_RES(nResId) ); + long nCount = pLineEndList->Count(); + long nIndex; + for( nIndex = 0L; nIndex < nCount; nIndex++ ) + { + const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex); + if( pEntry->GetName() == aArrowName ) + { + aRetval = pEntry->GetLineEnd(); + break; + } + } + } + + return aRetval; +} + +} + SwFlyFrame *GetFlyFromMarked( const SdrMarkList *pLst, SwViewShell *pSh ) { if ( !pLst ) @@ -848,6 +888,138 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) } } +void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj, sal_uInt16 nSlotId) +{ + SdrModel *pDoc = pObj->GetModel(); + + if ( nSlotId == SID_LINE_ARROW_START || + nSlotId == SID_LINE_ARROW_END || + nSlotId == SID_LINE_ARROWS || + nSlotId == SID_LINE_ARROW_CIRCLE || + nSlotId == SID_LINE_CIRCLE_ARROW || + nSlotId == SID_LINE_ARROW_SQUARE || + nSlotId == SID_LINE_SQUARE_ARROW ) + { + + // set attributes of line start and ends + + // arrowhead + ::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, pDoc ) ); + if( !aArrow.count() ) + { + ::basegfx::B2DPolygon aNewArrow; + aNewArrow.append(::basegfx::B2DPoint(10.0, 0.0)); + aNewArrow.append(::basegfx::B2DPoint(0.0, 30.0)); + aNewArrow.append(::basegfx::B2DPoint(20.0, 30.0)); + aNewArrow.setClosed(true); + aArrow.append(aNewArrow); + } + + // Circles + ::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, pDoc ) ); + if( !aCircle.count() ) + { + ::basegfx::B2DPolygon aNewCircle; + aNewCircle = ::basegfx::tools::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0); + aNewCircle.setClosed(true); + aCircle.append(aNewCircle); + } + + // Square + ::basegfx::B2DPolyPolygon aSquare( getPolygon( RID_SVXSTR_SQUARE, pDoc ) ); + if( !aSquare.count() ) + { + ::basegfx::B2DPolygon aNewSquare; + aNewSquare.append(::basegfx::B2DPoint(0.0, 0.0)); + aNewSquare.append(::basegfx::B2DPoint(10.0, 0.0)); + aNewSquare.append(::basegfx::B2DPoint(10.0, 10.0)); + aNewSquare.append(::basegfx::B2DPoint(0.0, 10.0)); + aNewSquare.setClosed(true); + aSquare.append(aNewSquare); + } + + SfxItemSet aSet( pDoc->GetItemPool() ); + long nWidth = 100; // (1/100th mm) + + // determine line width and calculate with it the line end width + if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE ) + { + long nValue = static_cast<const XLineWidthItem&>( aSet.Get( XATTR_LINEWIDTH ) ).GetValue(); + if( nValue > 0 ) + nWidth = nValue * 3; + } + + switch (nSlotId) + { + case SID_LINE_ARROWS: + { + // connector with arrow ends + rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); + rAttr.Put(XLineStartWidthItem(nWidth)); + rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); + rAttr.Put(XLineEndWidthItem(nWidth)); + } + break; + + case SID_LINE_ARROW_START: + case SID_LINE_ARROW_CIRCLE: + case SID_LINE_ARROW_SQUARE: + { + // connector with arrow start + rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); + rAttr.Put(XLineStartWidthItem(nWidth)); + } + break; + + case SID_LINE_ARROW_END: + case SID_LINE_CIRCLE_ARROW: + case SID_LINE_SQUARE_ARROW: + { + // connector with arrow end + rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); + rAttr.Put(XLineEndWidthItem(nWidth)); + } + break; + } + + // and again, for the still missing ends + switch (nSlotId) + { + case SID_LINE_ARROW_CIRCLE: + { + // circle end + rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); + rAttr.Put(XLineEndWidthItem(nWidth)); + } + break; + + case SID_LINE_CIRCLE_ARROW: + { + // circle start + rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); + rAttr.Put(XLineStartWidthItem(nWidth)); + } + break; + + case SID_LINE_ARROW_SQUARE: + { + // square end + rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_SQUARE), aSquare)); + rAttr.Put(XLineEndWidthItem(nWidth)); + } + break; + + case SID_LINE_SQUARE_ARROW: + { + // square start + rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_SQUARE), aSquare)); + rAttr.Put(XLineStartWidthItem(nWidth)); + } + break; + } + } +} + void SwFEShell::SelectionToTop( bool bTop ) { OSL_ENSURE( Imp()->HasDrawView(), "SelectionToTop without DrawView?" ); @@ -2839,6 +3011,10 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const aTempPoly.append(basegfx::B2DPoint(aRect.TopLeft().getX(), nYMiddle)); aTempPoly.append(basegfx::B2DPoint(aRect.BottomRight().getX(), nYMiddle)); aPoly.append(aTempPoly); + + SfxItemSet aAttr(pObj->GetModel()->GetItemPool()); + SetLineEnds(aAttr, pObj, nSlotId); + pObj->SetMergedItemSet(aAttr); } break; } diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx index 14465603fcca..aef87a5c4c20 100644 --- a/sw/source/uibase/ribbar/conrect.cxx +++ b/sw/source/uibase/ribbar/conrect.cxx @@ -49,16 +49,28 @@ bool ConstRectangle::MouseButtonDown(const MouseEvent& rMEvt) { bool bReturn; - if ((bReturn = SwDrawBase::MouseButtonDown(rMEvt)) - && m_pWin->GetSdrDrawMode() == OBJ_CAPTION) + if ((bReturn = SwDrawBase::MouseButtonDown(rMEvt))) { - m_pView->NoRotate(); - if (m_pView->IsDrawSelMode()) + if (m_pWin->GetSdrDrawMode() == OBJ_CAPTION) { - m_pView->FlipDrawSelMode(); - m_pSh->GetDrawView()->SetFrameDragSingles(m_pView->IsDrawSelMode()); + m_pView->NoRotate(); + if (m_pView->IsDrawSelMode()) + { + m_pView->FlipDrawSelMode(); + m_pSh->GetDrawView()->SetFrameDragSingles(m_pView->IsDrawSelMode()); + } + } + + SdrObject* pObj = m_pView->GetDrawView()->GetCreateObj(); + + if (pObj) + { + SfxItemSet aAttr(pObj->GetModel()->GetItemPool()); + m_pSh->SetLineEnds(aAttr, pObj, m_nSlotId); + pObj->SetMergedItemSet(aAttr); } } + return bReturn; } @@ -146,6 +158,13 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId) switch (nSlotId) { + case SID_LINE_ARROW_END: + case SID_LINE_ARROW_CIRCLE: + case SID_LINE_ARROW_SQUARE: + case SID_LINE_ARROW_START: + case SID_LINE_CIRCLE_ARROW: + case SID_LINE_SQUARE_ARROW: + case SID_LINE_ARROWS: case SID_DRAW_LINE: m_pWin->SetSdrDrawMode(OBJ_LINE); break; diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 44483341efad..c45467254110 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -245,6 +245,13 @@ void SwView::ExecDraw(SfxRequest& rReq) m_sDrawCustom.clear(); break; + case SID_LINE_ARROW_END: + case SID_LINE_ARROW_CIRCLE: + case SID_LINE_ARROW_SQUARE: + case SID_LINE_ARROW_START: + case SID_LINE_CIRCLE_ARROW: + case SID_LINE_SQUARE_ARROW: + case SID_LINE_ARROWS: case SID_DRAW_LINE: case SID_DRAW_RECT: case SID_DRAW_ELLIPSE: diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index b14e3f2de30a..e468c7eaa3f9 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -483,6 +483,13 @@ void SwView::GetDrawState(SfxItemSet &rSet) switch(nWhich) { case SID_DRAW_LINE: + case SID_LINE_ARROW_END: + case SID_LINE_ARROW_CIRCLE: + case SID_LINE_ARROW_SQUARE: + case SID_LINE_ARROW_START: + case SID_LINE_CIRCLE_ARROW: + case SID_LINE_SQUARE_ARROW: + case SID_LINE_ARROWS: case SID_DRAW_RECT: case SID_DRAW_ELLIPSE: case SID_DRAW_XPOLYGON_NOFILL: @@ -525,6 +532,7 @@ void SwView::GetDrawState(SfxItemSet &rSet) case SID_INSERT_DRAW: case SID_FONTWORK_GALLERY_FLOATER : + case SID_DRAWTBX_ARROWS: { if ( bWeb ) rSet.DisableItem( nWhich ); diff --git a/sw/uiconfig/swriter/toolbar/arrowsbar.xml b/sw/uiconfig/swriter/toolbar/arrowsbar.xml new file mode 100644 index 000000000000..5ec4d8a8ec35 --- /dev/null +++ b/sw/uiconfig/swriter/toolbar/arrowsbar.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . +--> +<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> + <toolbar:toolbaritem xlink:href=".uno:LineArrowEnd"/> + <toolbar:toolbaritem xlink:href=".uno:LineCircleArrow"/> + <toolbar:toolbaritem xlink:href=".uno:LineSquareArrow"/> + <toolbar:toolbaritem xlink:href=".uno:LineArrows"/> + <toolbar:toolbarbreak/> + <toolbar:toolbaritem xlink:href=".uno:LineArrowStart"/> + <toolbar:toolbaritem xlink:href=".uno:LineArrowCircle"/> + <toolbar:toolbaritem xlink:href=".uno:LineArrowSquare"/> + <toolbar:toolbaritem xlink:href=".uno:Line"/> +</toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/drawbar.xml b/sw/uiconfig/swriter/toolbar/drawbar.xml index cb002a4ca0a8..e37821d8fd8d 100644 --- a/sw/uiconfig/swriter/toolbar/drawbar.xml +++ b/sw/uiconfig/swriter/toolbar/drawbar.xml @@ -21,6 +21,7 @@ <toolbar:toolbaritem xlink:href=".uno:SelectObject" toolbar:helpid="10128"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:Line" toolbar:helpid="10102"/> + <toolbar:toolbaritem xlink:href=".uno:ArrowsToolbox"/> <toolbar:toolbaritem xlink:href=".uno:LineToolbox"/> <toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled" toolbar:helpid="10464" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:Freeline" toolbar:visible="false"/> |