summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-10-18 12:45:07 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2019-10-19 22:44:37 +0200
commit546e6c359e96a2e7f5aab7c158c7e843be6c8957 (patch)
tree878445a23c6ec5e10f9230eff54bfa55f59f2e86 /sw/source/ui
parentff8e01b58c4d1a667c4db2163dcffade3de9fa7c (diff)
MM dialogs: Simplify code for from/to range a little bit
Change-Id: I8a845e24d0ce5aec6b2edc70fef42c39109ab6a3 Reviewed-on: https://gerrit.libreoffice.org/81092 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx45
1 files changed, 16 insertions, 29 deletions
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 9644ed99c538..4bb4b971d5a9 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -566,22 +566,18 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void)
}
else
{
+ const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
sal_uInt32 nBegin = 0;
- sal_uInt32 nEnd = 0;
- sal_uInt32 documentCount = xConfigItem->GetMergedDocumentCount();
+ sal_uInt32 nEnd = nDocumentCount;
- if (m_xSaveIndividualRB->get_active())
- {
- nBegin = 0;
- nEnd = documentCount;
- }
- else
+ if (!m_xSaveIndividualRB->get_active())
{
nBegin = static_cast< sal_Int32 >(m_xFromNF->get_value() - 1);
nEnd = static_cast< sal_Int32 >(m_xToNF->get_value());
- if(nEnd > documentCount)
- nEnd = documentCount;
+ if(nEnd > nDocumentCount)
+ nEnd = nDocumentCount;
}
+
OUString sTargetTempURL = URIHelper::SmartRel2Abs(
INetURLObject(), utl::TempFile::CreateTempName(),
URIHelper::GetMaybeFileHdl());
@@ -756,21 +752,16 @@ IMPL_LINK_NOARG(SwMMResultPrintDialog, PrintHdl_Impl, weld::Button&, void)
SwView* pTargetView = xConfigItem->GetTargetView();
assert(pTargetView);
+ const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
sal_uInt32 nBegin = 0;
- sal_uInt32 nEnd = 0;
- sal_uInt32 documentCount = xConfigItem->GetMergedDocumentCount();
+ sal_uInt32 nEnd = nDocumentCount;
- if (m_xPrintAllRB->get_active())
- {
- nBegin = 0;
- nEnd = documentCount;
- }
- else
+ if (!m_xPrintAllRB->get_active())
{
nBegin = m_xFromNF->get_value() - 1;
nEnd = m_xToNF->get_value();
- if(nEnd > documentCount)
- nEnd = documentCount;
+ if(nEnd > nDocumentCount)
+ nEnd = nDocumentCount;
}
// If we skip autoinserted blanks, then the page numbers used in the print range string
@@ -885,19 +876,15 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi
lcl_UpdateEmailSettingsFromGlobalConfig(*xConfigItem);
}
//add the documents
+ const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
sal_uInt32 nBegin = 0;
- sal_uInt32 nEnd = 0;
- if (m_xSendAllRB->get_active())
- {
- nBegin = 0;
- nEnd = xConfigItem->GetMergedDocumentCount();
- }
- else
+ sal_uInt32 nEnd = nDocumentCount;
+ if (!m_xSendAllRB->get_active())
{
nBegin = static_cast< sal_Int32 >(m_xFromNF->get_value() - 1);
nEnd = static_cast< sal_Int32 >(m_xToNF->get_value());
- if(nEnd > xConfigItem->GetMergedDocumentCount())
- nEnd = xConfigItem->GetMergedDocumentCount();
+ if(nEnd > nDocumentCount)
+ nEnd = nDocumentCount;
}
bool bAsBody = false;
rtl_TextEncoding eEncoding = ::osl_getThreadTextEncoding();