rpms/openoffice.org-voikko/devel OOO300_m14-fix-grammar-check-build.patch, NONE, 1.1 openoffice.org-voikko.spec, 1.14, 1.15

Ville-Pekka Vainio vpv at fedoraproject.org
Sun Dec 28 00:04:58 UTC 2008


Author: vpv

Update of /cvs/pkgs/rpms/openoffice.org-voikko/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7221

Modified Files:
	openoffice.org-voikko.spec 
Added Files:
	OOO300_m14-fix-grammar-check-build.patch 
Log Message:
* Sun Dec 28 2008 Ville-Pekka Vainio <vpivaini AT cs.helsinki.fi> - 3.0-5
- Add patch from upstream to fix FTBFS with OOO300_m14, the grammar
  checking framework was changed


OOO300_m14-fix-grammar-check-build.patch:

--- NEW FILE OOO300_m14-fix-grammar-check-build.patch ---
Index: README
===================================================================
--- README	(revision 2435)
+++ README	(working copy)
@@ -54,9 +54,9 @@
     SDK have spaces in their installation path. On Windows you can use spaces in
     these paths if you replace the components containing spaces with the "8.3" name
     during configuration of the SDK as follows:
-      Office = C:\PROGRA~1\OpenOffice.org
-      Office Base = C:\PROGRA~1\OpenOffice
-      URE = C:\PROGRA~1\OpenOffice.org\URE
+      Office =C:\PROGRA~1\OPENOF~1.ORG
+      Office Base = C:\PROGRA~1\OPENOF~1.ORG\Basis
+      URE = C:\PROGRA~1\OPENOF~1.ORG\URE
 - Run "make oxt". This will build the extensions package voikko.oxt under
   subdirectory build.
   * There are some settings available that can be used to customize the build.
Index: src/grammar/GrammarChecker.cxx
===================================================================
--- src/grammar/GrammarChecker.cxx	(revision 2435)
+++ src/grammar/GrammarChecker.cxx	(working copy)
@@ -26,7 +26,7 @@
 GrammarChecker::GrammarChecker(uno::Reference<uno::XComponentContext> const & context) :
 	cppu::WeakComponentImplHelper4
 	     <lang::XServiceInfo,
-	      linguistic2::XGrammarChecker,
+	      linguistic2::XProofreader,
 	      lang::XInitialization,
 	      lang::XServiceDisplayName>(m_aMutex),
 	compContext(context) { VOIKKO_DEBUG("GrammarChecker:ctor"); }
@@ -66,71 +66,48 @@
 	return sal_False;
 }
 
-void SAL_CALL GrammarChecker::startDocument(sal_Int32 /*nDocId*/)
-	throw (uno::RuntimeException, lang::IllegalArgumentException) {
-	// do nothing
-}
-
-void SAL_CALL GrammarChecker::startParagraph(sal_Int32 /*nDocId*/)
-	throw (uno::RuntimeException, lang::IllegalArgumentException) {
-	// do nothing
-}
-
-void SAL_CALL GrammarChecker::endParagraph(sal_Int32 /*nDocId*/)
-	throw (uno::RuntimeException, lang::IllegalArgumentException) {
-	// do nothing
-}
-
-void SAL_CALL GrammarChecker::endDocument(sal_Int32 /*nDocId*/)
-	throw (uno::RuntimeException, lang::IllegalArgumentException) {
-	// do nothing
-}
-
-linguistic2::GrammarCheckingResult SAL_CALL GrammarChecker::doGrammarChecking(
-	sal_Int32 nDocId,
+linguistic2::ProofreadingResult SAL_CALL GrammarChecker::doProofreading(
+	const OUString & aDocumentIdentifier,
 	const OUString & aText,
 	const lang::Locale & aLocale,
 	sal_Int32 nStartOfSentencePos,
-	sal_Int32 nSuggestedSentenceEndPos,
-	const uno::Sequence<sal_Int32> & /*aLanguagePortions*/,
-	const uno::Sequence<lang::Locale> & /*aLanguagePortionsLocales*/)
+	sal_Int32 nSuggestedBehindEndOfSentencePosition,
+	const uno::Sequence<beans::PropertyValue> & /* aProperties */)
 	throw (uno::RuntimeException, lang::IllegalArgumentException) {
 	
-	VOIKKO_DEBUG("GrammarChecker::doGrammarChecking");
-	linguistic2::GrammarCheckingResult result;
-	result.nDocumentId = nDocId;
+	VOIKKO_DEBUG("GrammarChecker::doProofreading");
+	linguistic2::ProofreadingResult result;
+	result.aDocumentIdentifier = aDocumentIdentifier;
 	result.xFlatParagraph = 0;
 	result.aText = aText;
 	result.aLocale = aLocale;
-	result.nStartOfSentencePos = nStartOfSentencePos;
-	result.nEndOfSentencePos = nSuggestedSentenceEndPos;
-	result.xGrammarChecker = this;
+	result.nStartOfSentencePosition = nStartOfSentencePos;
+	result.nBehindEndOfSentencePosition = nSuggestedBehindEndOfSentencePosition;
+	result.xProofreader = this;
 
 	OString textUtf8 = ::rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8);
 	sal_Int32 paraLen = textUtf8.getLength();
