From: <mcu...@us...> - 2009-05-21 09:48:03
|
Revision: 1387 http://orm.svn.sourceforge.net/orm/?rev=1387&view=rev Author: mcurland Date: 2009-05-21 09:47:37 +0000 (Thu, 21 May 2009) Log Message: ----------- * Objectify fact type did not add name shape when fact type was already implicitly objectified. Broken in [1385] refs #321 * Fix reverse hyphen bind (reverse hyphen bind missed for reading '{0} -a r b- {1}') refs #263 * Automatically place the caret before the forward slash if a forward reading does not already exist. Tweak of [1355]. refs #331 * Fall back on ISurveyNode.SurveyName of an object for delete final shape message if a component name is not available. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/Shell/FactEditor/FactEditorLanguageService.cs trunk/ORMModel/Shell/ORMDesignerCommandManager.cs Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2009-05-21 01:04:05 UTC (rev 1386) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2009-05-21 09:47:37 UTC (rev 1387) @@ -1154,7 +1154,7 @@ // string mainPatternCommented = @"(?xn) //\G //# Test if there is a hyphen binding match before the next format replacement field - //(?(.*?\S-\s.*?(?<!\{)\{\d+\}(?!\})) + //(?((.(?!\s+-\S))*?\S-\s.*?(?<!\{)\{\d+\}(?!\})) // # If there is a hyphen bind before the next replacement field then use it // ((?<BeforeLeftHyphenWord>.*?\s??)(?<LeftHyphenWord>\S+?)(?<!(?<!\{)\{\d+\}(?!\}))-(?<AfterLeftHyphen>\s.*?)) // | @@ -1185,7 +1185,7 @@ System.Threading.Interlocked.CompareExchange<Regex>( ref myMainRegex, new Regex( - @"(?n)\G(?(.*?\S-\s.*?(?<!\{)\{\d+\}(?!\}))((?<BeforeLeftHyphenWord>.*?\s??)(?<LeftHyphenWord>\S+?)(?<!(?<!\{)\{\d+\}(?!\}))-(?<AfterLeftHyphen>\s.*?))|((?<BeforeLeftHyphenWord>.*?)))((?<!\{)\{)(?<ReplaceIndex>\d+)(\}(?!\}))((?=(?(.+(?<!\{)\{\d+\}(?!\}))(((?!(?<!\{)\{\d+\}(?!\})).)*?\s-\S.*?(?<!\{)\{\d+\}(?!\}))|([^\-]*?\s-\S.*?)))(?<BeforeRightHyphen>.*?\s+?)-(?<RightHyphenWord>\S+))?", + @"(?n)\G(?((.(?!\s+-\S))*?\S-\s.*?(?<!\{)\{\d+\}(?!\}))((?<BeforeLeftHyphenWord>.*?\s??)(?<LeftHyphenWord>\S+?)(?<!(?<!\{)\{\d+\}(?!\}))-(?<AfterLeftHyphen>\s.*?))|((?<BeforeLeftHyphenWord>.*?)))((?<!\{)\{)(?<ReplaceIndex>\d+)(\}(?!\}))((?=(?(.+(?<!\{)\{\d+\}(?!\}))(((?!(?<!\{)\{\d+\}(?!\})).)*?\s-\S.*?(?<!\{)\{\d+\}(?!\}))|([^\-]*?\s-\S.*?)))(?<BeforeRightHyphen>.*?\s+?)-(?<RightHyphenWord>\S+))?", RegexOptions.Compiled), null); regexMain = myMainRegex; Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2009-05-21 01:04:05 UTC (rev 1386) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2009-05-21 09:47:37 UTC (rev 1387) @@ -5061,12 +5061,29 @@ } // Part 1: Resize the existing fact shapes + bool missingNameShapes = false; foreach (PresentationElement pel in PresentationViewsSubject.GetPresentation(nestedFactType)) { FactTypeShape factShape = pel as FactTypeShape; if (factShape != null) { factShape.AutoResize(); + if (!missingNameShapes) + { + bool foundNameShape = false; + foreach (PresentationElement testNameShape in factShape.RelativeChildShapes) + { + if (testNameShape is ObjectifiedFactTypeNameShape) + { + foundNameShape = true; + break; + } + } + if (!foundNameShape) + { + missingNameShapes = true; + } + } } } @@ -5145,6 +5162,12 @@ } } #endif // TRACKNEWSHAPES + + // Make sure we have name shapes for all fact type shapes + if (missingNameShapes) + { + Diagram.FixUpDiagram(nestedFactType, nestingType); + } } /// <summary> /// DeleteRule: typeof(ORMSolutions.ORMArchitect.Core.ObjectModel.Objectification), FireTime=TopLevelCommit, Priority=DiagramFixupConstants.AddShapeRulePriority; Modified: trunk/ORMModel/Shell/FactEditor/FactEditorLanguageService.cs =================================================================== --- trunk/ORMModel/Shell/FactEditor/FactEditorLanguageService.cs 2009-05-21 01:04:05 UTC (rev 1386) +++ trunk/ORMModel/Shell/FactEditor/FactEditorLanguageService.cs 2009-05-21 09:47:37 UTC (rev 1387) @@ -1104,7 +1104,12 @@ // replace as if the opposite direction were selected. However, with the // added slash, the replacement fields are backwards, so we translate the // requested index against the known order. - return FormatReplacementField(reverseReadingOrderRoles[(replaceIndex + 1) % 2], reverseReadingOrderRoles, false); + string replacementField = FormatReplacementField(reverseReadingOrderRoles[(replaceIndex + 1) % 2], reverseReadingOrderRoles, false); + if (replaceIndex == 0) + { + newCaretPosition = replacementField.Length + insertAfter - 3; + } + return replacementField; } return null; }); Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2009-05-21 01:04:05 UTC (rev 1386) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2009-05-21 09:47:37 UTC (rev 1387) @@ -40,6 +40,7 @@ using ORMSolutions.ORMArchitect.Core.ShapeModel; using ORMSolutions.ORMArchitect.Framework.Shell; using System.Collections.ObjectModel; +using ORMSolutions.ORMArchitect.Framework.Shell.DynamicSurveyTreeGrid; namespace ORMSolutions.ORMArchitect.Core.Shell { @@ -1887,12 +1888,21 @@ if (newPelCount == 0) { - if (finalDeleteBehavior == FinalShapeDeleteBehavior.Prompt && - (int)DialogResult.No == VsShellUtilities.ShowMessageBox(view.ServiceProvider, - string.Format(CultureInfo.CurrentCulture, ResourceStrings.FinalShapeDeletionMessage, TypeDescriptor.GetClassName(backingMel), TypeDescriptor.GetComponentName(backingMel)), + if (finalDeleteBehavior == FinalShapeDeleteBehavior.Prompt) + { + string componentName = TypeDescriptor.GetComponentName(backingMel); + ISurveyNode surveyNode; + if (string.IsNullOrEmpty(componentName) && + null != (surveyNode = backingMel as ISurveyNode)) + { + componentName = surveyNode.SurveyName; + } + if ((int)DialogResult.No == VsShellUtilities.ShowMessageBox(view.ServiceProvider, + string.Format(CultureInfo.CurrentCulture, ResourceStrings.FinalShapeDeletionMessage, TypeDescriptor.GetClassName(backingMel), componentName), string.Empty, OLEMSGICON.OLEMSGICON_QUERY, OLEMSGBUTTON.OLEMSGBUTTON_YESNO, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_SECOND)) - { - continue; + { + continue; + } } backingMel.Delete(); if (backingObjectifiedType != null && !backingObjectifiedType.IsDeleted && PresentationViewsSubject.GetPresentation(backingObjectifiedType).Count <= 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |