22#include <com/sun/star/beans/XPropertySet.hpp>
23#include <com/sun/star/document/XDocumentProperties.hpp>
24#include <com/sun/star/script/CannotConvertException.hpp>
25#include <com/sun/star/script/Converter.hpp>
26#include <com/sun/star/script/XTypeConverter.hpp>
31#include <rtl/ustring.hxx>
36#include <tools/datetime.hxx>
40#include <templwin.hrc>
65 css::uno::Reference< css::document::XDocumentProperties >
const & xDocProps)
67 assert(xDocProps.is());
83 css::uno::Reference< css::beans::XPropertySet > user(
84 xDocProps->getUserDefinedProperties(), css::uno::UNO_QUERY_THROW);
85 css::uno::Reference< css::beans::XPropertySetInfo > info(
86 user->getPropertySetInfo());
87 const css::uno::Sequence< css::beans::Property >
props(info->getProperties());
88 for (
const auto& rProp :
props) {
89 OUString
name(rProp.Name);
90 css::uno::Any aAny(user->getPropertyValue(
name));
91 css::uno::Reference< css::script::XTypeConverter > conv(
92 css::script::Converter::create(
96 value = conv->convertToSimpleType(aAny, css::uno::TypeClass_STRING).
98 }
catch (css::script::CannotConvertException &) {
101 if (!
value.isEmpty()) {
114 sal_Int32 nLastLen = rEditEngine.
GetText(nPara).getLength();
115 return ESelection(nPara, nLastLen, nPara, nLastLen);
120 std::u16string_view title, OUString
const & value)
126 OUString caption(OUString::Concat(title) +
":\n");
141 if (!
value.isEmpty()) {
155 OUString buf = rLocaleWrapper.
getDate(aToolsDT) +
157 rLocaleWrapper.
getTime(aToolsDT);
static const AllSettings & GetSettings()
bool IsValidAndGregorian() const
OUString GetText(LineEnd eEnd=LINEEND_LF) const
sal_Int32 GetParagraphCount() const
OUString getDate(const Date &rDate) const
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< EditEngine > m_xEditEngine
std::unique_ptr< EditView > m_xEditView
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
void insertNonempty(tools::Long id, OUString const &value)
void insertDateTime(tools::Long id, css::util::DateTime const &value)
void fill(css::uno::Reference< css::document::XDocumentProperties > const &xDocProps)
virtual ~ODocumentInfoPreview() override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
void insertEntry(std::u16string_view title, OUString const &value)
#define TOOLS_INFO_EXCEPTION(area, stream)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
OUString GetString(int nId)
OUString convertCommaSeparated(uno::Sequence< OUString > const &i_rSeq)
Reference< XComponentContext > getProcessComponentContext()
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
const SwDocInfoSubType DI_TITLE