-	uno::Sequence<linguistic2::SingleGrammarError> gcErrors(0);
+	uno::Sequence<linguistic2::SingleProofreadingError> gcErrors(0);
 	sal_Int32 gcI = 0;
 	sal_Int32 vErrorCount = 0;
 	while (paraLen < 1000000) { // sanity check
 		voikko_grammar_error vError = voikko_next_grammar_error_cstr(
 			voikko_handle, textUtf8.getStr(), paraLen, 0, vErrorCount++);
 		if (vError.error_code == 0) break;
-		if ((sal_Int32) vError.startpos < result.nStartOfSentencePos) continue;
-		if ((sal_Int32) vError.startpos >= result.nEndOfSentencePos) break;
-		if ((sal_Int32) (vError.startpos + vError.errorlen) > result.nEndOfSentencePos)
-			result.nEndOfSentencePos = vError.startpos + vError.errorlen;
+		if ((sal_Int32) vError.startpos < result.nStartOfSentencePosition) continue;
+		if ((sal_Int32) vError.startpos >= result.nBehindEndOfSentencePosition) break;
+		if ((sal_Int32) (vError.startpos + vError.errorlen) > result.nBehindEndOfSentencePosition)
+			result.nBehindEndOfSentencePosition = vError.startpos + vError.errorlen;
 		
 		// we have a real grammar error
 		gcErrors.realloc(gcI + 1);
 		gcErrors[gcI].nErrorStart = vError.startpos;
 		gcErrors[gcI].nErrorLength = vError.errorlen;
-		gcErrors[gcI].nErrorLevel = vError.error_level;
-		gcErrors[gcI].nErrorType = text::TextMarkupType::GRAMMAR;
+		gcErrors[gcI].nErrorType = text::TextMarkupType::PROOFREADING;
 		OString commentOString = OString(voikko_error_message_cstr(vError.error_code,
 			thePropertyManager->getMessageLanguage()));
 		gcErrors[gcI].aShortComment = OStringToOUString(commentOString, RTL_TEXTENCODING_UTF8);
 		gcErrors[gcI].aFullComment = gcErrors[gcI].aShortComment;
-		gcErrors[gcI].aNewLocale = aLocale;
 
 		// add suggestions
 		int scount = 0;
@@ -146,16 +123,19 @@
 		gcI++;
 	}
 
-	result.aGrammarErrors = gcErrors;
+	result.aErrors = gcErrors;
+	result.nStartOfNextSentencePosition = result.nBehindEndOfSentencePosition;
 	return result;
 }
 
-sal_Bool SAL_CALL GrammarChecker::hasOptionsDialog() throw (uno::RuntimeException) {
-	return sal_False;
+void SAL_CALL GrammarChecker::ignoreRule(const OUString & /* aRuleIdentifier */, const lang::Locale & /* aLocale */)
+		throw (lang::IllegalArgumentException, uno::RuntimeException) {
+	// TODO: unimplemented
 }
 
-void SAL_CALL GrammarChecker::runOptionsDialog()
-	throw (uno::RuntimeException) { }
+void SAL_CALL GrammarChecker::resetIgnoreRules() throw (uno::RuntimeException) {
+	// TODO: unimplemented
+}
 
 void SAL_CALL GrammarChecker::initialize(const uno::Sequence<uno::Any> &)
 	throw (uno::RuntimeException, uno::Exception) {
Index: src/grammar/GrammarChecker.hxx
===================================================================
--- src/grammar/GrammarChecker.hxx	(revision 2435)
+++ src/grammar/GrammarChecker.hxx	(working copy)
@@ -21,8 +21,8 @@
 #include <cppuhelper/compbase4.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/linguistic2/XGrammarChecker.hpp>
-#include <com/sun/star/linguistic2/GrammarCheckingResult.hpp>
+#include <com/sun/star/linguistic2/XProofreader.hpp>
+#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/lang/XServiceDisplayName.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
@@ -38,7 +38,7 @@
 	private cppu::BaseMutex,
 	public cppu::WeakComponentImplHelper4
 	            <lang::XServiceInfo,
-	             linguistic2::XGrammarChecker,
+	             linguistic2::XProofreader,
 	             lang::XInitialization,
 	             lang::XServiceDisplayName> {
 
@@ -60,26 +60,18 @@
 	virtual sal_Bool SAL_CALL hasLocale(const lang::Locale & aLocale)
 		throw (uno::RuntimeException);
 
-	// linguistic2::XGrammarChecker:
+	// linguistic2::XProofreader:
 	virtual sal_Bool SAL_CALL isSpellChecker() throw (uno::RuntimeException);
-	virtual void SAL_CALL startDocument(sal_Int32 nDocId)
-		throw (uno::RuntimeException, lang::IllegalArgumentException);
-	virtual void SAL_CALL startParagraph(sal_Int32 nDocId)
-		throw (uno::RuntimeException, lang::IllegalArgumentException);
-	virtual void SAL_CALL endParagraph(sal_Int32 nDocId)
-		throw (uno::RuntimeException, lang::IllegalArgumentException);
-	virtual void SAL_CALL endDocument(sal_Int32 nDocId)
-		throw (uno::RuntimeException, lang::IllegalArgumentException);
-	virtual linguistic2::GrammarCheckingResult SAL_CALL doGrammarChecking(sal_Int32 nDocId,
+	virtual linguistic2::ProofreadingResult SAL_CALL doProofreading(
+		const OUString & aDocumentIdentifier,
 		const OUString & aText,
 		const lang::Locale & aLocale,
-		sal_Int32 nStartOfSentencePos, sal_Int32 nSuggestedSentenceEndPos,
-		const uno::Sequence<sal_Int32> & aLanguagePortions,
-		const uno::Sequence<lang::Locale> & aLanguagePortionsLocales)
+		sal_Int32 nStartOfSentencePos, sal_Int32 nSuggestedBehindEndOfSentencePosition,
+		const uno::Sequence<beans::PropertyValue> & aProperties)
 		throw (uno::RuntimeException, lang::IllegalArgumentException);
-	virtual sal_Bool SAL_CALL hasOptionsDialog() throw (uno::RuntimeException);
-	virtual void SAL_CALL runOptionsDialog()
-		throw (uno::RuntimeException);
+	virtual void SAL_CALL ignoreRule(const OUString & aRuleIdentifier, const lang::Locale & aLocale)
+		throw (lang::IllegalArgumentException, uno::RuntimeException);
+    virtual void SAL_CALL resetIgnoreRules() throw (uno::RuntimeException);
 
 	// ::com::sun::star::lang::XInitialization:
 	virtual void SAL_CALL initialize(const uno::Sequence<uno::Any> & aArguments)
@@ -106,8 +98,7 @@
 inline uno::Sequence<OUString> GrammarChecker::getSupportedServiceNames_static() {
 	uno::Sequence<OUString> snames(1);
 	VOIKKO_DEBUG("GrammarChecker::getSupportedServiceNames_static");
-	snames.getArray()[0] = A2OU("com.sun.star.linguistic2.GrammarChecker");
-	//snames.getArray()[1] = A2OU("voikko.GrammarChecker");
+	snames.getArray()[0] = A2OU("com.sun.star.linguistic2.Proofreader");
 	return snames;
 }
 
Index: src/registry.cxx
===================================================================
--- src/registry.cxx	(revision 2435)
+++ src/registry.cxx	(working copy)
@@ -71,7 +71,7 @@
 
 Sequence<OUString> SAL_CALL regGrammarSupportedServiceNames() {
 	Sequence<OUString> s(1);
-	s[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.GrammarChecker"));
+	s[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.Proofreader"));
 	return s;
 }
 


Index: openoffice.org-voikko.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org-voikko/devel/openoffice.org-voikko.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- openoffice.org-voikko.spec	19 Nov 2008 10:38:29 -0000	1.14
+++ openoffice.org-voikko.spec	28 Dec 2008 00:04:27 -0000	1.15
@@ -1,6 +1,6 @@
 Name:           openoffice.org-voikko
 Version:        3.0 
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Finnish spellchecker and hyphenator extension for OpenOffice.org
 
 Group:          Applications/Productivity
@@ -8,6 +8,8 @@
 URL:            http://voikko.sourceforge.net/
 # The usual format of stable release URLs
 Source0:        http://downloads.sourceforge.net/voikko/%{name}-%{version}.tar.gz
+# Fix building of the grammar checking code, patch from upstream
+Patch0:         OOO300_m14-fix-grammar-check-build.patch
 # The usual format of test release URLs
 #Source0:        http://www.puimula.org/htp/testing/%{name}-%{version}rc1.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -37,6 +39,7 @@
 
 %prep
 %setup -q
+%patch0 -p0
 
 
 # Make install-unpacked also builds before installing, leave the build section
@@ -85,6 +88,10 @@
 
 
 %changelog
+* Sun Dec 28 2008 Ville-Pekka Vainio <vpivaini AT cs.helsinki.fi> - 3.0-5
+- Add patch from upstream to fix FTBFS with OOO300_m14, the grammar
+  checking framework was changed
+
 * Wed Nov 19 2008 Ville-Pekka Vainio <vpivaini AT cs.helsinki.fi> - 3.0-4
 - Add Epoch 1 to all openoffice.org-core pre-/post-Requires to avoid bugs such
   as rhbz #472093 (incorrect openoffice.org-core dependency)




More information about the fedora-extras-commits mailing list