40 : m_xBuilder(
Application::CreateBuilder(nullptr,
"modules/simpress/ui/fieldmenu.ui"))
41 , m_xPopup(m_xBuilder->weld_menu(
"menu"))
56 m_xPopup->append_separator(
"separator1");
62 if (pDateField->GetType() == SvxDateType::Fix)
69 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_STANDARD_SMALL));
70 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_STANDARD_BIG));
74 m_xPopup->append_radio(OUString::number(nID++), aDateField.
GetFormatted(*pNumberFormatter, eLanguage));
76 m_xPopup->append_radio(OUString::number(nID++), aDateField.
GetFormatted(*pNumberFormatter, eLanguage));
78 m_xPopup->append_radio(OUString::number(nID++), aDateField.
GetFormatted(*pNumberFormatter, eLanguage));
81 m_xPopup->append_radio(OUString::number(nID++), aDateField.
GetFormatted(*pNumberFormatter, eLanguage));
83 m_xPopup->append_radio(OUString::number(nID++), aDateField.
GetFormatted(*pNumberFormatter, eLanguage));
85 m_xPopup->append_radio(OUString::number(nID++), aDateField.
GetFormatted(*pNumberFormatter, eLanguage));
87 m_xPopup->set_active(OUString::number(
static_cast<sal_uInt16
>( pDateField->GetFormat() ) + 1),
true);
93 if( pTimeField->GetType() == SvxTimeType::Fix )
100 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_STANDARD_NORMAL));
103 aTimeField.
SetFormat( SvxTimeFormat::HH24_MM );
104 m_xPopup->append_radio(OUString::number(nID++), aTimeField.
GetFormatted(*pNumberFormatter, eLanguage));
105 aTimeField.
SetFormat( SvxTimeFormat::HH24_MM_SS );
106 m_xPopup->append_radio(OUString::number(nID++), aTimeField.
GetFormatted(*pNumberFormatter, eLanguage));
107 aTimeField.
SetFormat( SvxTimeFormat::HH24_MM_SS_00 );
108 m_xPopup->append_radio(OUString::number(nID++), aTimeField.
GetFormatted(*pNumberFormatter, eLanguage));
110 aTimeField.
SetFormat( SvxTimeFormat::HH12_MM );
111 m_xPopup->append_radio(OUString::number(nID++), aTimeField.
GetFormatted(*pNumberFormatter, eLanguage));
112 aTimeField.
SetFormat( SvxTimeFormat::HH12_MM_SS );
113 m_xPopup->append_radio(OUString::number(nID++), aTimeField.
GetFormatted(*pNumberFormatter, eLanguage));
114 aTimeField.
SetFormat( SvxTimeFormat::HH12_MM_SS_00 );
115 m_xPopup->append_radio(OUString::number(nID++), aTimeField.
GetFormatted(*pNumberFormatter, eLanguage));
120 m_xPopup->set_active(OUString::number(
static_cast<sal_uInt16
>( pTimeField->GetFormat() ) + 1),
true);
126 if( pFileField->GetType() == SvxFileType::Fix )
131 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_FILEFORMAT_NAME_EXT));
132 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_FILEFORMAT_FULLPATH));
133 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_FILEFORMAT_PATH));
134 m_xPopup->append_radio(OUString::number(nID++),
SdResId(STR_FILEFORMAT_NAME));
136 m_xPopup->set_active(OUString::number(
static_cast<sal_uInt16
>( pFileField->GetFormat() ) + 3),
true);
142 if( pAuthorField->GetType() == SvxAuthorType::Fix )
147 for( sal_uInt16
i = 0;
i < 4;
i++ )
152 m_xPopup->set_active(OUString::number(
static_cast<sal_uInt16
>( pAuthorField->GetFormat() ) + 3),
true);
158 OUString sIdent =
m_xPopup->popup_at_rect(pParent, rRect);
159 if (sIdent.isEmpty())
162 if (sIdent ==
"1" || sIdent ==
"2")
164 m_xPopup->set_active(
"1", sIdent ==
"1");
165 m_xPopup->set_active(
"2", sIdent ==
"2");
172 OUString::number(
i), sIdent == std::u16string_view(OUString::number(
i)));
193 eType = SvxDateType::Fix;
195 eType = SvxDateType::Var;
199 if (
m_xPopup->get_active(OUString::number(
i)))
204 if( pDateField->GetFormat() != eFormat ||
205 pDateField->GetType() !=
eType )
211 if( (pDateField->GetType() == SvxDateType::Var) && (
eType == SvxDateType::Fix) )
214 static_cast<SvxDateField*
>( pNewField )->SetFixDate( aDate );
225 eType = SvxTimeType::Fix;
227 eType = SvxTimeType::Var;
231 if (
m_xPopup->get_active(OUString::number(
i)))
236 if( pTimeField->GetFormat() != eFormat ||
237 pTimeField->GetType() !=
eType )
243 if( (pTimeField->GetType() == SvxTimeType::Var) && (
eType == SvxTimeType::Fix) )
258 eType = SvxFileType::Fix;
260 eType = SvxFileType::Var;
264 if (
m_xPopup->get_active(OUString::number(
i)))
269 if( pFileField->GetFormat() != eFormat ||
270 pFileField->GetType() !=
eType )
294 eType = SvxAuthorType::Fix;
296 eType = SvxAuthorType::Var;
300 if (
m_xPopup->get_active(OUString::number(
i)))
305 if( pAuthorField->GetFormat() != eFormat ||
306 pAuthorField->GetType() !=
eType )
const OUString & GetName() const
SfxMedium * GetMedium() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
OUString GetFirstName() const
OUString GetLastName() const
OUString GetFormatted() const
void SetFormat(SvxAuthorFormat eFmt)
OUString GetFormatted(SvNumberFormatter &rFormatter, LanguageType eLanguage) const
void SetFormat(SvxDateFormat eFmt)
void SetFormat(SvxTimeFormat eFmt)
OUString GetFormatted(SvNumberFormatter &rFormatter, LanguageType eLanguage) const
OUString SdResId(TranslateId aId)