summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/helper/formpdfexport.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx
index 1c7757553676..28cfedf5e4ae 100644
--- a/toolkit/source/helper/formpdfexport.cxx
+++ b/toolkit/source/helper/formpdfexport.cxx
@@ -491,6 +491,42 @@ namespace toolkitform
nMaxTextLength = 0;
pEditWidget->MaxLen = nMaxTextLength;
}
+
+ switch ( nControlType )
+ {
+ case FormComponentType::CURRENCYFIELD:
+ case FormComponentType::NUMERICFIELD:
+
+ pEditWidget->Format = vcl::PDFWriter::Number;
+
+ static constexpr OUStringLiteral FM_PROP_CURRENCYSYMBOL = u"CurrencySymbol";
+ if ( xPSI->hasPropertyByName( FM_PROP_CURRENCYSYMBOL ) )
+ {
+ OUString sCurrencySymbol;
+ if( ! (xModelProps->getPropertyValue( FM_PROP_CURRENCYSYMBOL ) >>= sCurrencySymbol) )
+ SAL_WARN("toolkit.helper", "describePDFControl: unable to get property " << FM_PROP_CURRENCYSYMBOL);
+ pEditWidget->CurrencySymbol = sCurrencySymbol;
+ }
+
+ static constexpr OUStringLiteral FM_PROP_DECIMALACCURACY = u"DecimalAccuracy";
+ if ( xPSI->hasPropertyByName( FM_PROP_DECIMALACCURACY ) )
+ {
+ sal_Int32 nDecimalAccuracy = 0;
+ if( ! (xModelProps->getPropertyValue( FM_PROP_DECIMALACCURACY ) >>= nDecimalAccuracy) )
+ SAL_WARN("toolkit.helper", "describePDFControl: unable to get property " << FM_PROP_DECIMALACCURACY);
+ pEditWidget->DecimalAccuracy = nDecimalAccuracy;
+ }
+
+ static constexpr OUStringLiteral FM_PROP_PREPENDCURRENCYSYMBOL = u"PrependCurrencySymbol";
+ if ( xPSI->hasPropertyByName( FM_PROP_PREPENDCURRENCYSYMBOL ) )
+ {
+ bool bPrependCurrencySymbol = true;
+ if( ! (xModelProps->getPropertyValue( FM_PROP_PREPENDCURRENCYSYMBOL ) >>= bPrependCurrencySymbol) )
+ SAL_WARN("toolkit.helper", "describePDFControl: unable to get property " << FM_PROP_PREPENDCURRENCYSYMBOL);
+ pEditWidget->PrependCurrencySymbol = bPrependCurrencySymbol;
+ }
+ break;
+ }
}