20#include <com/sun/star/container/XNameAccess.hpp>
21#include <com/sun/star/beans/PropertyValue.hpp>
22#include <com/sun/star/uno/XComponentContext.hpp>
27#include <osl/file.hxx>
42 : GenericDialogController(pParent,
"filter/ui/xsltfilterdialog.ui",
"XSLTFilterDialog")
44 , m_xTabCtrl(m_xBuilder->weld_notebook(
"tabcontrol"))
45 , m_xOKBtn(m_xBuilder->weld_button(
"ok"))
53 aTitle = aTitle.replaceAll(
"%s",
mpNewInfo->maFilterName);
90 if( xFilterContainer.is() )
92 if( xFilterContainer->hasByName(
mpNewInfo->maFilterName ) )
94 sErrorPage =
"general";
95 pErrorId = STR_ERROR_FILTER_NAME_EXISTS;
113 if(
mpNewInfo->maInterfaceName.isEmpty() )
122 if( xFilterContainer.is() )
125 OUString* pFilterName = aFilterNames.getArray();
127 const sal_Int32
nCount = aFilterNames.getLength();
131 for( nFilter = 0; (nFilter <
nCount) && !pErrorId; nFilter++, pFilterName++ )
133 Any aAny( xFilterContainer->getByName( *pFilterName ) );
134 if( !(aAny >>= aValues) )
137 const sal_Int32 nValueCount( aValues.getLength() );
138 PropertyValue*
pValues = aValues.getArray();
143 if (
pValues->Name ==
"UIName" )
145 OUString aInterfaceName;
146 pValues->Value >>= aInterfaceName;
147 if( aInterfaceName ==
mpNewInfo->maInterfaceName )
149 sErrorPage =
"general";
150 pErrorId = STR_ERROR_TYPE_NAME_EXISTS;
151 pFocusWindow =
mpBasicPage->m_xEDInterfaceName.get();
153 aReplace2 = *pFilterName;
172 osl::File aFile(
mpNewInfo->maExportXSLT );
173 osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read );
174 if( aRC != osl::File::E_None )
176 pErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND;
177 sErrorPage =
"transformation";
178 pFocusWindow =
mpXSLTPage->m_xEDExportXSLT->getWidget();
188 osl::File aFile(
mpNewInfo->maImportXSLT );
189 osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read );
190 if( aRC != osl::File::E_None )
192 pErrorId = STR_ERROR_IMPORT_XSLT_NOT_FOUND;
193 sErrorPage =
"transformation";
194 pFocusWindow =
mpXSLTPage->m_xEDImportTemplate->getWidget();
202 pErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND;
203 sErrorPage =
"transformation";
204 pFocusWindow =
mpXSLTPage->m_xEDExportXSLT->getWidget();
212 osl::File aFile(
mpNewInfo->maImportTemplate );
213 osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read );
214 if( aRC != osl::File::E_None )
216 pErrorId = STR_ERROR_IMPORT_TEMPLATE_NOT_FOUND;
217 sErrorPage =
"transformation";
218 pFocusWindow =
mpXSLTPage->m_xEDImportTemplate->getWidget();
227 OUString aMessage(FilterResId(pErrorId));
229 if( aReplace2.getLength() )
231 aMessage = aMessage.replaceAll(
"%s1", aReplace1 );
232 aMessage = aMessage.replaceAll(
"%s2", aReplace2 );
234 else if( aReplace1.getLength() )
236 aMessage = aMessage.replaceAll(
"%s", aReplace1 );
240 VclMessageType::Warning, VclButtonsType::Ok,
const PropertyValue * pValues
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
std::unique_ptr< XMLFilterTabPageXSLT > mpXSLTPage
virtual ~XMLFilterTabDialog() override
css::uno::Reference< css::uno::XComponentContext > mxContext
const filter_info_impl * mpOldInfo
std::unique_ptr< filter_info_impl > mpNewInfo
XMLFilterTabDialog(weld::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const filter_info_impl *pInfo)
std::unique_ptr< weld::Button > m_xOKBtn
std::unique_ptr< weld::Notebook > m_xTabCtrl
std::unique_ptr< XMLFilterTabPageBasic > mpBasicPage
OUString maImportTemplate
std::shared_ptr< weld::Dialog > m_xDialog
#define TOOLS_WARN_EXCEPTION(area, stream)
#define LINK(Instance, Class, Member)
COMPHELPER_DLLPUBLIC bool isFileUrl(std::u16string_view url)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
IMPL_LINK_NOARG(XMLFilterTabDialog, OkHdl, weld::Button &, void)