1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
24 #include <osl/module.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <sfx2/viewfrm.hxx>
27 #include <sfx2/progress.hxx>
28 #include <svl/itemset.hxx>
30 #include "../ui/inc/DrawDocShell.hxx"
31 #include "../ui/inc/strings.hrc"
33 #include "sdresid.hxx"
35 #include "drawdoc.hxx"
36 #include "sdfilter.hxx"
42 using namespace ::com::sun::star::uno
;
43 using namespace ::com::sun::star::task
;
44 using namespace ::com::sun::star::frame
;
50 SdFilter::SdFilter( SfxMedium
& rMedium
, ::sd::DrawDocShell
& rDocShell
, sal_Bool bShowProgress
)
51 : mxModel( rDocShell
.GetModel() )
53 , mrDocShell( rDocShell
)
54 , mrDocument( *rDocShell
.GetDoc() )
55 , mbIsDraw( rDocShell
.GetDocumentType() == DOCUMENT_TYPE_DRAW
)
56 , mbShowProgress( bShowProgress
)
60 // -----------------------------------------------------------------------------
66 // -----------------------------------------------------------------------------
68 OUString
SdFilter::ImplGetFullLibraryName( const OUString
& rLibraryName
) const
70 String
aTemp(OUString(SVLIBRARY("?")));
71 xub_StrLen nIndex
= aTemp
.Search( (sal_Unicode
)'?' );
72 aTemp
.Replace( nIndex
, 1, rLibraryName
);
73 OUString
aLibraryName( aTemp
);
77 // -----------------------------------------------------------------------------
79 #ifndef DISABLE_DYNLOADING
80 extern "C" { static void SAL_CALL
thisModule() {} }
82 ::osl::Module
* SdFilter::OpenLibrary( const OUString
& rLibraryName
) const
84 std::auto_ptr
< osl::Module
> mod(new osl::Module
);
85 return mod
->loadRelative(&thisModule
, ImplGetFullLibraryName(rLibraryName
),
86 SAL_LOADMODULE_GLOBAL
| SAL_LOADMODULE_LAZY
)
92 // -----------------------------------------------------------------------------
94 void SdFilter::CreateStatusIndicator()
96 // The status indicator must be retrieved from the provided medium arguments
97 const SfxUnoAnyItem
* pStatusBarItem
= static_cast<const SfxUnoAnyItem
*>(
98 mrMedium
.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL
) );
100 if ( pStatusBarItem
)
101 pStatusBarItem
->GetValue() >>= mxStatusIndicator
;
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */