Kaydet (Commit) 64d9d21d authored tarafından Caolán McNamara's avatar Caolán McNamara

wrong seekPage

üst 477a7e71
...@@ -375,6 +375,30 @@ namespace xmloff ...@@ -375,6 +375,30 @@ namespace xmloff
return bKnownPage; return bKnownPage;
} }
//---------------------------------------------------------------------
sal_Bool OFormLayerXMLExport_Impl::seekPage(const Reference< XDrawPage >& _rxDrawPage)
{
sal_Bool bKnownPage = implMoveIterators( _rxDrawPage, sal_False );
if ( bKnownPage )
return sal_True;
// if the page is not yet known, this does not automatically mean that it has
// not been examined. Instead, examineForms returns silently and successfully
// if a page is a XFormsPageSupplier2, but does not have a forms collection
// (This behaviour of examineForms is a performance optimization, to not force
// the page to create a forms container just to see that it's empty.)
// So, in such a case, seekPage is considered to be successfull, too, though the
// page was not yet known
Reference< XFormsSupplier2 > xFormsSupp( _rxDrawPage, UNO_QUERY );
if ( xFormsSupp.is() && !xFormsSupp->hasForms() )
return sal_True;
// anything else means that the page has not been examined before, or it's no
// valid form page. Both cases are Bad (TM).
return sal_False;
}
//--------------------------------------------------------------------- //---------------------------------------------------------------------
::rtl::OUString OFormLayerXMLExport_Impl::getControlId(const Reference< XPropertySet >& _rxControl) ::rtl::OUString OFormLayerXMLExport_Impl::getControlId(const Reference< XPropertySet >& _rxControl)
{ {
......
...@@ -152,6 +152,16 @@ namespace xmloff ...@@ -152,6 +152,16 @@ namespace xmloff
const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
); );
/** seek to the page given.
<p>This must be called before you can retrieve any ids for controls on the page.</p>
@see
getControlId
*/
sal_Bool seekPage(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
/** get the id of the given control. /** get the id of the given control.
<p>You must have sought to the page of the control before calling this.</p> <p>You must have sought to the page of the control before calling this.</p>
......
...@@ -542,14 +542,6 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP ...@@ -542,14 +542,6 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP
return pContext; return pContext;
} }
//---------------------------------------------------------------------
void OFormLayerXMLImport_Impl::seekPage(const Reference< XDrawPage >& _rxDrawPage)
{
OSL_ENSURE(m_aCurrentPageIds == m_aControlIds.end(), "OFormLayerXMLImport_Impl::seekPage: importing another page currently! This will smash your import!");
m_aCurrentPageIds = m_aControlIds.find(_rxDrawPage);
OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::seekPage: did not find the given page (perhaps it has not been imported, yet?)!");
}
//--------------------------------------------------------------------- //---------------------------------------------------------------------
void OFormLayerXMLImport_Impl::documentDone( ) void OFormLayerXMLImport_Impl::documentDone( )
{ {
......
...@@ -173,11 +173,6 @@ namespace xmloff ...@@ -173,11 +173,6 @@ namespace xmloff
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
lookupControlId(const ::rtl::OUString& _rControlId); lookupControlId(const ::rtl::OUString& _rControlId);
/** seek to the given page
*/
void seekPage(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
/** announces the auto-style context to the form importer /** announces the auto-style context to the form importer
*/ */
void setAutoStyleContext(SvXMLStylesContext* _pNewContext); void setAutoStyleContext(SvXMLStylesContext* _pNewContext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment