22#include <rtl/ustrbuf.hxx>
24#include <com/sun/star/util/DateTime.hpp>
25#include <com/sun/star/util/Date.hpp>
29#include <osl/diagnose.h>
35 using ::com::sun::star::uno::Any;
36 using ::com::sun::star::util::DateTime;
37 using ::com::sun::star::util::Date;
47 OSL_VERIFY( i_propertyValue >>= aDate );
50 aDateTime.Day = aDate.Day;
51 aDateTime.Month = aDate.Month;
52 aDateTime.Year = aDate.Year;
56 return aBuffer.makeStringAndClear();
65 aDate.Day = aDateTime.Day;
66 aDate.Month = aDateTime.Month;
67 aDate.Year = aDateTime.Year;
72 sal_Int32 nVCLDate(0);
75 OSL_ENSURE(
false,
"VCLDateHandler::getPropertyValues: unknown date format (no XML-schema date, no legacy integer)!" );
81 const Any aPropertyValue( aDate );
83 OSL_ENSURE( o_propertyValues.size() == 1,
"VCLDateHandler::getPropertyValues: date strings represent exactly one property - not more, not less!" );
84 for (
auto& prop : o_propertyValues )
86 prop.second = aPropertyValue;
css::util::Date GetUNODate() const
static void convertDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime, sal_Int16 const *pTimeZoneOffset, bool bAddTimeIf0AM=false)
static bool parseDateTime(css::util::DateTime &rDateTime, std::u16string_view rString)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
virtual bool getPropertyValues(const OUString &i_attributeValue, PropertyValues &o_propertyValues) const override
retrieves the values of the properties controlled by an XML attributed, described by a given attribut...
virtual OUString getAttributeValue(const css::uno::Any &i_propertyValue) const override
is a convenience method for XML attributes whose value comprises of only one UNO API property
::std::map< PropertyId, css::uno::Any > PropertyValues
std::unique_ptr< char[]> aBuffer