diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/ClassificationDialog.cxx | 51 | ||||
-rw-r--r-- | svx/source/dialog/ClassificationEditView.cxx | 9 |
2 files changed, 33 insertions, 27 deletions
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx index 6ff28786ea50..a7b1469100f5 100644 --- a/svx/source/dialog/ClassificationDialog.cxx +++ b/svx/source/dialog/ClassificationDialog.cxx @@ -170,6 +170,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer , m_bPerParagraph(bPerParagraph) , m_aParagraphSignHandler(rParagraphSignHandler) , m_nCurrentSelectedCategory(-1) + , m_nInsertMarkings(-1) { get(m_pOkButton, "ok"); get(m_pEditWindow, "classificationEditWindow"); @@ -180,11 +181,10 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer get(m_pInternationalClassificationListBox, "internationalClassificationCB"); get(m_pMarkingLabel, "markingLabel"); get(m_pMarkingListBox, "markingCB"); - get(m_pIntellectualPropertyPartNumberListBox, "intellectualPropertyPartNumberCB"); + get(m_pIntellectualPropertyPartNumberListBox, "intellectualPropertyPartNumberLB"); get(m_pIntellectualPropertyPartListBox, "intellectualPropertyPartLB"); get(m_pIntellectualPropertyPartAddButton, "intellectualPropertyPartAddButton"); get(m_pIntellectualPropertyPartEdit, "intellectualPropertyPartEntry"); - get(m_pIntellectualPropertyExpander, "intellectualPropertyExpander"); m_pSignButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked)); @@ -197,19 +197,18 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer m_pClassificationListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectClassificationHdl)); for (const OUString& rName : maHelper.GetBACNames()) m_pClassificationListBox->InsertEntry(rName); - m_pClassificationListBox->EnableAutoSize(true); m_pInternationalClassificationListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectClassificationHdl)); for (const OUString& rName : maInternationalHelper.GetBACNames()) m_pInternationalClassificationListBox->InsertEntry(rName); - m_pInternationalClassificationListBox->EnableAutoSize(true); if (!maHelper.GetMarkings().empty()) { m_pMarkingListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectMarkingHdl)); + m_pMarkingListBox->SetLoseFocusHdl(LINK(this, ClassificationDialog, LoseFocusMarkingHdl)); + for (const OUString& rName : maHelper.GetMarkings()) m_pMarkingListBox->InsertEntry(rName); - m_pMarkingListBox->EnableAutoSize(true); } else { @@ -217,15 +216,13 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer m_pMarkingLabel->Show(false); } - m_pIntellectualPropertyPartNumberListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl)); + m_pIntellectualPropertyPartNumberListBox->SetDoubleClickHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl)); for (const OUString& rName : maHelper.GetIntellectualPropertyPartNumbers()) m_pIntellectualPropertyPartNumberListBox->InsertEntry(rName); - m_pIntellectualPropertyPartNumberListBox->EnableAutoSize(true); - m_pIntellectualPropertyPartListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartHdl)); + m_pIntellectualPropertyPartListBox->SetDoubleClickHdl(LINK(this, ClassificationDialog, SelectIPPartHdl)); for (const OUString& rName : maHelper.GetIntellectualPropertyParts()) m_pIntellectualPropertyPartListBox->InsertEntry(rName); - m_pIntellectualPropertyPartListBox->EnableAutoSize(true); m_pRecentlyUsedListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectRecentlyUsedHdl)); @@ -291,6 +288,14 @@ short ClassificationDialog::Execute() return nResult; } +void ClassificationDialog::insertCategoryField(sal_Int32 nID) +{ + const OUString aFullString = maHelper.GetBACNames()[nID]; + const OUString aAbbreviatedString = maHelper.GetAbbreviatedBACNames()[nID]; + const OUString aIdentifierString = maHelper.GetBACIdentifiers()[nID]; + insertField(ClassificationType::CATEGORY, aAbbreviatedString, aFullString, aIdentifierString); +} + void ClassificationDialog::insertField(ClassificationType eType, OUString const & rString, OUString const & rFullString, OUString const & rIdentifier) { ClassificationField aField(eType, rString, rFullString, rIdentifier); @@ -598,22 +603,9 @@ IMPL_LINK(ClassificationDialog, SelectClassificationHdl, ListBox&, rBox, void) } if (bReplaceExisting) - { - ScopedVclPtrInstance<QueryBox> aQueryBox(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, SvxResId(RID_CLASSIFICATION_CHANGE_CATEGORY)); - if (aQueryBox->Execute() == RET_NO) - { - // Revert to previosuly selected - m_pInternationalClassificationListBox->SelectEntryPos(m_nCurrentSelectedCategory); - m_pClassificationListBox->SelectEntryPos(m_nCurrentSelectedCategory); - return; - } m_pEditWindow->pEdView->SetSelection(aExistingFieldSelection); - } - const OUString aFullString = maHelper.GetBACNames()[nSelected]; - const OUString aAbbreviatedString = maHelper.GetAbbreviatedBACNames()[nSelected]; - const OUString aIdentifierString = maHelper.GetBACIdentifiers()[nSelected]; - insertField(ClassificationType::CATEGORY, aAbbreviatedString, aFullString, aIdentifierString); + insertCategoryField(nSelected); // Change category to the new selection m_pInternationalClassificationListBox->SelectEntryPos(nSelected); @@ -621,13 +613,22 @@ IMPL_LINK(ClassificationDialog, SelectClassificationHdl, ListBox&, rBox, void) m_nCurrentSelectedCategory = nSelected; } +IMPL_LINK_NOARG(ClassificationDialog, LoseFocusMarkingHdl, Control&, void) +{ + if (m_nInsertMarkings >= 0) + { + const OUString aString = maHelper.GetMarkings()[m_nInsertMarkings]; + insertField(ClassificationType::MARKING, aString, aString); + m_nInsertMarkings = -1; + } +} + IMPL_LINK(ClassificationDialog, SelectMarkingHdl, ListBox&, rBox, void) { sal_Int32 nSelected = rBox.GetSelectedEntryPos(); if (nSelected >= 0) { - const OUString aString = maHelper.GetMarkings()[nSelected]; - insertField(ClassificationType::MARKING, aString, aString); + m_nInsertMarkings = nSelected; } } diff --git a/svx/source/dialog/ClassificationEditView.cxx b/svx/source/dialog/ClassificationEditView.cxx index a992dc0aedf2..76b778303bc2 100644 --- a/svx/source/dialog/ClassificationEditView.cxx +++ b/svx/source/dialog/ClassificationEditView.cxx @@ -48,11 +48,16 @@ ClassificationEditView::ClassificationEditView(vcl::Window* pParent, WinBits nBi const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); Color aBgColor = rStyleSettings.GetWindowColor(); + float fScaleFactor = GetDPIScaleFactor(); + set_width_request(600 * fScaleFactor); + set_height_request(100 * fScaleFactor); + SetMapMode(MapMode(MapUnit::MapTwip)); SetPointer(PointerStyle::Text); SetBackground(aBgColor); - Size aSize(GetOutputSize()); + Size aOutputSize(GetOutputSize()); + Size aSize(aOutputSize); aSize.Height() *= 4; pEdEngine.reset(new ClassificationEditEngine(EditEngine::CreatePool())); @@ -62,7 +67,7 @@ ClassificationEditView::ClassificationEditView(vcl::Window* pParent, WinBits nBi pEdEngine->SetControlWord(pEdEngine->GetControlWord() | EEControlBits::MARKFIELDS); pEdView.reset(new EditView(pEdEngine.get(), this)); - pEdView->SetOutputArea(tools::Rectangle(Point(0,0), GetOutputSize())); + pEdView->SetOutputArea(tools::Rectangle(Point(0,0), aOutputSize)); pEdView->SetBackgroundColor(aBgColor); pEdEngine->InsertView(pEdView.get()); |