summaryrefslogtreecommitdiffstats
path: root/src/cite/ooo
diff options
context:
space:
mode:
Diffstat (limited to 'src/cite/ooo')
-rw-r--r--src/cite/ooo/interface.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/cite/ooo/interface.cpp b/src/cite/ooo/interface.cpp
index b1cf69e..383ed1e 100644
--- a/src/cite/ooo/interface.cpp
+++ b/src/cite/ooo/interface.cpp
@@ -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_TQUERY);
+ Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_QUERY);
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_TQUERY);
+ m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_QUERY);
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_TQUERY);
+ Reference<frame::XDesktop> desktop(xInstance, UNO_QUERY);
Reference<lang::XComponent> writer = desktop->getCurrentComponent();
- Reference<lang::XServiceInfo> info(writer, UNO_TQUERY);
+ Reference<lang::XServiceInfo> info(writer, UNO_QUERY);
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_TQUERY);
+ Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_QUERY);
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_TQUERY);
+ Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_QUERY);
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_TQUERY)->getCurrentController();
- m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_TQUERY)->getViewCursor();
- m_doc = Reference<text::XTextDocument>(writer, UNO_TQUERY);
+ 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);
if(m_doc.is()) {
- m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_TQUERY);
+ m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_QUERY);
}
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_TQUERY)->getDocumentIndexes(), UNO_TQUERY);
+ Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_QUERY)->getDocumentIndexes(), UNO_QUERY);
for(int i = 0; i < indexes->getCount(); ++i) {
- Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_TQUERY);
+ Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_QUERY);
if(info->supportsService(OUSTR("com.sun.star.text.Bibliography"))) {
DEBUG("Found existing bibliography...");
- m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_TQUERY);
+ m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_QUERY);
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_TQUERY);
- Reference<text::XTextCursor> cursor(textRange, UNO_TQUERY);
+ Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_QUERY);
+ Reference<text::XTextCursor> cursor(textRange, UNO_QUERY);
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_TQUERY);
- Reference<text::XTextContent> textContent(m_bib, UNO_TQUERY);
+ m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_QUERY);
+ Reference<text::XTextContent> textContent(m_bib, UNO_QUERY);
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_TQUERY);
+ Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_QUERY);
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_TQUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
+ Reference<beans::XPropertySet>(entry, UNO_QUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
Reference<text::XText> text = m_doc->getText();
- 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);
+ 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);
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_TQUERY);
+ Reference<sdbc::XRowSet> rowSet(interface, UNO_QUERY);
if(!rowSet.is()) {
DEBUG("Could not create rowset interface");
return false;
}
- Reference<beans::XPropertySet> props(rowSet, UNO_TQUERY);
+ Reference<beans::XPropertySet> props(rowSet, UNO_QUERY);
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("'");
@@ -360,7 +360,7 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XRow> row(rowSet, UNO_TQUERY);
+ Reference<sdbc::XRow> row(rowSet, UNO_QUERY);
int count = 0;
if(rowSet->next()) {
count = row->getString(1).toInt32();
@@ -390,12 +390,12 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XResultSet> resultSet(rowSet, UNO_TQUERY);
- Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_TQUERY);
+ Reference<sdbc::XResultSet> resultSet(rowSet, UNO_QUERY);
+ Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_QUERY);
Reference<sdbc::XResultSetMetaData> metaData = mdSupplier->getMetaData();
- Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_TQUERY);
- Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_TQUERY);
+ Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_QUERY);
+ Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_QUERY);
if(count > 0) {
resultSet->last();
} else {
@@ -425,6 +425,6 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
update->insertRow();
}
- Reference<lang::XComponent>(rowSet, UNO_TQUERY)->dispose();
+ Reference<lang::XComponent>(rowSet, UNO_QUERY)->dispose();
return true;
}