summaryrefslogtreecommitdiffstats
path: root/src/cite/ooo/interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cite/ooo/interface.cpp')
-rw-r--r--src/cite/ooo/interface.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/cite/ooo/interface.cpp b/src/cite/ooo/interface.cpp
index 383ed1e..3e88852 100644
--- a/src/cite/ooo/interface.cpp
+++ b/src/cite/ooo/interface.cpp
@@ -33,7 +33,7 @@
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbc/SQLException.hpp>
+#include <com/sun/star/sdbc/STQLException.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
@@ -122,7 +122,7 @@ bool OOOHandler::Interface::connect(const std::string& host_, int port_, const s
}
// Query for the XUnoUrlResolver interface
- Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_QUERY);
+ Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_TQUERY);
if(!rResolver.is()) {
DEBUG("Error: Couldn't instantiate com.sun.star.bridge.UnoUrlResolver service");
return false;
@@ -145,7 +145,7 @@ bool OOOHandler::Interface::connect(const std::string& host_, int port_, const s
return false;
}
- m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_QUERY);
+ m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_TQUERY);
if(m_gsmgr.is()) {
DEBUG("Connected successfully to office");
} else {
@@ -180,16 +180,16 @@ bool OOOHandler::Interface::createDocument() {
// get the desktop service using createInstance, returns an XInterface type
Reference<uno::XInterface> xInstance = m_gsmgr->createInstance(OUString::createFromAscii("com.sun.star.frame.Desktop"));
- Reference<frame::XDesktop> desktop(xInstance, UNO_QUERY);
+ Reference<frame::XDesktop> desktop(xInstance, UNO_TQUERY);
Reference<lang::XComponent> writer = desktop->getCurrentComponent();
- Reference<lang::XServiceInfo> info(writer, UNO_QUERY);
+ Reference<lang::XServiceInfo> info(writer, UNO_TQUERY);
if(info.is() && info->getImplementationName() == OUString::createFromAscii("SwXTextDocument")) {
DEBUG("Document already open");
} else {
DEBUG("Opening a new document");
//query for the XComponentLoader interface
- Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_QUERY);
+ Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_TQUERY);
if(!rComponentLoader.is()){
DEBUG("XComponentloader failed to instantiate");
return 0;
@@ -203,16 +203,16 @@ bool OOOHandler::Interface::createDocument() {
}
//Manage many events with EventListener
- Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_QUERY);
+ Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_TQUERY);
m_listener = new EventListener(this);
Reference<document::XEventListener> xEventListener = static_cast<document::XEventListener*>(m_listener);
eventBroadcast->addEventListener(xEventListener);
- Reference<frame::XController> controller = Reference<frame::XModel>(writer, UNO_QUERY)->getCurrentController();
- m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_QUERY)->getViewCursor();
- m_doc = Reference<text::XTextDocument>(writer, UNO_QUERY);
+ Reference<frame::XController> controller = Reference<frame::XModel>(writer, UNO_TQUERY)->getCurrentController();
+ m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_TQUERY)->getViewCursor();
+ m_doc = Reference<text::XTextDocument>(writer, UNO_TQUERY);
if(m_doc.is()) {
- m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_QUERY);
+ m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_TQUERY);
}
return m_doc.is();
}
@@ -231,12 +231,12 @@ bool OOOHandler::Interface::updateBibliography() {
}
void OOOHandler::Interface::createBibliography() {
- Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_QUERY)->getDocumentIndexes(), UNO_QUERY);
+ Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_TQUERY)->getDocumentIndexes(), UNO_TQUERY);
for(int i = 0; i < indexes->getCount(); ++i) {
- Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_QUERY);
+ Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_TQUERY);
if(info->supportsService(OUSTR("com.sun.star.text.Bibliography"))) {
DEBUG("Found existing bibliography...");
- m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_QUERY);
+ m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_TQUERY);
break;
}
}
@@ -244,18 +244,18 @@ void OOOHandler::Interface::createBibliography() {
if(!m_bib.is()) {
DEBUG("Creating new bibliography...");
Reference<text::XText> text = m_doc->getText();
- Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_QUERY);
- Reference<text::XTextCursor> cursor(textRange, UNO_QUERY);
+ Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_TQUERY);
+ Reference<text::XTextCursor> cursor(textRange, UNO_TQUERY);
cursor->gotoEnd(false);
text->insertControlCharacter(textRange, text::ControlCharacter::PARAGRAPH_BREAK, false);
- m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_QUERY);
- Reference<text::XTextContent> textContent(m_bib, UNO_QUERY);
+ m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_TQUERY);
+ Reference<text::XTextContent> textContent(m_bib, UNO_TQUERY);
text->insertTextContent(textRange, textContent, false);
}
}
bool OOOHandler::Interface::insertCitations(Cite::Map& fields) {
- Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_QUERY);
+ Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_TQUERY);
if(!entry.is()) {
DEBUG("Interface::insertCitation - can't create TextField");
return false;
@@ -266,12 +266,12 @@ bool OOOHandler::Interface::insertCitations(Cite::Map& fields) {
values[i] = propValue(it->first, it->second);
std::cout << "Setting " << OU2O(values[i].Name) << " = " << it->second << std::endl;
}
- Reference<beans::XPropertySet>(entry, UNO_QUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
+ Reference<beans::XPropertySet>(entry, UNO_TQUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
Reference<text::XText> text = m_doc->getText();
- Reference<text::XTextCursor> cursor = text->createTextCursorByRange(Reference<text::XTextRange>(m_cursor, UNO_QUERY));
- Reference<text::XTextRange> textRange(cursor, UNO_QUERY);
- Reference<text::XTextContent> textContent(entry, UNO_QUERY);
+ Reference<text::XTextCursor> cursor = text->createTextCursorByRange(Reference<text::XTextRange>(m_cursor, UNO_TQUERY));
+ Reference<text::XTextRange> textRange(cursor, UNO_TQUERY);
+ Reference<text::XTextContent> textContent(entry, UNO_TQUERY);
text->insertTextContent(textRange, textContent, false);
return true;
}
@@ -336,13 +336,13 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XRowSet> rowSet(interface, UNO_QUERY);
+ Reference<sdbc::XRowSet> rowSet(interface, UNO_TQUERY);
if(!rowSet.is()) {
DEBUG("Could not create rowset interface");
return false;
}
- Reference<beans::XPropertySet> props(rowSet, UNO_QUERY);
+ Reference<beans::XPropertySet> props(rowSet, UNO_TQUERY);
props->setPropertyValue(OUSTR("DataSourceName"), Any(OUSTR("Bibliography")));
props->setPropertyValue(OUSTR("CommandType"), Any(sdb::CommandType::COMMAND));
OUString s = OUSTR("SELECT COUNT(*) FROM \"biblio\" WHERE identifier='") + O2OU(fields["Identifier"]) + OUSTR("'");
@@ -350,9 +350,9 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
try {
rowSet->execute();
- } catch(sdbc::SQLException& e) {
+ } catch(sdbc::STQLException& e) {
DEBUG(OU2O(s));
- DEBUG(OUSTR("SQL error - ") + e.SQLState);
+ DEBUG(OUSTR("SQL error - ") + e.STQLState);
return false;
} catch(Exception& e) {
DEBUG(OU2O(s));
@@ -360,7 +360,7 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XRow> row(rowSet, UNO_QUERY);
+ Reference<sdbc::XRow> row(rowSet, UNO_TQUERY);
int count = 0;
if(rowSet->next()) {
count = row->getString(1).toInt32();
@@ -380,9 +380,9 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
try {
rowSet->execute();
- } catch(sdbc::SQLException& e) {
+ } catch(sdbc::STQLException& e) {
DEBUG(OU2O(s));
- DEBUG(OUSTR("SQL error(2) - ") + e.SQLState);
+ DEBUG(OUSTR("SQL error(2) - ") + e.STQLState);
return false;
} catch(Exception& e) {
DEBUG(OU2O(s));
@@ -390,12 +390,12 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XResultSet> resultSet(rowSet, UNO_QUERY);
- Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_QUERY);
+ Reference<sdbc::XResultSet> resultSet(rowSet, UNO_TQUERY);
+ Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_TQUERY);
Reference<sdbc::XResultSetMetaData> metaData = mdSupplier->getMetaData();
- Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_QUERY);
- Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_QUERY);
+ Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_TQUERY);
+ Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_TQUERY);
if(count > 0) {
resultSet->last();
} else {
@@ -412,8 +412,8 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
std::cout << s << " = " << value << std::endl;
try {
rowUpdate->updateString(i, O2OU(value));
- } catch(sdbc::SQLException& e) {
- DEBUG(OUSTR("SQL error(3) - ") + e.SQLState);
+ } catch(sdbc::STQLException& e) {
+ DEBUG(OUSTR("SQL error(3) - ") + e.STQLState);
} catch(Exception& e) {
DEBUG(OUSTR("General error(3) - ") + e.Message);
}
@@ -425,6 +425,6 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
update->insertRow();
}
- Reference<lang::XComponent>(rowSet, UNO_QUERY)->dispose();
+ Reference<lang::XComponent>(rowSet, UNO_TQUERY)->dispose();
return true;
}