summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh3.cxx
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2017-08-25 08:11:16 -0400
committerHenry Castro <hcastro@collabora.com>2017-08-25 16:28:16 +0200
commit2356d9e4997fe9613c0f3e399ec6a03a2bdf861e (patch)
tree8203aefd7ef1d24a4800bce5c819104703cfc72d /sc/source/ui/view/cellsh3.cxx
parent3a1d6a2bccd05e5859ab44593609d11c39fc518a (diff)
tdf#107806: Semantic and syntax for .uno:RowHeight have been changed
Change-Id: If9ce7ff36ef3ba8e55103765f3260e74ab2eebd4 Reviewed-on: https://gerrit.libreoffice.org/41567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sc/source/ui/view/cellsh3.cxx')
-rw-r--r--sc/source/ui/view/cellsh3.cxx30
1 files changed, 16 insertions, 14 deletions
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 35cd7e44d25c..7d6b9fcb7858 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -526,13 +526,14 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
const SfxPoolItem* pRow;
const SfxPoolItem* pHeight;
+ sal_uInt16 nHeight;
- if ( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pRow ) &&
- pReqArgs->HasItem( FN_PARAM_2, &pHeight ) )
+ if ( pReqArgs && pReqArgs->HasItem( FID_ROW_HEIGHT, &pHeight ) &&
+ pReqArgs->HasItem( FN_PARAM_1, &pRow ) )
{
std::vector<sc::ColRowSpan> aRanges;
SCCOLROW nRow = static_cast<const SfxInt32Item*>(pRow)->GetValue() - 1;
- sal_uInt16 nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
+ nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
ScMarkData& rMark = GetViewData()->GetMarkData();
if ( rMark.IsRowMarked( static_cast<SCROW>(nRow) ) )
@@ -544,15 +545,15 @@ void ScCellShell::Execute( SfxRequest& rReq )
aRanges.push_back(sc::ColRowSpan(nRow, nRow));
}
- pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, nHeight);
+ pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, HMMToTwips(nHeight));
}
- else if ( pReqArgs )
+ else if ( pReqArgs && pReqArgs->HasItem( FID_ROW_HEIGHT, &pHeight ) )
{
- const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_ROW_HEIGHT ));
+ nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
- sal::static_int_cast<sal_uInt16>( HMMToTwips(rUInt16Item.GetValue()) ) );
+ sal::static_int_cast<sal_uInt16>( HMMToTwips(nHeight) ) );
if( ! rReq.IsAPI() )
rReq.Done();
}
@@ -631,13 +632,14 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
const SfxPoolItem* pColumn;
const SfxPoolItem* pWidth;
+ sal_uInt16 nWidth;
- if ( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pColumn ) &&
- pReqArgs->HasItem( FN_PARAM_2, &pWidth ) )
+ if ( pReqArgs && pReqArgs->HasItem( FID_COL_WIDTH, &pWidth ) &&
+ pReqArgs->HasItem( FN_PARAM_1, &pColumn ) )
{
std::vector<sc::ColRowSpan> aRanges;
SCCOLROW nColumn = static_cast<const SfxUInt16Item*>(pColumn)->GetValue() - 1;
- sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
+ nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
ScMarkData& rMark = GetViewData()->GetMarkData();
if ( rMark.IsColumnMarked( static_cast<SCCOL>(nColumn) ) )
@@ -649,15 +651,15 @@ void ScCellShell::Execute( SfxRequest& rReq )
aRanges.push_back(sc::ColRowSpan(nColumn, nColumn));
}
- pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, nWidth);
+ pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, HMMToTwips(nWidth));
}
- else if ( pReqArgs )
+ else if ( pReqArgs && pReqArgs->HasItem( FID_COL_WIDTH, &pWidth ) )
{
- const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_COL_WIDTH ));
+ nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT,
- sal::static_int_cast<sal_uInt16>( HMMToTwips(rUInt16Item.GetValue()) ) );
+ sal::static_int_cast<sal_uInt16>( HMMToTwips(nWidth) ) );
if( ! rReq.IsAPI() )
rReq.Done();
}