diff options
-rw-r--r-- | include/sfx2/sfxsids.hrc | 2 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 2 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 42 |
4 files changed, 24 insertions, 24 deletions
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index f4ac65cb061e..44b5fcfc54eb 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -553,7 +553,7 @@ #define SID_RULER_MARGIN2 (SID_SVX_START + 1064) #define SID_TABLE_BORDER_TYPE (SID_SVX_START + 1065) #define SID_TABLE_BORDER_INDEX (SID_SVX_START + 1066) -#define SID_TABLE_BORDER_NEW_POSITION (SID_SVX_START + 1067) +#define SID_TABLE_BORDER_OFFSET (SID_SVX_START + 1067) #define FID_SVX_START (SID_LIB_START + 500) #define FID_SEARCH_NOW (FID_SVX_START + 2) diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index d422205b5d9c..d03f646be6a8 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -253,12 +253,12 @@ #define SID_ATTR_TRANSFORM_ROT_Y ( SID_SVX_START + 94 ) #define SID_ATTR_TRANSFORM_ANGLE ( SID_SVX_START + 95 ) #define SID_ATTR_TRANSFORM_DELTA_ANGLE ( SID_SVX_START + 96 ) -#define SID_TABLE_CHANGE_CURRENT_BORDER_POSITION ( SID_SVX_START + 100 ) #define SID_SIZE_ALL ( SID_SVX_START + 101 ) #define SID_DRAW_LINE ( SID_SVX_START + 102 ) #define SID_DRAW_XLINE ( SID_SVX_START + 103 ) #define SID_DRAW_RECT ( SID_SVX_START + 104 ) #define SID_DRAW_RECT_ROUND ( SID_SVX_START + 105 ) +#define SID_TABLE_CHANGE_CURRENT_BORDER_POSITION ( SID_SVX_START + 106 ) #define SID_DRAW_ELLIPSE ( SID_SVX_START + 110 ) #define SID_DRAW_PIE ( SID_SVX_START + 112 ) #define SID_DRAW_ARC ( SID_SVX_START + 114 ) diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index c6a4d5bce4b1..ef7922b51b37 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -7180,7 +7180,7 @@ SfxVoidItem RulerChangeState SID_RULER_CHANGE_STATE SfxVoidItem TableChangeCurrentBorderPosition SID_TABLE_CHANGE_CURRENT_BORDER_POSITION (SfxStringItem BorderType SID_TABLE_BORDER_TYPE, SfxUInt16Item Index SID_TABLE_BORDER_INDEX, - SfxInt32Item NewPosition SID_TABLE_BORDER_NEW_POSITION) + SfxInt32Item Offset SID_TABLE_BORDER_OFFSET) [ AutoUpdate = FALSE, FastCall = TRUE, diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index d822343b885d..fd9e6684bf49 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1017,16 +1017,16 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) { const SfxPoolItem *pBorderType; const SfxPoolItem *pIndex; - const SfxPoolItem *pNewPosition; + const SfxPoolItem *pOffset; constexpr long constDistanceOffset = 40; if (pReqArgs->GetItemState(SID_TABLE_BORDER_TYPE, true, &pBorderType) == SfxItemState::SET && pReqArgs->GetItemState(SID_TABLE_BORDER_INDEX, true, &pIndex) == SfxItemState::SET - && pReqArgs->GetItemState(SID_TABLE_BORDER_NEW_POSITION, true, &pNewPosition) == SfxItemState::SET) + && pReqArgs->GetItemState(SID_TABLE_BORDER_OFFSET, true, &pOffset) == SfxItemState::SET) { const OUString sType = static_cast<const SfxStringItem*>(pBorderType)->GetValue(); const sal_uInt16 nIndex = static_cast<const SfxUInt16Item*>(pIndex)->GetValue(); - const sal_Int32 nNewPosition = static_cast<const SfxInt32Item*>(pNewPosition)->GetValue(); + const sal_Int32 nOffset = static_cast<const SfxInt32Item*>(pOffset)->GetValue(); if (sType.startsWith("column")) { @@ -1036,23 +1036,23 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if (sType == "column-left") { auto & rEntry = aTabCols.GetEntry(0); - long nPosition = std::min(long(nNewPosition), rEntry.nPos - constDistanceOffset); + long nNewPosition = aTabCols.GetLeft() + long(nOffset); + long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset); aTabCols.SetLeft(nPosition); } else if (sType == "column-right") { auto & rEntry = aTabCols.GetEntry(aTabCols.Count() - 1); - long nPosition = std::max(long(nNewPosition), rEntry.nPos + constDistanceOffset); + long nNewPosition = aTabCols.GetRight() + long(nOffset); + long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset); aTabCols.SetRight(nPosition); } - else if (sType == "column-middle") + else if (sType == "column-middle" && nIndex < aTabCols.Count()) { - if (nIndex < aTabCols.Count()) - { - auto & rEntry = aTabCols.GetEntry(nIndex); - long nPosition = MinMax(long(nNewPosition), rEntry.nMin, rEntry.nMax - constDistanceOffset); - rEntry.nPos = nPosition; - } + auto & rEntry = aTabCols.GetEntry(nIndex); + long nNewPosition = rEntry.nPos + long(nOffset); + long nPosition = MinMax(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); + rEntry.nPos = nPosition; } rSh.SetTabCols(aTabCols, false); @@ -1065,23 +1065,23 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if (sType == "row-left") { auto & rEntry = aTabRows.GetEntry(0); - long nPosition = std::min(long(nNewPosition), rEntry.nPos - constDistanceOffset); + long nNewPosition = aTabRows.GetLeft() + long(nOffset); + long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset); aTabRows.SetLeft(nPosition); } else if (sType == "row-right") { auto & rEntry = aTabRows.GetEntry(aTabRows.Count() - 1); - long nPosition = std::max(long(nNewPosition), rEntry.nPos + constDistanceOffset); + long nNewPosition = aTabRows.GetRight() + long(nOffset); + long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset); aTabRows.SetRight(nPosition); } - else if (sType == "row-middle") + else if (sType == "row-middle" && nIndex < aTabRows.Count()) { - if (nIndex < aTabRows.Count()) - { - auto & rEntry = aTabRows.GetEntry(nIndex); - long nPosition = MinMax(long(nNewPosition), rEntry.nMin, rEntry.nMax - constDistanceOffset); - rEntry.nPos = nPosition; - } + auto & rEntry = aTabRows.GetEntry(nIndex); + long nNewPosition = rEntry.nPos + long(nOffset); + long nPosition = MinMax(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); + rEntry.nPos = nPosition; } rSh.SetTabRows(aTabRows, false); |