diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-11 13:13:35 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-11 14:19:24 +0200 |
commit | bfed58821fc3a83fec4a985087cd45fa963bed3e (patch) | |
tree | 427156ed03b2b72069e47d9f1250dc36670c09cf /sw/source/uibase/envelp | |
parent | c46950fee11f5207fb8324947280cd565ae483e7 (diff) |
Drop convertMm100ToTwip in favor of the new o3tl::toTwips
Step by step, duplicates from <tools/UnitConversion.hxx> may go
Change-Id: Id4c03ff8adc120ae06dbfdbdfb4f5ff0bb51f489
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120315
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/envelp')
-rw-r--r-- | sw/source/uibase/envelp/envimg.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/envelp/labelcfg.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/envelp/labimg.cxx | 16 |
3 files changed, 24 insertions, 24 deletions
diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx index e1db006171dc..b676b028f018 100644 --- a/sw/source/uibase/envelp/envimg.cxx +++ b/sw/source/uibase/envelp/envimg.cxx @@ -174,27 +174,27 @@ SwEnvCfgItem::SwEnvCfgItem() : case 2: m_aEnvItem.m_bSend = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Inscription/UseSender", case 3: pValues[nProp] >>= m_aEnvItem.m_nAddrFromLeft;// "Format/AddresseeFromLeft", - m_aEnvItem.m_nAddrFromLeft = convertMm100ToTwip(m_aEnvItem.m_nAddrFromLeft); + m_aEnvItem.m_nAddrFromLeft = o3tl::toTwips(m_aEnvItem.m_nAddrFromLeft, o3tl::Length::mm100); break; case 4: pValues[nProp] >>= m_aEnvItem.m_nAddrFromTop; // "Format/AddresseeFromTop", - m_aEnvItem.m_nAddrFromTop = convertMm100ToTwip(m_aEnvItem.m_nAddrFromTop); + m_aEnvItem.m_nAddrFromTop = o3tl::toTwips(m_aEnvItem.m_nAddrFromTop, o3tl::Length::mm100); break; case 5: pValues[nProp] >>= m_aEnvItem.m_nSendFromLeft; // "Format/SenderFromLeft", - m_aEnvItem.m_nSendFromLeft = convertMm100ToTwip(m_aEnvItem.m_nSendFromLeft); + m_aEnvItem.m_nSendFromLeft = o3tl::toTwips(m_aEnvItem.m_nSendFromLeft, o3tl::Length::mm100); break; case 6: pValues[nProp] >>= m_aEnvItem.m_nSendFromTop;// "Format/SenderFromTop", - m_aEnvItem.m_nSendFromTop = convertMm100ToTwip(m_aEnvItem.m_nSendFromTop); + m_aEnvItem.m_nSendFromTop = o3tl::toTwips(m_aEnvItem.m_nSendFromTop, o3tl::Length::mm100); break; case 7: pValues[nProp] >>= m_aEnvItem.m_nWidth; // "Format/Width", - m_aEnvItem.m_nWidth = convertMm100ToTwip(m_aEnvItem.m_nWidth); + m_aEnvItem.m_nWidth = o3tl::toTwips(m_aEnvItem.m_nWidth, o3tl::Length::mm100); break; case 8: pValues[nProp] >>= m_aEnvItem.m_nHeight; // "Format/Height", - m_aEnvItem.m_nHeight = convertMm100ToTwip(m_aEnvItem.m_nHeight); + m_aEnvItem.m_nHeight = o3tl::toTwips(m_aEnvItem.m_nHeight, o3tl::Length::mm100); break; case 9: { @@ -204,11 +204,11 @@ SwEnvCfgItem::SwEnvCfgItem() : case 10: m_aEnvItem.m_bPrintFromAbove = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Print/FromAbove", case 11: pValues[nProp] >>= m_aEnvItem.m_nShiftRight; - m_aEnvItem.m_nShiftRight = convertMm100ToTwip(m_aEnvItem.m_nShiftRight);// "Print/Right", + m_aEnvItem.m_nShiftRight = o3tl::toTwips(m_aEnvItem.m_nShiftRight, o3tl::Length::mm100);// "Print/Right", break; case 12: pValues[nProp] >>= m_aEnvItem.m_nShiftDown; - m_aEnvItem.m_nShiftDown = convertMm100ToTwip(m_aEnvItem.m_nShiftDown); + m_aEnvItem.m_nShiftDown = o3tl::toTwips(m_aEnvItem.m_nShiftDown, o3tl::Length::mm100); break;// "Print/Down" } } diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx index e0fbe142f688..413768e030f3 100644 --- a/sw/source/uibase/envelp/labelcfg.cxx +++ b/sw/source/uibase/envelp/labelcfg.cxx @@ -180,16 +180,16 @@ static std::unique_ptr<SwLabRec> lcl_CreateSwLabRec(const OUString& rType, const switch(nTok++) { case 0 : pNewRec->m_bCont = sToken[0] == 'C'; break; - case 1 : pNewRec->m_nHDist = convertMm100ToTwip(nVal); break; - case 2 : pNewRec->m_nVDist = convertMm100ToTwip(nVal); break; - case 3 : pNewRec->m_nWidth = convertMm100ToTwip(nVal); break; - case 4 : pNewRec->m_nHeight = convertMm100ToTwip(nVal); break; - case 5 : pNewRec->m_nLeft = convertMm100ToTwip(nVal); break; - case 6 : pNewRec->m_nUpper = convertMm100ToTwip(nVal); break; + case 1 : pNewRec->m_nHDist = o3tl::toTwips(nVal, o3tl::Length::mm100); break; + case 2 : pNewRec->m_nVDist = o3tl::toTwips(nVal, o3tl::Length::mm100); break; + case 3 : pNewRec->m_nWidth = o3tl::toTwips(nVal, o3tl::Length::mm100); break; + case 4 : pNewRec->m_nHeight = o3tl::toTwips(nVal, o3tl::Length::mm100); break; + case 5 : pNewRec->m_nLeft = o3tl::toTwips(nVal, o3tl::Length::mm100); break; + case 6 : pNewRec->m_nUpper = o3tl::toTwips(nVal, o3tl::Length::mm100); break; case 7 : pNewRec->m_nCols = nVal; break; case 8 : pNewRec->m_nRows = nVal; break; - case 9 : pNewRec->m_nPWidth = convertMm100ToTwip(nVal); break; - case 10 : pNewRec->m_nPHeight = convertMm100ToTwip(nVal); break; + case 9 : pNewRec->m_nPWidth = o3tl::toTwips(nVal, o3tl::Length::mm100); break; + case 10 : pNewRec->m_nPHeight = o3tl::toTwips(nVal, o3tl::Length::mm100); break; } } // lines added for compatibility with custom label definitions saved before patch fdo#44516 diff --git a/sw/source/uibase/envelp/labimg.cxx b/sw/source/uibase/envelp/labimg.cxx index 5e7051cbc8b7..a3cfc5cc52b6 100644 --- a/sw/source/uibase/envelp/labimg.cxx +++ b/sw/source/uibase/envelp/labimg.cxx @@ -287,35 +287,35 @@ SwLabCfgItem::SwLabCfgItem(bool bLabel) : case 4: pValues[nProp] >>= aItem.m_nRows; break;// "Format/Row", case 5: pValues[nProp] >>= aItem.m_lHDist; - aItem.m_lHDist = convertMm100ToTwip(aItem.m_lHDist); + aItem.m_lHDist = o3tl::toTwips(aItem.m_lHDist, o3tl::Length::mm100); break;// "Format/HorizontalDistance", case 6: pValues[nProp] >>= aItem.m_lVDist; - aItem.m_lVDist = convertMm100ToTwip(aItem.m_lVDist); + aItem.m_lVDist = o3tl::toTwips(aItem.m_lVDist, o3tl::Length::mm100); break;// "Format/VerticalDistance", case 7: pValues[nProp] >>= aItem.m_lWidth; - aItem.m_lWidth = convertMm100ToTwip(aItem.m_lWidth); + aItem.m_lWidth = o3tl::toTwips(aItem.m_lWidth, o3tl::Length::mm100); break;// "Format/Width", case 8: pValues[nProp] >>= aItem.m_lHeight; - aItem.m_lHeight = convertMm100ToTwip(aItem.m_lHeight); + aItem.m_lHeight = o3tl::toTwips(aItem.m_lHeight, o3tl::Length::mm100); break;// "Format/Height", case 9: pValues[nProp] >>= aItem.m_lLeft; - aItem.m_lLeft = convertMm100ToTwip(aItem.m_lLeft); + aItem.m_lLeft = o3tl::toTwips(aItem.m_lLeft, o3tl::Length::mm100); break;// "Format/LeftMargin", case 10: pValues[nProp] >>= aItem.m_lUpper; - aItem.m_lUpper = convertMm100ToTwip(aItem.m_lUpper); + aItem.m_lUpper = o3tl::toTwips(aItem.m_lUpper, o3tl::Length::mm100); break;// "Format/TopMargin", case 11: pValues[nProp] >>= aItem.m_lPWidth; - aItem.m_lPWidth = convertMm100ToTwip(aItem.m_lPWidth); + aItem.m_lPWidth = o3tl::toTwips(aItem.m_lPWidth, o3tl::Length::mm100); break;// "Format/PageWidth", case 12: pValues[nProp] >>= aItem.m_lPHeight; - aItem.m_lPHeight = convertMm100ToTwip(aItem.m_lPHeight); + aItem.m_lPHeight = o3tl::toTwips(aItem.m_lPHeight, o3tl::Length::mm100); break;// "Format/PageHeight", case 13: aItem.m_bSynchron = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Option/Synchronize", case 14: aItem.m_bPage = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Option/Page", |