Index: src/text/fmt/xp/fv_View.cpp =================================================================== RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View.cpp,v retrieving revision 1.633.2.5 diff -c -r1.633.2.5 fv_View.cpp *** src/text/fmt/xp/fv_View.cpp 10 Jun 2002 21:36:54 -0000 1.633.2.5 --- src/text/fmt/xp/fv_View.cpp 17 Jun 2002 12:33:12 -0000 *************** *** 3820,3825 **** --- 3820,3880 ---- { posStart = 2; } + + + #ifdef BIDI_ENABLED + // if the format change includes dom-dir, we need to force change + // of direction for the last run in the block, the EndOfParagraph + // run. (This should really not be necessary, the EndOfParagraph + // run should lookup its properties) + + bool bDomDirChange = false; + FriBidiCharType iDomDir = FRIBIDI_TYPE_LTR; + + const XML_Char * p = properties[0]; + + while(p) + { + if(!UT_strcmp(p,"dom-dir")) + { + bDomDirChange = true; + if(!UT_strcmp(p+1, "rtl")) + { + iDomDir = FRIBIDI_TYPE_RTL; + } + break; + } + p += 2; + } + + if(bDomDirChange) + { + + fl_BlockLayout * pBl = _findBlockAtPosition(posStart); + fl_BlockLayout * pBl2 = _findBlockAtPosition(posEnd); + + if(pBl2) + pBl2 = static_cast(pBl2->getNext()); + + while(pBl) + { + + if(iDomDir == FRIBIDI_TYPE_RTL) + { + static_cast(static_cast(pBl)->getLastContainer())->getLastRun()->setDirection(FRIBIDI_TYPE_LTR); + } + else + { + static_cast(static_cast(pBl)->getLastContainer())->getLastRun()->setDirection(FRIBIDI_TYPE_RTL); + } + + pBl = static_cast(pBl->getNext()); + if(pBl == pBl2) + break; + } + } + + #endif bRet = m_pDoc->changeStruxFmt(PTC_AddFmt,posStart,posEnd,NULL,properties,PTX_Block); _generalUpdate(); Index: src/wp/ap/xp/ap_EditMethods.cpp =================================================================== RCS file: /cvsroot/abi/src/wp/ap/xp/ap_EditMethods.cpp,v retrieving revision 1.477.2.4 diff -c -r1.477.2.4 ap_EditMethods.cpp *** src/wp/ap/xp/ap_EditMethods.cpp 10 Jun 2002 21:37:50 -0000 1.477.2.4 --- src/wp/ap/xp/ap_EditMethods.cpp 17 Jun 2002 12:33:26 -0000 *************** *** 6904,6910 **** ABIWORD_VIEW; pView->setShowPara(pFrameData->m_bShowPara); ! pView->notifyListeners(AV_CHG_FRAMEDATA); #if 1 // POLICY: make this the default for new frames, too XAP_App * pApp = pFrame->getApp(); --- 6904,6912 ---- ABIWORD_VIEW; pView->setShowPara(pFrameData->m_bShowPara); ! // need to update toolbar and entire layout (hidden runs emerging/hiding, etc.) ! ! pView->notifyListeners(AV_CHG_ALL); #if 1 // POLICY: make this the default for new frames, too XAP_App * pApp = pFrame->getApp(); *************** *** 7906,7923 **** if(pBl->getDominantDirection()== FRIBIDI_TYPE_RTL) { properties[1] = (XML_Char *) &dltr; ! //the last run in the block is the FmtMark, and we need //to reset its direction pBl->getLastLine()->getLastRun()->setDirection(FRIBIDI_TYPE_LTR); ! } else { properties[1] = (XML_Char *) &drtl; ! pBl->getLastLine()->getLastRun()->setDirection(FRIBIDI_TYPE_RTL); ! } // if the paragraph is was aligned either left or right, then --- 7908,7925 ---- if(pBl->getDominantDirection()== FRIBIDI_TYPE_RTL) { properties[1] = (XML_Char *) &dltr; ! /* //the last run in the block is the FmtMark, and we need //to reset its direction pBl->getLastLine()->getLastRun()->setDirection(FRIBIDI_TYPE_LTR); ! */ } else { properties[1] = (XML_Char *) &drtl; ! /* pBl->getLastLine()->getLastRun()->setDirection(FRIBIDI_TYPE_RTL); ! */ } // if the paragraph is was aligned either left or right, then