Hello!

 

What interface i need to use to find\replace text in writer documet?

Or i need to write it by hands like this:

 

      rtl::OUString uText = xText->getString();

      rtl::OString str = rtl::OUStringToOString( uText,
RTL_TEXTENCODING_MS_1251 );

      string s = str.getStr();

      int iPos = s.find("@@ADRESS_HOUSE@@");

      string s1 = "@@ADRESS_HOUSE@@";

 

      Reference<XTextCursor> xTextCursor = xText->createTextCursor();

      xTextCursor->goRight(iPos, 0);

      xTextCursor->goRight(s1.length(), 1);

      xTextCursor->setString(wVal); // wVal = "some string"

 

Thanks!

Reply via email to