20#include <com/sun/star/uno/Sequence.h>
21#include <com/sun/star/uno/Exception.hpp>
22#include <com/sun/star/ucb/UniversalContentBroker.hpp>
23#include <com/sun/star/ucb/XContentIdentifier.hpp>
24#include <com/sun/star/ucb/XCommandEnvironment.hpp>
25#include <com/sun/star/ucb/TransferInfo.hpp>
26#include <com/sun/star/ucb/NameClash.hpp>
27#include <com/sun/star/sdbc/XResultSet.hpp>
28#include <com/sun/star/sdbc/XRow.hpp>
33#include <tools/datetime.hxx>
35#include <rtl/ustring.hxx>
36#include <osl/diagnose.h>
52 sal_Int32 nReturn = 0;
53 if (! ::cppu::enum2int(nReturn,rVal) )
54 OSL_FAIL(
"can't get EnumAsInt32" );
65 css::uno::Reference< css::ucb::XCommandEnvironment >(),
70 catch( css::uno::Exception& )
78bool UCB_MoveFile(
const OUString& rURL, std::u16string_view rNewURL )
80 bool bCopyCompleted =
true;
89 css::uno::Reference< css::ucb::XCommandEnvironment >(),
92 css::ucb::TransferInfo aInfo;
93 aInfo.NameClash = css::ucb::NameClash::ERROR;
94 aInfo.NewTitle =
sName;
95 aInfo.SourceURL = rURL;
96 aInfo.MoveData =
true;
99 catch( css::uno::Exception& )
102 bCopyCompleted =
false;
104 return bCopyCompleted;
114 css::uno::Reference< css::ucb::XContentIdentifier > xRef1 =
new
118 css::uno::Reference< css::ucb::XContentIdentifier > xRef2 =
new
121 css::uno::Reference< css::ucb::XUniversalContentBroker > xUcb =
124 sal_Int32 nCompare = xUcb->compareContentIds( xRef1, xRef2 );
125 bCaseSensitive = 0 != nCompare;
127 catch( css::uno::Exception& )
129 bCaseSensitive =
false;
132 return bCaseSensitive;
137 bool bIsReadOnly =
false;
143 bIsReadOnly = *o3tl::doAccess<bool>(aAny);
145 catch( css::uno::Exception& )
154 bool bExists =
false;
160 catch (css::uno::Exception &)
168 bool bExists =
false;
174 catch (css::uno::Exception &)
186 std::vector<OUString>& rList,
187 const OUString* pExtension,
188 std::vector< ::DateTime >* pDateTimeList )
194 css::uno::Reference< css::sdbc::XResultSet > xResultSet;
196 const sal_Int32 nSeqSize = pDateTimeList ? 2 : 1;
197 css::uno::Sequence < OUString > aProps( nSeqSize );
198 OUString* pProps = aProps.getArray();
199 pProps[ 0 ] =
"Title";
201 pProps[ 1 ] =
"DateModified";
205 xResultSet = aCnt.
createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY );
207 catch( css::uno::Exception& )
209 OSL_FAIL(
"create cursor failed!" );
212 if( xResultSet.is() )
214 css::uno::Reference< css::sdbc::XRow > xRow( xResultSet, css::uno::UNO_QUERY );
215 const sal_Int32 nExtLen = pExtension ? pExtension->getLength() : 0;
218 if( xResultSet->first() )
221 const OUString sTitle( xRow->getString( 1 ) );
223 ( sTitle.getLength() > nExtLen &&
224 sTitle.endsWith( *pExtension )) )
226 rList.push_back( sTitle );
230 css::util::DateTime aStamp = xRow->getTimestamp(2);
238 aStamp.NanoSeconds ));
239 pDateTimeList->push_back( aDateTime );
243 }
while( xResultSet->next() );
247 catch( css::uno::Exception& )
253 catch( css::uno::Exception& )
262 sal_uInt16
const nMID)
274 const drawing::FillStyle eFill = pXFillStyleItem->GetValue();
277 case drawing::FillStyle_NONE:
291 case drawing::FillStyle_SOLID:
292 case drawing::FillStyle_GRADIENT:
293 case drawing::FillStyle_HATCH:
299 return (drawing::FillStyle_SOLID != eFill)
305 return (drawing::FillStyle_SOLID != eFill)
312 case drawing::FillStyle_BITMAP:
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void SetBase(std::u16string_view rTheBase)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
css::uno::Any getPropertyValue(const OUString &rPropertyName)
css::uno::Any executeCommand(const OUString &rCommandName, const css::uno::Any &rCommandArgument)
css::uno::Reference< css::sdbc::XResultSet > createCursor(const css::uno::Sequence< OUString > &rPropertyNames, ResultSetInclude eMode=INCLUDE_FOLDERS_AND_DOCUMENTS)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define MID_GRAPHIC_POSITION
#define MID_BACK_COLOR_R_G_B
#define MID_BACK_COLOR_TRANSPARENCY
#define MID_GRAPHIC_TRANSPARENT
#define MID_GRAPHIC_TRANSPARENCY
bool UCB_IsFile(const OUString &rURL)
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
bool UCB_GetFileListOfFolder(const OUString &rURL, std::vector< OUString > &rList, const OUString *pExtension, std::vector< ::DateTime > *pDateTimeList)
bool UCB_DeleteFile(const OUString &rURL)
bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet &rSet, sal_uInt16 const nMID)
helper to check if fill style is set to color or bitmap and thus formerly used SvxBrushItem parts nee...
bool UCB_IsDirectory(const OUString &rURL)
bool UCB_IsReadOnlyFileName(const OUString &rURL)
bool UCB_IsCaseSensitiveFileName(std::u16string_view rURL)
bool UCB_MoveFile(const OUString &rURL, std::u16string_view rNewURL)
Reference< XComponentContext > getProcessComponentContext()
constexpr TypedWhichId< XFillBmpPosItem > XATTR_FILLBMP_POS(XATTR_FILL_FIRST+8)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)